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 void
doCancel()
protected void
doExecute()
protected void
doUndo()
Element
getElement()
Get the elementElement
getModifiedElement()
void
move(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:
move
in classAbstractTransaction
-
getElement
Get the element- Returns:
- element - The element
-
doCancel
protected void doCancel()- Specified by:
doCancel
in classAbstractTransaction
-
doExecute
protected void doExecute()- Specified by:
doExecute
in classAbstractTransaction
-
doUndo
protected void doUndo()- Specified by:
doUndo
in classAbstractTransaction
-
getModifiedElement
- Returns:
- the modified element or its closest relative (sibling or parent) if the element is not displayed.
-