|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectCH.ifa.draw.standard.AbstractTool
CH.ifa.draw.standard.SelectionTool
CH.ifa.draw.contrib.CustomSelectionTool
public class 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.
Field Summary |
---|
Fields inherited from class CH.ifa.draw.standard.AbstractTool |
---|
fAnchorX, fAnchorY, fView |
Constructor Summary | |
---|---|
CustomSelectionTool(DrawingView view)
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 CH.ifa.draw.standard.SelectionTool |
---|
createAreaTracker, createDragTracker, createHandleTracker |
Methods inherited from class CH.ifa.draw.standard.AbstractTool |
---|
activate, deactivate, drawing, editor, keyDown, mouseMove, view |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CustomSelectionTool(DrawingView view)
view
- DrawingView for which the SelectionTool operatesMethod 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 displayedcomponent
- Component which invoked the popup menu
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |