| Best practice for "invisible" figures with an EditPart? [message #1010887]
||Mon, 18 February 2013 12:20
|| Stephan Druskat
Registered: October 2011
Location: Berlin, Germany
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 .
Powered by FUDForum
. Page generated in 2.03004 seconds