kaapo.projectmanager.command
Class MoveConnectionPointEdit

java.lang.Object
  extended by javax.swing.undo.AbstractUndoableEdit
      extended by kaapo.projectmanager.command.AbstractUndoableEdit
          extended by kaapo.projectmanager.command.MoveConnectionPointEdit
All Implemented Interfaces:
Serializable, UndoableEdit

public class MoveConnectionPointEdit
extends AbstractUndoableEdit

This class is an UndoableEdit that moves an point / segment of a Connection.

Author:
hprajani
See Also:
Serialized Form

Field Summary
 
Fields inherited from class kaapo.projectmanager.command.AbstractUndoableEdit
pm, visibleDiagram
 
Fields inherited from class javax.swing.undo.AbstractUndoableEdit
RedoName, UndoName
 
Constructor Summary
MoveConnectionPointEdit(Point2D newPoint, int pathIndex)
          constructs an edit that moves a connection point
 
Method Summary
 boolean canRedo()
           
 boolean canUndo()
           
 void execute(ProjectManager pm)
          execution of this edit.
 void redo()
          Redos the moving.
 void undo()
          Undos the moving.
 
Methods inherited from class kaapo.projectmanager.command.AbstractUndoableEdit
changeCorrectVisibleDiagram
 
Methods inherited from class javax.swing.undo.AbstractUndoableEdit
addEdit, die, getPresentationName, getRedoPresentationName, getUndoPresentationName, isSignificant, replaceEdit, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MoveConnectionPointEdit

public MoveConnectionPointEdit(Point2D newPoint,
                               int pathIndex)
constructs an edit that moves a connection point

Parameters:
newPoint - new coordinate
pathIndex - moved point or segment
Method Detail

undo

public void undo()
Undos the moving.

Specified by:
undo in interface UndoableEdit
Overrides:
undo in class AbstractUndoableEdit
See Also:
UndoableEdit.undo()

redo

public void redo()
Redos the moving.

Specified by:
redo in interface UndoableEdit
Overrides:
redo in class AbstractUndoableEdit
See Also:
UndoableEdit.redo()

execute

public void execute(ProjectManager pm)
             throws EditFailedException
execution of this edit.

Specified by:
execute in class AbstractUndoableEdit
Parameters:
pm - the enviroment where the Edit is executed in.
Throws:
EditFailedException - when the execution ends for some reason.
See Also:
AbstractUndoableEdit.execute(kaapo.projectmanager.ProjectManager)

canUndo

public boolean canUndo()
Specified by:
canUndo in interface UndoableEdit
Overrides:
canUndo in class AbstractUndoableEdit
See Also:
UndoableEdit.canUndo()

canRedo

public boolean canRedo()
Specified by:
canRedo in interface UndoableEdit
Overrides:
canRedo in class AbstractUndoableEdit
See Also:
UndoableEdit.canRedo()