|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jhotdraw.standard.AbstractTool
org.jhotdraw.standard.SelectionTool
org.jhotdraw.contrib.CustomSelectionTool
A SelectionTool, which recognizes double clicks and popup menu triggers. If a double click or popup trigger is encountered a hook method is called, which handles the event. This methods can be overriden in subclasse to provide customized behaviour. Popup menus must be registered with a Figure using the setAttribute() method. The key which associates a popup menu as an attribute is Figure.POPUP_MENU.
Nested Class Summary |
Nested classes inherited from class org.jhotdraw.standard.AbstractTool |
AbstractTool.EventDispatcher |
Constructor Summary | |
CustomSelectionTool(DrawingEditor editor)
Create an instance of this SelectionTool for the given view |
Method Summary | |
protected void |
handleMouseClick(java.awt.event.MouseEvent e,
int x,
int y)
Hook method which can be overriden by subclasses to provide specialised behaviour in the event of a mouse click. |
protected void |
handleMouseDoubleClick(java.awt.event.MouseEvent e,
int x,
int y)
Hook method which can be overriden by subclasses to provide specialised behaviour in the event of a mouse double click. |
protected void |
handleMouseDown(java.awt.event.MouseEvent e,
int x,
int y)
Hook method which can be overriden by subclasses to provide specialised behaviour in the event of a mouse down. |
protected void |
handleMouseUp(java.awt.event.MouseEvent e,
int x,
int y)
Hook method which can be overriden by subclasses to provide specialised behaviour in the event of a mouse up. |
protected void |
handlePopupMenu(java.awt.event.MouseEvent e,
int x,
int y)
Hook method which can be overriden by subclasses to provide specialised behaviour in the event of a popup trigger. |
void |
mouseDown(java.awt.event.MouseEvent e,
int x,
int y)
MouseListener method for mouseDown events. |
void |
mouseDrag(java.awt.event.MouseEvent e,
int x,
int y)
MouseListener method for mouseDrag events. |
void |
mouseUp(java.awt.event.MouseEvent e,
int x,
int y)
MouseListener method for mouseUp events. |
protected void |
showPopupMenu(Figure figure,
int x,
int y,
java.awt.Component comp)
This method displays a popup menu, if there is one registered with the Figure (the Figure's attributes are queried for Figure.POPUP_MENU which is used to indicate an association of a popup menu with the Figure). |
Methods inherited from class org.jhotdraw.standard.SelectionTool |
createAreaTracker, createDragTracker, createHandleTracker, getDelegateTool, mouseMove, setDelegateTool |
Methods inherited from class org.jhotdraw.standard.AbstractTool |
activate, addToolListener, checkUsable, createEventDispatcher, createViewChangeListener, deactivate, drawing, editor, getActiveDrawing, getActiveView, getAnchorX, getAnchorY, getEventDispatcher, getUndoActivity, isActive, isEnabled, isUsable, keyDown, removeToolListener, setAnchorX, setAnchorY, setEditor, setEnabled, setUndoActivity, setUsable, setView, view, viewCreated, viewDestroying, viewSelectionChanged |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public CustomSelectionTool(DrawingEditor editor)
editor
- DrawingEditor for which the SelectionTool gets the active viewMethod Detail |
public void mouseDown(java.awt.event.MouseEvent e, int x, int y)
mouseDown
in interface Tool
mouseDown
in class SelectionTool
e
- MouseEvent which should be interpretedx
- x coordinate of the MouseEventy
- y coordinate of the MouseEventpublic void mouseDrag(java.awt.event.MouseEvent e, int x, int y)
mouseDrag
in interface Tool
mouseDrag
in class SelectionTool
e
- MouseEvent which should be interpretedx
- x coordinate of the MouseEventy
- y coordinate of the MouseEventpublic void mouseUp(java.awt.event.MouseEvent e, int x, int y)
mouseUp
in interface Tool
mouseUp
in class SelectionTool
e
- MouseEvent which should be interpretedx
- x coordinate of the MouseEventy
- y coordinate of the MouseEventprotected void handleMouseDown(java.awt.event.MouseEvent e, int x, int y)
protected void handleMouseUp(java.awt.event.MouseEvent e, int x, int y)
protected void handleMouseClick(java.awt.event.MouseEvent e, int x, int y)
protected void handleMouseDoubleClick(java.awt.event.MouseEvent e, int x, int y)
protected void handlePopupMenu(java.awt.event.MouseEvent e, int x, int y)
protected void showPopupMenu(Figure figure, int x, int y, java.awt.Component comp)
figure
- Figure for which a popup menu should be displayedx
- x coordinate where the popup menu should be displayedy
- y coordinate where the popup menu should be displayedcomp
- Component which invoked the popup menu
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |