edu.usc.cse.desi.command
Class CreateLinkCommand

java.lang.Object
  extended byorg.eclipse.gef.commands.Command
      extended byedu.usc.cse.desi.command.CreateLinkCommand

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

This command creates a link between two nodes. This would mean two components or two hosts, if I do it right.

Author:
Nels Started Mar 30, 2004

Field Summary
(package private)  AbstractConnectionViewModel myLink
           
(package private)  AbstractNodeViewModel myOldSource
           
(package private)  AbstractNodeViewModel myOldTarget
           
(package private)  AbstractNodeViewModel mySource
           
(package private)  AbstractNodeViewModel myTarget
           
 
Fields inherited from class org.eclipse.gef.commands.Command
 
Constructor Summary
CreateLinkCommand()
           
CreateLinkCommand(java.lang.String label)
           
 
Method Summary
 boolean canExecute()
          Tests to make sure that this command can be executed.
 void execute()
          Called when command is executed.
 AbstractConnectionViewModel getMyLink()
           
 AbstractDESIModel getMyOldSource()
           
 AbstractDESIModel getMyOldTarget()
           
 AbstractDESIModel getMySource()
           
 AbstractDESIModel getMyTarget()
           
 void setMyLink(AbstractConnectionViewModel model)
           
 void setMyOldSource(AbstractNodeViewModel model)
           
 void setMyOldTarget(AbstractNodeViewModel model)
           
 void setMySource(AbstractNodeViewModel model)
           
 void setMyTarget(AbstractNodeViewModel model)
           
 void undo()
          To undo the this command.
 
Methods inherited from class org.eclipse.gef.commands.Command
canUndo, chain, dispose, getDebugLabel, getLabel, redo, setDebugLabel, setLabel
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mySource

AbstractNodeViewModel mySource

myTarget

AbstractNodeViewModel myTarget

myOldSource

AbstractNodeViewModel myOldSource

myOldTarget

AbstractNodeViewModel myOldTarget

myLink

AbstractConnectionViewModel myLink
Constructor Detail

CreateLinkCommand

public CreateLinkCommand(java.lang.String label)

CreateLinkCommand

public CreateLinkCommand()
Method Detail

canExecute

public boolean canExecute()
Tests to make sure that this command can be executed. Now includes checking that the source is not the same as the target.


undo

public void undo()
To undo the this command.


execute

public void execute()
Called when command is executed.


getMyLink

public AbstractConnectionViewModel getMyLink()
Returns:

getMyOldSource

public AbstractDESIModel getMyOldSource()
Returns:

getMyOldTarget

public AbstractDESIModel getMyOldTarget()
Returns:

getMySource

public AbstractDESIModel getMySource()
Returns:

getMyTarget

public AbstractDESIModel getMyTarget()
Returns:

setMyLink

public void setMyLink(AbstractConnectionViewModel model)
Parameters:
model -

setMyOldSource

public void setMyOldSource(AbstractNodeViewModel model)
Parameters:
model -

setMyOldTarget

public void setMyOldTarget(AbstractNodeViewModel model)
Parameters:
model -

setMySource

public void setMySource(AbstractNodeViewModel model)
Parameters:
model -

setMyTarget

public void setMyTarget(AbstractNodeViewModel model)
Parameters:
model -