Book a Demo

Author Topic: Cannot get nested classes in component to display  (Read 6356 times)

mse

  • EA User
  • **
  • Posts: 308
  • Karma: +1/-0
    • View Profile
Cannot get nested classes in component to display
« on: October 15, 2015, 11:51:20 pm »
I am trying to drag and drop a component with nested classes on a diagram. The component itself is drawn, however, the nested classes are not visible. In the Project Browser, the component clearly has two subclasses in a tree view:

Sensor
  L Aquisition
  L Filter

The component Sensor draws. However, Aquisition and Filter are not drawn.

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Cannot get nested classes in component to disp
« Reply #1 on: October 16, 2015, 12:16:14 am »
Right click/Structural Elements

q.

mse

  • EA User
  • **
  • Posts: 308
  • Karma: +1/-0
    • View Profile
Re: Cannot get nested classes in component to disp
« Reply #2 on: October 16, 2015, 01:55:15 am »
When I select Structural Elements, nothing shows in the list. It seems that structural elements is only for ports and Interfaces, but not classes. My case has a UML component with two UML classes inside.

Uffe

  • EA Practitioner
  • ***
  • Posts: 1859
  • Karma: +133/-14
  • Flutes: 1; Clarinets: 1; Saxes: 5 and counting
    • View Profile
Re: Cannot get nested classes in component to disp
« Reply #3 on: October 16, 2015, 02:57:37 am »
Hello,


No, you're right -- classes are not structural elements. You have to drag the classes onto the diagram separately.

Once they're placed there (you may need to increase the component's size) they will follow the component around when you drag it, but there's no way that I know of to make EA display them automatically.

If you go to Features & Properties -- Feature and Compartment visibility (Ctrl-Shift-Y) and select Structural Compartment, this will prevent you from dragging the classes out of the component once you've placed them on the diagram. But the classes still won't be displayed automatically.

There is another way, however.

If you create a composite diagram in your component, and place your classes on that, you can display that diagram either inside the component ("compartment", which I prefer) or change the component display to look like a diagram ("frame"); both options are under New Child Diagram.

With this, you can't interact with the individual classes in the "higher" diagram because they're not actually there, it's just an image of another diagram. But if you've got relationships between them those will show up.

HTH,


/Uffe
My theories are always correct, just apply them to the right reality.

mse

  • EA User
  • **
  • Posts: 308
  • Karma: +1/-0
    • View Profile
Re: Cannot get nested classes in component to disp
« Reply #4 on: October 16, 2015, 03:06:43 am »
I tried your second Suggestion, the "Show composite diagram in compartment" option and that worked perfectly. Now I can show the contents of the component on other diagrams. I can update the relations and see them automatically reflected. Thanks for the help! :)