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
-
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
-
Field Details
-
Constructor Details
-
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 Details
-
move
public void move(int x, int y)- Overrides:
movein classAbstractTransaction
-
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
- Returns:
- the modified element or its closest relative (sibling or parent) if the element is not displayed.
-