CH.ifa.draw.contrib
Class CustomSelectionTool
- java.lang.Object
-
- CH.ifa.draw.standard.AbstractTool
-
- CH.ifa.draw.standard.SelectionTool
-
- CH.ifa.draw.contrib.CustomSelectionTool
-
- All Implemented Interfaces:
- Tool
- Direct Known Subclasses:
- DelegationSelectionTool
public class CustomSelectionTool extends SelectionTool
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.
-
-
Constructor Summary
Constructors Constructor and Description CustomSelectionTool(DrawingView view)Create an instance of this SelectionTool for the given view
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidmouseDown(java.awt.event.MouseEvent e, int x, int y)MouseListener method for mouseDown events.voidmouseDrag(java.awt.event.MouseEvent e, int x, int y)MouseListener method for mouseDrag events.voidmouseUp(java.awt.event.MouseEvent e, int x, int y)MouseListener method for mouseUp events.-
Methods inherited from class CH.ifa.draw.standard.AbstractTool
activate, deactivate, drawing, editor, keyDown, mouseMove, view
-
-
-
-
Constructor Detail
-
CustomSelectionTool
public CustomSelectionTool(DrawingView view)
Create an instance of this SelectionTool for the given view- Parameters:
view- DrawingView for which the SelectionTool operates
-
-
Method Detail
-
mouseDown
public void mouseDown(java.awt.event.MouseEvent e, int x, int y)MouseListener method for mouseDown events. If the popup trigger has been activated, then the appropriate hook method is called.- Specified by:
mouseDownin interfaceTool- Overrides:
mouseDownin classSelectionTool- Parameters:
e- MouseEvent which should be interpretedx- x coordinate of the MouseEventy- y coordinate of the MouseEvent
-
mouseDrag
public void mouseDrag(java.awt.event.MouseEvent e, int x, int y)MouseListener method for mouseDrag events. Usually, mouse drags are ignored for popup menus or double clicks.- Specified by:
mouseDragin interfaceTool- Overrides:
mouseDragin classSelectionTool- Parameters:
e- MouseEvent which should be interpretedx- x coordinate of the MouseEventy- y coordinate of the MouseEvent
-
mouseUp
public void mouseUp(java.awt.event.MouseEvent e, int x, int y)MouseListener method for mouseUp events. Depending on the kind of event the appropriate hook method is called (popupMenuUp for popup trigger, doubleMouseClick for a double click, and mouseUp() and mouseClick() for normal mouse clicks).- Specified by:
mouseUpin interfaceTool- Overrides:
mouseUpin classSelectionTool- Parameters:
e- MouseEvent which should be interpretedx- x coordinate of the MouseEventy- y coordinate of the MouseEvent
-
-
DataMelt 3.0 © DataMelt by jWork.ORG