edu.usc.cse.desi.command
Class ConstraintCommand

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

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

This command is issued when someone wants to change the size or shape of an on-screen object. As you notice, when the command is executed, it changes the model, not the view. The view gets changed when it is notified of the change by the model.

Author:
Nels Started Mar 3, 2004

Field Summary
private  AbstractNodeViewModel model
           
private  org.eclipse.draw2d.geometry.Point newLocation
           
private  org.eclipse.draw2d.geometry.Dimension newSize
           
private  org.eclipse.draw2d.geometry.Point oldLocation
           
private  org.eclipse.draw2d.geometry.Dimension oldSize
           
 
Fields inherited from class org.eclipse.gef.commands.Command
 
Constructor Summary
ConstraintCommand()
           
ConstraintCommand(java.lang.String label)
           
 
Method Summary
 void execute()
           
 void redo()
           
 void setLocation(org.eclipse.draw2d.geometry.Point p)
           
 void setLocation(org.eclipse.draw2d.geometry.Rectangle r)
           
 void setModel(AbstractNodeViewModel model)
           
 void setSize(org.eclipse.draw2d.geometry.Dimension d)
           
 void undo()
           
 
Methods inherited from class org.eclipse.gef.commands.Command
canExecute, canUndo, chain, dispose, getDebugLabel, getLabel, setDebugLabel, setLabel
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

oldLocation

private org.eclipse.draw2d.geometry.Point oldLocation

newLocation

private org.eclipse.draw2d.geometry.Point newLocation

oldSize

private org.eclipse.draw2d.geometry.Dimension oldSize

newSize

private org.eclipse.draw2d.geometry.Dimension newSize

model

private AbstractNodeViewModel model
Constructor Detail

ConstraintCommand

public ConstraintCommand()

ConstraintCommand

public ConstraintCommand(java.lang.String label)
Method Detail

execute

public void execute()

redo

public void redo()

undo

public void undo()

setLocation

public void setLocation(org.eclipse.draw2d.geometry.Rectangle r)

setLocation

public void setLocation(org.eclipse.draw2d.geometry.Point p)

setSize

public void setSize(org.eclipse.draw2d.geometry.Dimension d)

setModel

public void setModel(AbstractNodeViewModel model)