|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.tigris.gef.base.ModeImpl
org.tigris.gef.base.FigModifyingModeImpl
org.tigris.gef.base.ModeCreate
org.tigris.gef.base.ModeCreateFigPoly
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.
Field Summary | |
protected org.tigris.gef.presentation.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 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 | |
ModeCreateFigPoly()
|
Method Summary | |
org.tigris.gef.presentation.Fig |
createNewItem(java.awt.event.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. |
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)
On mouse drag, resize the new item as the user moves the mouse. |
void |
mouseMoved(java.awt.event.MouseEvent me)
|
void |
mousePressed(java.awt.event.MouseEvent me)
On mouse down, make a new Fig in memory. |
void |
mouseReleased(java.awt.event.MouseEvent me)
On mouse up, officially add the new item to the parent Editor and select it. |
protected boolean |
nearLast(int x,
int y)
Internal function to see if the user clicked twice on the same spot. |
Methods inherited from class org.tigris.gef.base.ModeCreate |
creationDrag, getInitialCursor, keyPressed, 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, mouseEntered, mouseExited, 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 |
protected int _npoints
protected int _lastX
protected int _lastY
protected int _startX
protected int _startY
protected org.tigris.gef.presentation.Handle _handle
Constructor Detail |
public ModeCreateFigPoly()
Method Detail |
public java.lang.String instructions()
FigModifyingModeImpl
instructions
in interface FigModifyingMode
instructions
in class FigModifyingModeImpl
public org.tigris.gef.presentation.Fig createNewItem(java.awt.event.MouseEvent me, int snapX, int snapY)
createNewItem
in class ModeCreate
public void mousePressed(java.awt.event.MouseEvent me)
ModeCreate
mousePressed
in interface java.awt.event.MouseListener
mousePressed
in class ModeCreate
public void mouseReleased(java.awt.event.MouseEvent me)
ModeCreate
mouseReleased
in interface java.awt.event.MouseListener
mouseReleased
in class ModeCreate
public void mouseMoved(java.awt.event.MouseEvent me)
mouseMoved
in interface java.awt.event.MouseMotionListener
mouseMoved
in class ModeImpl
public void mouseDragged(java.awt.event.MouseEvent me)
ModeCreate
Note: _newItem has not been added to any Layer yet. So you cannot use _newItem.damage(), instead use editor.damageAll(_newItem).
mouseDragged
in interface java.awt.event.MouseMotionListener
mouseDragged
in class ModeCreate
protected boolean nearLast(int x, int y)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |