edu.uci.ics.jung.visualization.control
Class AbstractGraphMousePlugin

java.lang.Object
  extended by 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

Author:
thomasnelson

Field Summary
protected  Cursor cursor
          the special cursor that plugins may display
protected  Point down
          the location in the View where the mouse was pressed
protected  int modifiers
          modifiers to compare against mouse event modifiers
 
Constructor Summary
AbstractGraphMousePlugin(int modifiers)
          create an instance with passed values
 
Method Summary
 boolean checkModifiers(MouseEvent e)
          check the mouse event modifiers against the instance member modifiers.
 Cursor getCursor()
           
 int getModifiers()
          getter for mouse modifiers
 void setCursor(Cursor cursor)
           
 void setModifiers(int modifiers)
          setter for mouse modifiers
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

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 Detail

AbstractGraphMousePlugin

public AbstractGraphMousePlugin(int modifiers)
create an instance with passed values

Parameters:
modifiers -
Method Detail

getModifiers

public int getModifiers()
getter for mouse modifiers

Specified by:
getModifiers in interface GraphMousePlugin
Returns:
modifiers

setModifiers

public void setModifiers(int modifiers)
setter for mouse modifiers

Specified by:
setModifiers in interface GraphMousePlugin

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 modifers match the event modifiers

getCursor

public Cursor getCursor()
Returns:
Returns the cursor.

setCursor

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


Copyright © 2009. All Rights Reserved.