eclipsesource / papyrus-gefx

A new Editor kind for Papyrus, based on GEFx and GMF Runtime
0 stars 2 forks source link

[Renderer / Interactions] Properly distinguish between IRootPart and DiagramContentPart #27

Open CamilleLetavernier opened 5 years ago

CamilleLetavernier commented 5 years ago

Currently, we have a IRootPart (that doesn't have a Content), and a DIagramContentPart (That is a IContentPart representing the GMF Diagram, i.e. the root)

Since the DiagramContentPart doesn't have any visible geometry (It's a Pane with pickOnBounds=false), all events/policies/handlers are passed to the IRootPart (e.g. creation of nodes on the diagram surface is handled by IRootPart policies). The DiagramContentPart should be the one handling all root interactions (Creation, selection...).

Currently, because the IRootPart handles everything, we need some tests like this in the code:

assert target instanceof IContentPart || target instanceof IRootPart : "CreationFeedback can only be installed on IContentParts or IRootPart";

which should be simplified, so that the diagram surface (root) behaves like every other content part