roneditor.objectnetview.commands
Class CreateONArcCommand

java.lang.Object
  extended by org.eclipse.gef.commands.Command
      extended by roneditor.objectnetview.commands.CreateONArcCommand

public class CreateONArcCommand
extends org.eclipse.gef.commands.Command

Command class for a ONArc-Connection. Connects a ONNode with a other ONNode via a onARC.


Field Summary
private static java.lang.String ConnectionCommand_Description
           
private static java.lang.String ConnectionCommand_Label
           
protected  ronmodel.ONArc onArc
           
protected  ronmodel.ONNode source
           
protected  int sourceAnchorID
           
protected  ronmodel.ONNode target
           
protected  int targetAnchorID
           
protected  int weight
           
 
Constructor Summary
CreateONArcCommand()
          Constructor.
 
Method Summary
 boolean canExecute()
           
 void execute()
          Entry point for the command execution.
 java.lang.String getLabel()
          Returns the command label.
 ronmodel.ONArc getONArc()
           
 ronmodel.ONNode getSource()
           
 int getSourceAnchorID()
           
 ronmodel.ONNode getTarget()
           
 int getTargetAnchorID()
           
 int getWeight()
           
 void redo()
          Redo command execution.
 void setONArc(ronmodel.ONArc onArc)
           
 void setSource(ronmodel.ONNode source)
           
 void setSourceAnchorID(int sourceAnchorID)
           
 void setTarget(ronmodel.ONNode target)
           
 void setTargetAnchorID(int targetAnchorID)
           
 void setWeight(int weight)
           
 void undo()
          Undo command execution.
 
Methods inherited from class org.eclipse.gef.commands.Command
canUndo, chain, dispose, getDebugLabel, setDebugLabel, setLabel
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ConnectionCommand_Label

private static final java.lang.String ConnectionCommand_Label
See Also:
Constant Field Values

ConnectionCommand_Description

private static final java.lang.String ConnectionCommand_Description
See Also:
Constant Field Values

source

protected ronmodel.ONNode source

target

protected ronmodel.ONNode target

onArc

protected ronmodel.ONArc onArc

weight

protected int weight

sourceAnchorID

protected int sourceAnchorID

targetAnchorID

protected int targetAnchorID
Constructor Detail

CreateONArcCommand

public CreateONArcCommand()
Constructor.

Method Detail

canExecute

public boolean canExecute()
Overrides:
canExecute in class org.eclipse.gef.commands.Command
Returns:
true wenn source und target unterschiedliche Klassen haben( ONPlace -> ONTransition oder ONTransition -> ONPlace). false sonst

execute

public void execute()
Entry point for the command execution. ein ONArc wird im ObjectNet zwischen ein ONPlace und ONTransition eingefügt

Overrides:
execute in class org.eclipse.gef.commands.Command

getLabel

public java.lang.String getLabel()
Returns the command label.

Overrides:
getLabel in class org.eclipse.gef.commands.Command

redo

public void redo()
Redo command execution.

Overrides:
redo in class org.eclipse.gef.commands.Command

undo

public void undo()
Undo command execution.

Overrides:
undo in class org.eclipse.gef.commands.Command

setONArc

public void setONArc(ronmodel.ONArc onArc)

setSource

public void setSource(ronmodel.ONNode source)

setTarget

public void setTarget(ronmodel.ONNode target)

setWeight

public void setWeight(int weight)

getONArc

public ronmodel.ONArc getONArc()
Returns:
the onArc

getSource

public ronmodel.ONNode getSource()
Returns:
the source

getTarget

public ronmodel.ONNode getTarget()
Returns:
the target

getWeight

public int getWeight()
Returns:
the weight

getSourceAnchorID

public int getSourceAnchorID()

setSourceAnchorID

public void setSourceAnchorID(int sourceAnchorID)

getTargetAnchorID

public int getTargetAnchorID()

setTargetAnchorID

public void setTargetAnchorID(int targetAnchorID)