Package com.uppaal.model.core2
Class InsertElementCommand
- java.lang.Object
-
- com.uppaal.model.core2.AbstractCommand
-
- com.uppaal.model.core2.AbstractTransaction
-
- com.uppaal.model.core2.InsertElementCommand
-
- All Implemented Interfaces:
Command
- Direct Known Subclasses:
InsertAnchoredElementCommand,InsertInstanceCommand
public class InsertElementCommand extends AbstractTransaction
A transaction command for inserting elements. The transaction supports optionally setting a position, repeatedly.
-
-
Field Summary
Fields Modifier and Type Field Description protected Nodeelementprotected Nodeparentprotected Nodeposition-
Fields inherited from class com.uppaal.model.core2.AbstractTransaction
commandManager, committed
-
Fields inherited from class com.uppaal.model.core2.AbstractCommand
version
-
-
Constructor Summary
Constructors Constructor Description InsertElementCommand(CommandManager commandManager, Node parent, Node position, Node element)Constructor
-
Method Summary
Modifier and Type Method Description protected voiddoCancel()protected voiddoExecute()protected voiddoUndo()ElementgetElement()Get the elementElementgetModifiedElement()voidmove(int x, int y)-
Methods inherited from class com.uppaal.model.core2.AbstractTransaction
cancel, commit, execute, undo
-
Methods inherited from class com.uppaal.model.core2.AbstractCommand
getVersion, setVersion
-
-
-
-
Constructor Detail
-
InsertElementCommand
public InsertElementCommand(CommandManager commandManager, Node parent, Node position, Node element)
Constructor- Parameters:
commandManager- - The command managerparent- - The parent nodeposition- - The positionelement- - The new element
-
-
Method Detail
-
move
public void move(int x, int y)- Overrides:
movein classAbstractTransaction
-
getElement
public Element getElement()
Get the element- Returns:
- element - The element
-
doCancel
protected void doCancel()
- Specified by:
doCancelin classAbstractTransaction
-
doExecute
protected void doExecute()
- Specified by:
doExecutein classAbstractTransaction
-
doUndo
protected void doUndo()
- Specified by:
doUndoin classAbstractTransaction
-
getModifiedElement
public Element getModifiedElement()
- Returns:
- the modified element or its closest relative (sibling or parent) if the element is not displayed.
-
-