public class Commands
extends java.lang.Object
GModel via EMF commands.
Example:
GModel model = GraphFactory.eINSTANCE.createGModel();
GNode node = GraphFactory.eINSTANCE.createGNode();
node.setX(100);
node.setY(50);
node.setWidth(150);
node.setHeight(200);
Commands.addNode(model, node);
Commands.undo(model);
Commands.redo(model);
| Modifier and Type | Method and Description |
|---|---|
static void |
addNode(de.tesis.dynaware.grapheditor.model.GModel model,
de.tesis.dynaware.grapheditor.model.GNode node)
Adds a node to the model.
|
static void |
clear(de.tesis.dynaware.grapheditor.model.GModel model)
Clears everything in the given model.
|
static void |
redo(de.tesis.dynaware.grapheditor.model.GModel model)
Attempts to redo the given model to its next state.
|
static void |
removeNode(de.tesis.dynaware.grapheditor.model.GModel model,
de.tesis.dynaware.grapheditor.model.GNode node)
Removes a node from the model.
|
static void |
undo(de.tesis.dynaware.grapheditor.model.GModel model)
Attempts to undo the given model to its previous state.
|
static void |
updateLayoutValues(org.eclipse.emf.common.command.CompoundCommand command,
de.tesis.dynaware.grapheditor.model.GModel model,
SkinLookup skinLookup)
Updates the model's layout values to match those in the skin instances.
|
public static void addNode(de.tesis.dynaware.grapheditor.model.GModel model,
de.tesis.dynaware.grapheditor.model.GNode node)
The node's x, y, width, and height values should be set before calling this method.
model - the GModel to which the node should be addednode - the GNode to add to the modelpublic static void removeNode(de.tesis.dynaware.grapheditor.model.GModel model,
de.tesis.dynaware.grapheditor.model.GNode node)
Also removes any connections that were attached to the node.
model - the GModel from which the node should be removednode - the GNode to remove from the modelpublic static void clear(de.tesis.dynaware.grapheditor.model.GModel model)
model - the GModel to be clearedpublic static void updateLayoutValues(org.eclipse.emf.common.command.CompoundCommand command,
de.tesis.dynaware.grapheditor.model.GModel model,
SkinLookup skinLookup)
This method adds set operations to the given compound command but does not execute it.
command - a CompoundCommand to which the set commands will be addedmodel - the GModel whose layout values should be updatedskinLookup - the SkinLookup in use for this graph editor instancepublic static void undo(de.tesis.dynaware.grapheditor.model.GModel model)
model - the GModel to undopublic static void redo(de.tesis.dynaware.grapheditor.model.GModel model)
model - the GModel to redoCopyright © 2014 TESIS DYNAware. All Rights Reserved.