|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Tool
A tool defines a mode of the drawing view. All input events targeted to the drawing view are forwarded to its current tool.
Tools inform their editor when they are done with an interaction by calling the editor's toolDone() method. The Tools are created once and reused. They are initialized/deinitialized with activate()/deactivate().
State
Tool plays the role of the State. In encapsulates all state
specific behavior. DrawingView plays the role of the StateContext.
DrawingView
Method Summary | |
---|---|
void |
activate()
Activates the tool for the given view. |
void |
deactivate()
Deactivates the tool. |
void |
keyDown(java.awt.event.KeyEvent evt,
int key)
Handles key down events in the drawing view. |
void |
mouseDown(java.awt.event.MouseEvent e,
int x,
int y)
Handles mouse down events in the drawing view. |
void |
mouseDrag(java.awt.event.MouseEvent e,
int x,
int y)
Handles mouse drag events in the drawing view. |
void |
mouseMove(java.awt.event.MouseEvent evt,
int x,
int y)
Handles mouse moves (if the mouse button is up). |
void |
mouseUp(java.awt.event.MouseEvent e,
int x,
int y)
Handles mouse up in the drawing view. |
Method Detail |
---|
void activate()
void deactivate()
void mouseDown(java.awt.event.MouseEvent e, int x, int y)
void mouseDrag(java.awt.event.MouseEvent e, int x, int y)
void mouseUp(java.awt.event.MouseEvent e, int x, int y)
void mouseMove(java.awt.event.MouseEvent evt, int x, int y)
void keyDown(java.awt.event.KeyEvent evt, int key)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |