Package com.uppaal.model.core2
Class InsertEdgeCommand
- java.lang.Object
-
- com.uppaal.model.core2.AbstractCommand
-
- com.uppaal.model.core2.AbstractTransaction
-
- com.uppaal.model.core2.InsertEdgeCommand
-
- All Implemented Interfaces:
Command
public class InsertEdgeCommand extends AbstractTransaction
Transaction inserting the edge
-
-
Field Summary
-
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 InsertEdgeCommand(AbstractLocation source, int x, int y)
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addNail(int x, int y)
Add nail that the graphical layout of the edge.void
commit()
Commit the transaction.void
commit(AbstractLocation target)
Commit setting of the destination of this edgevoid
commitBranchPoint(int x, int y)
Commit the branch pointvoid
commitLocation(int x, int y)
Commit the locationprotected void
doCancel()
protected void
doExecute()
protected void
doUndo()
Element
getModifiedElement()
AbstractLocation
getSource()
Get the source of the edgeAbstractLocation
getTarget()
Get the target of the edgeboolean
hasNails()
Does the edge has nailsvoid
move(int x, int y)
-
Methods inherited from class com.uppaal.model.core2.AbstractTransaction
cancel, execute, undo
-
Methods inherited from class com.uppaal.model.core2.AbstractCommand
getVersion, merge, setVersion
-
-
-
-
Constructor Detail
-
InsertEdgeCommand
public InsertEdgeCommand(AbstractLocation source, int x, int y)
Constructor- Parameters:
source
- - The source locationx
- - The x value of the edgey
- - The y value of the edge
-
-
Method Detail
-
addNail
public void addNail(int x, int y)
Add nail that the graphical layout of the edge.- Parameters:
x
- - The x value of the edgey
- - The y value of the edge
-
move
public void move(int x, int y)
- Overrides:
move
in classAbstractTransaction
-
commitLocation
public void commitLocation(int x, int y)
Commit the location- Parameters:
x
- - The x value of the edgey
- - The y value of the edge
-
commitBranchPoint
public void commitBranchPoint(int x, int y)
Commit the branch point- Parameters:
x
- - The x value of the edgey
- - The y value of the edge
-
commit
public void commit(AbstractLocation target)
Commit setting of the destination of this edge- Parameters:
target
- - The location
-
hasNails
public boolean hasNails()
Does the edge has nails- Returns:
- True : The edge has the start node and the next node
-
getSource
public AbstractLocation getSource()
Get the source of the edge- Returns:
- The source location of the edge
-
getTarget
public AbstractLocation getTarget()
Get the target of the edge- Returns:
- The target location of the edge
-
commit
public void commit()
Description copied from class:AbstractTransaction
Commit the transaction.- Overrides:
commit
in classAbstractTransaction
-
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.
-
-