org.tigris.gef.base
Class ModeCreateFigImage

java.lang.Object
  extended by org.tigris.gef.base.ModeImpl
      extended by org.tigris.gef.base.FigModifyingModeImpl
          extended by org.tigris.gef.base.ModeCreate
              extended by org.tigris.gef.base.ModeCreateFigImage
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 ModeCreateFigImage
extends ModeCreate

A Mode to interpert user input while creating a FigImage. All of the actual event handling is inherited from ModeCreate. This class just implements the differences needed to make it specific to images.

See Also:
Serialized Form

Field Summary
protected  java.awt.Image _image
          The image to be placed.
 
Fields inherited from class org.tigris.gef.base.ModeCreate
_defaultHeight, _defaultWidth, _newItem, anchorX, anchorY
 
Fields inherited from class org.tigris.gef.base.FigModifyingModeImpl
editor
 
Fields inherited from class org.tigris.gef.base.ModeImpl
_args
 
Constructor Summary
ModeCreateFigImage()
           
 
Method Summary
 Fig createNewItem(java.awt.event.MouseEvent me, int snapX, int snapY)
          Create a new FigImage instance based on the given mouse down event and the state of the parent Editor.
 java.awt.Image image()
          get and set the image to be used for the new FigImage.
 void image(java.awt.Image i)
           
 java.lang.String instructions()
          Reply a string of instructions that should be shown in the statusbar when this mode starts.
 void mouseDragged(java.awt.event.MouseEvent me)
          Exactly the same as mouseMove.
 void mouseEntered(java.awt.event.MouseEvent me)
          When the mouse enters an Editor, create the FigImage and place it at the mouse position.
 void mouseExited(java.awt.event.MouseEvent me)
          When the mouse exits the editor, clean up the display a little.
 void mouseMoved(java.awt.event.MouseEvent me)
          Whem the user drags or moves the mouse, move the FigImage to the current mouse position.
 void mousePressed(java.awt.event.MouseEvent me)
          On mouse down, do nothing.
 
Methods inherited from class org.tigris.gef.base.ModeCreate
createFig, creationDrag, getInitialCursor, keyPressed, mouseReleased, paint
 
Methods inherited from class org.tigris.gef.base.FigModifyingModeImpl
done, getEditor, isFigEnclosedIn, print, setCursor, setEditor
 
Methods inherited from class org.tigris.gef.base.ModeImpl
canExit, getArg, getArgs, init, keyReleased, keyTyped, leave, mouseClicked, 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
 

Field Detail

_image

protected java.awt.Image _image
The image to be placed.

Constructor Detail

ModeCreateFigImage

public ModeCreateFigImage()
Method Detail

image

public java.awt.Image image()
get and set the image to be used for the new FigImage.


image

public void image(java.awt.Image i)

instructions

public java.lang.String instructions()
Description copied from class: FigModifyingModeImpl
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

createNewItem

public Fig createNewItem(java.awt.event.MouseEvent me,
                         int snapX,
                         int snapY)
Create a new FigImage instance based on the given mouse down event and the state of the parent Editor.

Specified by:
createNewItem in class ModeCreate

mouseEntered

public void mouseEntered(java.awt.event.MouseEvent me)
When the mouse enters an Editor, create the FigImage and place it at the mouse position.

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

mouseExited

public void mouseExited(java.awt.event.MouseEvent me)
When the mouse exits the editor, clean up the display a little.

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

mousePressed

public void mousePressed(java.awt.event.MouseEvent me)
On mouse down, do nothing.

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

mouseMoved

public void mouseMoved(java.awt.event.MouseEvent me)
Whem the user drags or moves the mouse, move the FigImage to the current mouse position.

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

mouseDragged

public void mouseDragged(java.awt.event.MouseEvent me)
Exactly the same as mouseMove.

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