|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.ObjectCommand
com.pnp.xfeature.commands.PasteCommand
public class PasteCommand
The Command class used to add a node saved in the clipboard to a feature model diagram
| Constructor Summary | |
|---|---|
PasteCommand(FeatureDiagramModel diagram,
FeatureNodeModel node,
java.lang.Object childSubtree,
int nodePosition)
Creates command that adds a node curently in the clipboard to the feature model |
|
| Method Summary | |
|---|---|
void |
execute()
calls pasteSubtree() method of the FeatureDiagramModel that adds the node (and its whole subtree) element to DOM model and consequently updates the canvas |
void |
redo()
calls execute() method |
void |
undo()
calls unpasteSubtree() method of the FeatureDiagramModel that saves the current position of the node in its parent's list of nodes (in the DOM model), removes the node from this list and consequently updates the canvas |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public PasteCommand(FeatureDiagramModel diagram,
FeatureNodeModel node,
java.lang.Object childSubtree,
int nodePosition)
diagram - the feature modelnode - the parent nodechildSubtree - reference to the node that that is to be added; since the node can have children, it is de facto reference to the whole subtreenodePosition - position where the new element is to be inserted (among other siblings)
ToDo: rename node to parent| Method Detail |
|---|
public void execute()
org.eclipse.gef.commands.Command#execute()public void redo()
org.eclipse.gef.commands.Command#redo()public void undo()
org.eclipse.gef.commands.Command#undo()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||