|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--uci.gef.Mode
This is the abstract superclass of all editor modes. A Mode is responsible for handling most of the events that come to the Editor. A Mode defines a context for interperting those events. For example, a mouse drag in ModeSelect will define a selection rectangle, while a mouse drag in ModeCreateEdge will drag out a rubberband line. Placing the logic for most event handing in Modes is key to keeping the Editor source code small and manageable, and also key to allowing addition of new kinds of user interactions without always modifying Editor and having to integrate ones modifications with other contributors modifications. Modes should interpert user input and ask the Editor to execute Cmds. Placing the logic to manipulate the document into Cmds helps keep Mode's small and promotes sharing of Cmd code.
Editor,
Cmd,
ModeSelect,
ModeCreateEdge, Serialized Form| Field Summary | |
protected Hashtable |
_args
Arguments to this mode. |
Editor |
_editor
The Editor that is in this mode. |
| Constructor Summary | |
Mode()
Construct a new Mode instance without any Editor as its parent, the parent must be filled in before the instance is actually used. |
|
Mode(Editor par)
Construct a new Mode instance with the given Editor as its _editor |
|
| Method Summary | |
boolean |
canExit()
Some Mode's should never be exited, but by default any Mode can exit. |
void |
done()
When a Mode handles a certain event that indicates that the user wants to exit that Mode (e.g., a mouse up event after a drag in ModeCreateEdge) the Mode calls done to set the parent Editor's Mode to some other Mode (normally ModeSelect). |
Object |
getArg(String s)
|
Hashtable |
getArgs()
|
Editor |
getEditor()
Get the parent Editor of this Mode |
Cursor |
getInitialCursor()
Returns the cursor that should be shown when this Mode starts. |
String |
instructions()
Reply a string of instructions that should be shown in the statusbar when this mode starts. |
void |
keyPressed(KeyEvent ke)
|
void |
keyReleased(KeyEvent ke)
|
void |
keyTyped(KeyEvent ke)
|
void |
mouseClicked(MouseEvent me)
|
void |
mouseDragged(MouseEvent me)
|
void |
mouseEntered(MouseEvent me)
|
void |
mouseExited(MouseEvent me)
|
void |
mouseMoved(MouseEvent me)
|
void |
mousePressed(MouseEvent me)
|
void |
mouseReleased(MouseEvent me)
|
void |
paint(Graphics g)
Modes can paint themselves to give the user feedback. |
void |
print(Graphics g)
Just calls paint(g) bt default. |
void |
setArg(String key,
Object value)
|
void |
setArgs(Hashtable args)
|
void |
setCursor(Cursor c)
Set the mouse cursor to some appropriate for this mode. |
void |
setEditor(Editor w)
Set the parent Editor of this Mode |
void |
start()
When the user performs the first AWT Event that indicate that they want to do some work in this mode, then change the global next mode. |
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
| Field Detail |
public Editor _editor
protected Hashtable _args
ModeCreateEdge| Constructor Detail |
public Mode(Editor par)
public Mode()
CmdSetMode| Method Detail |
public void setEditor(Editor w)
public Editor getEditor()
public Cursor getInitialCursor()
public void setArgs(Hashtable args)
public void setArg(String key,
Object value)
public Hashtable getArgs()
public Object getArg(String s)
public void keyPressed(KeyEvent ke)
public void keyReleased(KeyEvent ke)
public void keyTyped(KeyEvent ke)
public void mouseMoved(MouseEvent me)
public void mouseDragged(MouseEvent me)
public void mouseClicked(MouseEvent me)
public void mousePressed(MouseEvent me)
public void mouseReleased(MouseEvent me)
public void mouseExited(MouseEvent me)
public void mouseEntered(MouseEvent me)
public void done()
public void start()
public boolean canExit()
ModeManagerpublic String instructions()
public void setCursor(Cursor c)
public void paint(Graphics g)
public void print(Graphics g)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||