Best practice for "invisible" figures with an EditPart? [message #1010887] |
Mon, 18 February 2013 07:20  |
Eclipse User |
|
|
|
I'm wondering whether there is such a thing as a best practice for handling cases where you must have an EditPart (e.g., to implement a needed Adapter) without wanting a Figure to actually be displayed.
In my case, I have a graph model where elements can be annotated with "meta" - non-semantic - information, e.g., at which coordinates a node should be placed. I.e., nodes don't "have" constraints which I can set/get via set/getConstraints() or a similar method. (I believe this to be a best practice in itself, as visual information shouldn't be mixed up with domain information? I'm using a mixed case.)
I need EditParts for this kind of annotation, because I need to notify their parent to refresh() whenever annotations' values are changed in a Command (e.g., node.getAnnotation("X_COORD").setValue(100)). The annotations' EditPart thus has an Adapter which calls getParent().refresh() in notifyChanged().
However, I obviously don't need a Figure for the annotations' EditPart, as this info shouldn't be displayed.
At the moment, I have the EditPart's createFigure() simply return new Figure().
Is there a better way to do this? I felt better if I wasn't creating such an awful amount of Figure objects .
Thanks!
|
|
|
|
|
|
Re: Best practice for "invisible" figures with an EditPart? [message #1012372 is a reply to message #1011945] |
Thu, 21 February 2013 07:39  |
Eclipse User |
|
|
|
Well, I've never used EMF before and I always have the visual representation tied to the domain model.
What about creating a visual representation model using the EMF as well? It would contain the constraints and a reference to the domain model. Some kind of wrapper.
This model would be model for EditParts.
|
|
|
Powered by
FUDForum. Page generated in 0.24885 seconds