uci.gef
Class ModeCreateFigPoly

java.lang.Object
  |
  +--uci.gef.Mode
        |
        +--uci.gef.ModeCreate
              |
              +--uci.gef.ModeCreateFigPoly
Direct Known Subclasses:
ModeCreateFigSpline

public class ModeCreateFigPoly
extends ModeCreate

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

See Also:
Serialized Form

Field Summary
protected  Handle _handle
           
protected  int _lastX
           
protected  int _lastY
           
protected  int _npoints
          The number of points added so far.
protected  int _startX
           
protected  int _startY
           
 
Fields inherited from class uci.gef.ModeCreate
_defaultHeight, _defaultWidth, _newItem, anchorX, anchorY
 
Fields inherited from class uci.gef.Mode
_args, _editor
 
Constructor Summary
ModeCreateFigPoly()
           
 
Method Summary
 Fig createNewItem(MouseEvent me, int snapX, int snapY)
          Create a new FigRect instance based on the given mouse down event and the state of the parent Editor.
 String instructions()
           
 void mouseDragged(MouseEvent me)
           
 void mouseMoved(MouseEvent me)
           
 void mousePressed(MouseEvent me)
           
 void mouseReleased(MouseEvent me)
           
protected  boolean nearLast(int x, int y)
          Internal function to see if the user clicked twice on the same spot.
 
Methods inherited from class uci.gef.ModeCreate
creationDrag, getInitialCursor, paint
 
Methods inherited from class uci.gef.Mode
canExit, done, getArg, getArgs, getEditor, keyPressed, keyReleased, keyTyped, mouseClicked, mouseEntered, mouseExited, print, setArg, setArgs, setCursor, setEditor, start
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_npoints

protected int _npoints
The number of points added so far.

_lastX

protected int _lastX

_lastY

protected int _lastY

_startX

protected int _startX

_startY

protected int _startY

_handle

protected Handle _handle
Constructor Detail

ModeCreateFigPoly

public ModeCreateFigPoly()
Method Detail

instructions

public String instructions()
Overrides:
instructions in class Mode

createNewItem

public Fig createNewItem(MouseEvent me,
                         int snapX,
                         int snapY)
Create a new FigRect instance based on the given mouse down event and the state of the parent Editor.
Overrides:
createNewItem in class ModeCreate

mousePressed

public void mousePressed(MouseEvent me)
Overrides:
mousePressed in class ModeCreate

mouseReleased

public void mouseReleased(MouseEvent me)
Overrides:
mouseReleased in class ModeCreate

mouseMoved

public void mouseMoved(MouseEvent me)
Overrides:
mouseMoved in class Mode

mouseDragged

public void mouseDragged(MouseEvent me)
Overrides:
mouseDragged in class ModeCreate

nearLast

protected boolean nearLast(int x,
                           int y)
Internal function to see if the user clicked twice on the same spot.