jcreek.cke.command
Class EntityMoveCommand

java.lang.Object
  extended byjcreek.cke.command.CreekCommand
      extended byjcreek.cke.command.EntityMoveCommand
All Implemented Interfaces:
javax.swing.undo.UndoableEdit

public class EntityMoveCommand
extends CreekCommand

Title: JavaCreek Description: A Case Based Reasoning approach developed in Java Copyright: Copyright (c) 1999 Company: Phil Systems

Version:
Author:
Victor Dias

Field Summary
protected  int deltaX
          Delta X move of the entity list.
protected  int deltaY
          Delta Y move of the entity list.
protected  VertexList entities
          List of entities to be moved by the delta values.
 
Fields inherited from class jcreek.cke.command.CreekCommand
canUndoRedo, document
 
Constructor Summary
EntityMoveCommand(CreekDocument doc, VertexList nl, int dx, int dy)
          Constructor for this command.
 
Method Summary
 boolean addEdit(javax.swing.undo.UndoableEdit parm1)
          Try to merge anEdit with this edit.
 void die()
          May be sent to inform an edit that it should no longer be used.
 java.lang.String getPresentationName()
          Return the human-readable name for this action.
 java.lang.String getRedoPresentationName()
          Return the human-readable name for redoing this command.
 java.lang.String getUndoPresentationName()
          Return the human-readable name for undoing this command.
 boolean isSignificant()
          Return true if this command is not a side-effect of some other change.
 boolean perform()
          Perform the action for the first time.
 void redo()
          Moves the vertex back into the model.
 boolean replaceEdit(javax.swing.undo.UndoableEdit parm1)
          See if we can be the given edit, thus replacing it in the undo queue.
 void undo()
          Moves the moved entity back to where it was located.
 
Methods inherited from class jcreek.cke.command.CreekCommand
canRedo, canUndo, getDocument, replaced, setDocument
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

entities

protected VertexList entities
List of entities to be moved by the delta values.


deltaX

protected int deltaX
Delta X move of the entity list.


deltaY

protected int deltaY
Delta Y move of the entity list.

Constructor Detail

EntityMoveCommand

public EntityMoveCommand(CreekDocument doc,
                         VertexList nl,
                         int dx,
                         int dy)
Constructor for this command. Saves the entitylist and document for use with do, undo, and redo operations.

Parameters:
doc - document we're performed on
nl - entity list to be moved
dx - delta x move for entity list
dy - delta y move for entity list
Method Detail

getUndoPresentationName

public java.lang.String getUndoPresentationName()
Return the human-readable name for undoing this command.

Returns:
human-readable name for undoable form of this command

perform

public boolean perform()
Perform the action for the first time.

Specified by:
perform in class CreekCommand
Returns:
true if command executed, false if error

die

public void die()
May be sent to inform an edit that it should no longer be used.


isSignificant

public boolean isSignificant()
Return true if this command is not a side-effect of some other change. Moving a entity is always significant.

Returns:
true if change is a side-effect of other changes

redo

public void redo()
Moves the vertex back into the model.


undo

public void undo()
Moves the moved entity back to where it was located.


addEdit

public boolean addEdit(javax.swing.undo.UndoableEdit parm1)
Try to merge anEdit with this edit.

Returns:
true if anEdit was absorbed

getRedoPresentationName

public java.lang.String getRedoPresentationName()
Return the human-readable name for redoing this command.

Returns:
human-readable name for redoable form of this command

replaceEdit

public boolean replaceEdit(javax.swing.undo.UndoableEdit parm1)
See if we can be the given edit, thus replacing it in the undo queue.

Returns:
true if anEdit replaced

getPresentationName

public java.lang.String getPresentationName()
Return the human-readable name for this action.

Returns:
human-readable name for this command


Created at IDI, NTNU by the Artificial Intelligence and Learning group