|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--uci.gef.Mode
|
+--uci.gef.ModeModify
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.
Fig,
Seleciton, Serialized Form| Field Summary | |
protected Point |
_anchor
The point relative to the original postition of the Fig where the dragging started. |
protected int |
_constraint
Indicates the kind of movement constraint being applied. |
protected Handle |
_curHandle
The index of the handle that the user is dragging |
protected Rectangle |
_highlightTrap
|
protected int |
_lastX
the mouse location for the most recent drag event |
protected int |
_lastY
the mouse location for the most recent drag event |
protected boolean |
_minDeltaAchieved
Has the mouse moved enough to indicate that the user really wants to modify somthing? |
protected int |
_startX
the mouse location for the first mouse down event |
protected int |
_startY
the mouse location for the first mouse down event |
static int |
HORIZONTAL_CONSTRAINT
When _constraint == HORIZONTAL_CONSTRAINT, the user can only move selections left and right. |
static int |
MIN_DELTA
Minimum amoun that the user must move the mouse to indicate that he really wants to modify something. |
static int |
NO_CONSTRAINT
When _constraint == NO_CONSTRAINT, user can move selections any way |
static int |
VERTICAL_CONSTRAINT
When _constraint == VERTICAL_CONSTRAINT, the user can only move selections up and down. |
| Fields inherited from class uci.gef.Mode |
_args,
_editor |
| 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 | |
protected boolean |
checkMinDelta(int x,
int y)
Reply true if the user had moved the mouse enough to signify that (s)he really wants to make a change. |
void |
done()
|
String |
instructions()
Reply a string of instructions that should be shown in the statusbar when this mode starts. |
protected boolean |
legal(int dx,
int dy,
SelectionManager sm,
MouseEvent me)
|
void |
mouseDragged(MouseEvent me)
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(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(MouseEvent me)
On mouse up the modification interaction is done. |
void |
paint(Graphics g)
|
void |
start()
|
| Methods inherited from class uci.gef.Mode |
canExit,
getArg,
getArgs,
getEditor,
getInitialCursor,
keyPressed,
keyReleased,
keyTyped,
mouseClicked,
mouseEntered,
mouseExited,
mouseMoved,
print,
setArg,
setArgs,
setCursor,
setEditor |
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
| Field Detail |
public static final int MIN_DELTA
public static final int NO_CONSTRAINT
public static final int HORIZONTAL_CONSTRAINT
public static final int VERTICAL_CONSTRAINT
protected Point _anchor
protected int _lastX
protected int _lastY
protected int _startX
protected int _startY
protected boolean _minDeltaAchieved
protected Handle _curHandle
protected int _constraint
protected Rectangle _highlightTrap
| Constructor Detail |
public ModeModify(Editor par)
| Method Detail |
public String instructions()
public void mouseDragged(MouseEvent me)
public void mousePressed(MouseEvent me)
public void mouseReleased(MouseEvent me)
public void start()
public void done()
public void paint(Graphics g)
protected boolean checkMinDelta(int x,
int y)
protected boolean legal(int dx,
int dy,
SelectionManager sm,
MouseEvent me)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||