org.tigris.gef.base
Class ModeModify

java.lang.Object
  extended by org.tigris.gef.base.ModeImpl
      extended by org.tigris.gef.base.FigModifyingModeImpl
          extended by org.tigris.gef.base.ModeModify
All Implemented Interfaces:
java.awt.event.KeyListener, java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.io.Serializable, java.util.EventListener, FigModifyingMode, Mode

public class ModeModify
extends FigModifyingModeImpl

A Mode to process events from the Editor when the user is modifying a Fig. Right now users can drag one or more Figs around the drawing area, or they can move a handle on a single Fig.

See Also:
Fig, Selection, Serialized Form

Field Summary
 
Fields inherited from class org.tigris.gef.base.FigModifyingModeImpl
editor
 
Fields inherited from class org.tigris.gef.base.ModeImpl
_args
 
Constructor Summary
ModeModify(Editor par)
          Construct a new ModeModify with the given parent, and set the Anchor point to a default location (the _anchor's proper position will be determioned on mouse down).
 
Method Summary
 void done()
          When a Mode handles a certain event that indicates that the user wants to exit that Mode (e.g., a mouse up event after a drag in ModeCreateEdge) the Mode calls done to make switching to another Mode possible.
 java.lang.String instructions()
          Reply a string of instructions that should be shown in the statusbar when this mode starts.
 void keyPressed(java.awt.event.KeyEvent keyEvent)
           
 void keyReleased(java.awt.event.KeyEvent keyEvent)
           
 void mouseDragged(java.awt.event.MouseEvent mouseEvent)
          When the user drags the mouse two things can happen: (1) if the user is dragging the body of one or more Figs then they are all moved around the drawing area, or (2) if the user started dragging on a handle of one Fig then the user can drag the handle around the drawing area and the Fig reacts to that.
 void mousePressed(java.awt.event.MouseEvent me)
          When the user presses the mouse button on a Fig, this Mode starts preparing for future drag events by finding if a handle was clicked on.
 void mouseReleased(java.awt.event.MouseEvent me)
          On mouse up the modification interaction is done.
 void paint(java.awt.Graphics g)
          Modes can paint themselves to give the user feedback.
 
Methods inherited from class org.tigris.gef.base.FigModifyingModeImpl
getEditor, getInitialCursor, isFigEnclosedIn, print, setCursor, setEditor
 
Methods inherited from class org.tigris.gef.base.ModeImpl
canExit, getArg, getArgs, init, keyTyped, leave, mouseClicked, mouseEntered, mouseExited, mouseMoved, setArg, setArgs, start
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.tigris.gef.base.Mode
canExit, getArg, getArgs, init, setArg, setArgs, start
 

Constructor Detail

ModeModify

public ModeModify(Editor par)
Construct a new ModeModify with the given parent, and set the Anchor point to a default location (the _anchor's proper position will be determioned on mouse down).

Method Detail

instructions

public java.lang.String instructions()
Reply a string of instructions that should be shown in the statusbar when this mode starts.

Specified by:
instructions in interface FigModifyingMode
Overrides:
instructions in class FigModifyingModeImpl

mouseDragged

public void mouseDragged(java.awt.event.MouseEvent mouseEvent)
When the user drags the mouse two things can happen: (1) if the user is dragging the body of one or more Figs then they are all moved around the drawing area, or (2) if the user started dragging on a handle of one Fig then the user can drag the handle around the drawing area and the Fig reacts to that.

Specified by:
mouseDragged in interface java.awt.event.MouseMotionListener
Overrides:
mouseDragged in class ModeImpl

keyPressed

public void keyPressed(java.awt.event.KeyEvent keyEvent)
Specified by:
keyPressed in interface java.awt.event.KeyListener
Overrides:
keyPressed in class ModeImpl

keyReleased

public void keyReleased(java.awt.event.KeyEvent keyEvent)
Specified by:
keyReleased in interface java.awt.event.KeyListener
Overrides:
keyReleased in class ModeImpl

mousePressed

public void mousePressed(java.awt.event.MouseEvent me)
When the user presses the mouse button on a Fig, this Mode starts preparing for future drag events by finding if a handle was clicked on. This event is passed from ModeSelect.

Specified by:
mousePressed in interface java.awt.event.MouseListener
Overrides:
mousePressed in class ModeImpl

mouseReleased

public void mouseReleased(java.awt.event.MouseEvent me)
On mouse up the modification interaction is done.

Specified by:
mouseReleased in interface java.awt.event.MouseListener
Overrides:
mouseReleased in class ModeImpl

done

public void done()
Description copied from class: ModeImpl
When a Mode handles a certain event that indicates that the user wants to exit that Mode (e.g., a mouse up event after a drag in ModeCreateEdge) the Mode calls done to make switching to another Mode possible.

Specified by:
done in interface Mode
Overrides:
done in class FigModifyingModeImpl

paint

public void paint(java.awt.Graphics g)
Description copied from class: FigModifyingModeImpl
Modes can paint themselves to give the user feedback. For example, ModePlace paints the object being placed. Mode's are drawn on top of (after) the Editor's current view and on top of any selections.

Specified by:
paint in interface FigModifyingMode
Overrides:
paint in class FigModifyingModeImpl