Diagram navigator structure does not match model explorer structure

I created a project (Test) with multiple models (e.g. fcwb-reverse). The model has two child diagrams (fcwb-reverse-classes, fcwb-reverse-packages). Now I expect the diagram navigator to show that structure. But it shows one diagram being the child of the other and not the model. Is this intended? How can I fix that?

Hi Lars,

The Model Explorer view is pretty straight forward, it simply shows the model element parent-child hierarchy with a tree view.

But when the Diagram Navigator is set to the “Diagram Hierarchy” view, it involves understanding of how it calculates the tree structure to make sense of it.

Say you have a Model named M, with two sub-diagrams D1 and D2. Both diagrams are empty. At this point both the Model Explorer and Diagram Navigator shows the same structure.

Now open D2, drag M from the Model Explorer to D2 to create a view. The Diagram Navigator now shows D1 is under D2 as a child, and M is gone.

So what happens? Since Diagram Navigator is view-oriented, so when consider the Model M, it will try to find its view, and the only view of M is in D2.

So D2 becomes the representative node for the Model M, D1 is a sub-diagram of M, so D1 is under D2’s tree node.

How about D2? D2 is also a sub-diagram of M, but D2 cannot be a child node of itself, so D2 becomes direct child node of the root (i.e. project node).

I hope this could clarify your doubts.

Best Regards,

Antony.

1 Like