Documentation of 'CH.ifa.draw.contrib.CustomSelectionTool' Java class
CustomSelectionTool
CH.ifa.draw.contrib

Class 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
      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.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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:
        mouseDown in interface Tool
        Overrides:
        mouseDown in class SelectionTool
        Parameters:
        e - MouseEvent which should be interpreted
        x - x coordinate of the MouseEvent
        y - 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:
        mouseDrag in interface Tool
        Overrides:
        mouseDrag in class SelectionTool
        Parameters:
        e - MouseEvent which should be interpreted
        x - x coordinate of the MouseEvent
        y - 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:
        mouseUp in interface Tool
        Overrides:
        mouseUp in class SelectionTool
        Parameters:
        e - MouseEvent which should be interpreted
        x - x coordinate of the MouseEvent
        y - y coordinate of the MouseEvent

DataMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.