hades.gui
Class MoveToPositiveQuadrantCommand

java.lang.Object
  extended byjava.util.EventObject
      extended byhades.gui.Command
          extended byhades.gui.MoveToPositiveQuadrantCommand
All Implemented Interfaces:
java.awt.event.ActionListener, java.util.EventListener, FigCanvasListener, java.awt.event.KeyListener, java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.io.Serializable

public class MoveToPositiveQuadrantCommand
extends Command

MoveToPositiveQuadrantCommand - move all objects in a HADES Design so that all objects fit into the positive quadrant (all coordinates positive).

See Also:
Serialized Form

Field Summary
(package private)  ObjectCanvas canvas
           
(package private)  int dx
           
(package private)  int dy
           
(package private)  java.awt.Point newPos
           
(package private)  java.awt.Point oldPos
           
 
Fields inherited from class hades.gui.Command
console, debug, editor, ready, versionString
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
MoveToPositiveQuadrantCommand(Editor editor)
           
 
Method Summary
 void execute()
          calculate the bounding box of the current Design, then move everything into the positive quadrant.
 java.lang.String getDescription()
           
 void mousePressed(FigCanvasEvent ME)
          extract the screen and world coordinates of this Event, and dispatch to setPosition().
 void setPosition(java.awt.Point SP, java.awt.Point WP)
          this method is used only for consistency with all other Command classes.
 java.lang.String toString()
          toString(): identify this MoveToPositiveQuadrantCommand
 void undo()
          try to undo the action corresponding to this Command object.
 
Methods inherited from class hades.gui.Command
actionPerformed, cancel, dbg, getLogExtraArguments, initialize, isReady, keyPressed, keyReleased, keyTyped, message, mouseClicked, mouseDragged, mouseEntered, mouseExited, mouseMoved, mousePressed, mouseReleased, statusMessage, writePositionLogMessage
 
Methods inherited from class java.util.EventObject
getSource
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

oldPos

java.awt.Point oldPos

newPos

java.awt.Point newPos

canvas

ObjectCanvas canvas

dx

int dx

dy

int dy
Constructor Detail

MoveToPositiveQuadrantCommand

public MoveToPositiveQuadrantCommand(Editor editor)
Method Detail

execute

public void execute()
calculate the bounding box of the current Design, then move everything into the positive quadrant. The move distance is snapped to a multiple of 2400 units, that is, 1.0 inches.

Overrides:
execute in class Command

undo

public void undo()
Description copied from class: Command
try to undo the action corresponding to this Command object.

Overrides:
undo in class Command

mousePressed

public void mousePressed(FigCanvasEvent ME)
extract the screen and world coordinates of this Event, and dispatch to setPosition().

Specified by:
mousePressed in interface FigCanvasListener
Overrides:
mousePressed in class Command

setPosition

public void setPosition(java.awt.Point SP,
                        java.awt.Point WP)
this method is used only for consistency with all other Command classes.

Overrides:
setPosition in class Command

toString

public java.lang.String toString()
toString(): identify this MoveToPositiveQuadrantCommand

Overrides:
toString in class Command

getDescription

public java.lang.String getDescription()
Overrides:
getDescription in class Command