jfig.commands
Class ZoomRegionCommand

java.lang.Object
  extended byjfig.commands.Command
      extended byjfig.commands.ZoomRegionCommand

public class ZoomRegionCommand
extends Command

zoom into a user-specified region.


Field Summary
protected  int n_points
           
protected  java.awt.Point P1
           
protected  java.awt.Point P2
           
 
Fields inherited from class jfig.commands.Command
editor, objectCanvas, ready
 
Constructor Summary
ZoomRegionCommand(FigBasicEditor editor, FigCanvas objectCanvas)
           
 
Method Summary
 void execute()
          zoom into the region specified by this command.
 java.lang.String getDescription()
          one-line description of this command
 void mousePressed(FigCanvasEvent ME)
          react to a mouse click on the editor canvas
 java.lang.String toString()
          toString(): identify this ZoomRegionCommand
 void undo()
          no use trying to undo a zoom command.
 
Methods inherited from class jfig.commands.Command
cancel, getModifiedObjects, isReady, message, notifyEditor, statusMessage
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

P1

protected java.awt.Point P1

P2

protected java.awt.Point P2

n_points

protected int n_points
Constructor Detail

ZoomRegionCommand

public ZoomRegionCommand(FigBasicEditor editor,
                         FigCanvas objectCanvas)
Method Detail

execute

public void execute()
zoom into the region specified by this command. We won't register the zoom command with the UndoStack.

Overrides:
execute in class Command

undo

public void undo()
no use trying to undo a zoom command. Just ignore it.

Overrides:
undo in class Command

mousePressed

public void mousePressed(FigCanvasEvent ME)
Description copied from class: Command
react to a mouse click on the editor canvas

This method provides the central callback from the editor to its current command object. Passing a FigCanvasEvent parameter, the editor provides information both about the screen coordinates and the world coordinates of the mouse event.

Naturally, mouse presses are ignored for class Command.

Overrides:
mousePressed in class Command

toString

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

Overrides:
toString in class Command

getDescription

public java.lang.String getDescription()
Description copied from class: Command
one-line description of this command

return a one-line desription of this command, e.g. to label the undo/redo buttons, if any

Overrides:
getDescription in class Command