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 Node
element
protected Node
parent
protected Node
position
-
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
All Methods Instance Methods Concrete Methods 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
-
Methods inherited from class com.uppaal.model.core2.AbstractCommand
getVersion, merge, 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:
move
in classAbstractTransaction
-
getElement
public Element 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
public Element getModifiedElement()
- Returns:
- the modified element or its closest relative (sibling or parent) if the element is not displayed.
-
-