Class AbstractGraphMousePlugin

java.lang.Object
edu.uci.ics.jung.visualization.control.AbstractGraphMousePlugin
All Implemented Interfaces:
GraphMousePlugin
Direct Known Subclasses:
AbstractPopupGraphMousePlugin, AnimatedPickingGraphMousePlugin, AnnotatingGraphMousePlugin, EditingGraphMousePlugin, LabelEditingGraphMousePlugin, LensMagnificationGraphMousePlugin, PickingGraphMousePlugin, RotatingGraphMousePlugin, ScalingGraphMousePlugin, ShearingGraphMousePlugin, TranslatingGraphMousePlugin, ViewTranslatingGraphMousePlugin

public abstract class AbstractGraphMousePlugin extends Object implements GraphMousePlugin
a base class for GraphMousePlugin instances. Holds some members common to all GraphMousePlugins
  • Field Details

    • modifiers

      protected int modifiers
      modifiers to compare against mouse event modifiers
    • down

      protected Point down
      the location in the View where the mouse was pressed
    • cursor

      protected Cursor cursor
      the special cursor that plugins may display
  • Constructor Details

    • AbstractGraphMousePlugin

      public AbstractGraphMousePlugin(int modifiers)
      Creates an instance with the specified mouse event modifiers.
      Parameters:
      modifiers - the mouse event modifiers to use
  • Method Details

    • getModifiers

      public int getModifiers()
      getter for mouse modifiers
      Specified by:
      getModifiers in interface GraphMousePlugin
      Returns:
      the mouse event modifiers that will activate this plugin
    • setModifiers

      public void setModifiers(int modifiers)
      setter for mouse modifiers
      Specified by:
      setModifiers in interface GraphMousePlugin
      Parameters:
      modifiers - the mouse event modifiers that will activate this plugin
    • checkModifiers

      public boolean checkModifiers(MouseEvent e)
      check the mouse event modifiers against the instance member modifiers. Default implementation checks equality. Can be overridden to test with a mask
      Specified by:
      checkModifiers in interface GraphMousePlugin
      Parameters:
      e - an event to compare to
      Returns:
      whether the member modifiers match the event modifiers
    • getCursor

      public Cursor getCursor()
      Returns:
      Returns the cursor.
    • setCursor

      public void setCursor(Cursor cursor)
      Parameters:
      cursor - The cursor to set.