|Refresh command on diagram modification [message #505836]
||Tue, 05 January 2010 10:12
| Peder Herborg
Registered: July 2009
I have created a GMF editor which is used to create/edit the underlying model (XML). In the model, ordering of elements in various compartments is critical for the execution flow, thus the flow is visualized in GMF by creating (notational) connections between the different elements depending on their order. |
These connections are created by iterating though the list of elements in a compartment and creating connections with respect to the order of the elements. When the compound command is executed all connections are created/refreshed.
The question is where to execute this command?
At first I tried executing it in the refresh method of the diagram toplevel node, however this had the undesired results that any diagram modification consisted of two commands (also undo/redo). It also caused flickering.
I then tried adding it to the various editingpolicies: CompartmentEditPolicy, CompartmentComponentEditPolicy and CompartmentChildCreationEditPolicy.
And everything is now executed inside a CompositeTransactionalCommand with correct undo/redo functionality. However the refreshCommand is build before the diagram is up-to-date and thus, it does not include the latest modication command.
I tried building the refresh connections command dynamically during execution but this causes unwanted undo/redo results.How is this best solved using the GMF framework?
[Updated on: Tue, 05 January 2010 10:13]
Report message to a moderator
Powered by FUDForum
. Page generated in 0.03093 seconds