Class TranslatingGraphMousePlugin
java.lang.Object
edu.uci.ics.jung.visualization.control.AbstractGraphMousePlugin
edu.uci.ics.jung.visualization.control.TranslatingGraphMousePlugin
- All Implemented Interfaces:
GraphMousePlugin, MouseListener, MouseMotionListener, EventListener
- Direct Known Subclasses:
LensTranslatingGraphMousePlugin, SatelliteTranslatingGraphMousePlugin
public class TranslatingGraphMousePlugin
extends AbstractGraphMousePlugin
implements MouseListener, MouseMotionListener
TranslatingGraphMousePlugin uses a MouseButtonOne press and
drag gesture to translate the graph display in the x and y
direction. The default MouseButtonOne modifier can be overridden
to cause a different mouse gesture to translate the display.
-
Field Summary
Fields inherited from class AbstractGraphMousePlugin
cursor, down, modifiers -
Constructor Summary
ConstructorsConstructorDescriptionTranslatingGraphMousePlugin(int modifiers) create an instance with passed modifer value -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidchack the modifiers.voidvoidvoidvoidCheck the event modifiers.voidunset the 'down' point and change the cursoe back to the system default cursorMethods inherited from class AbstractGraphMousePlugin
checkModifiers, getCursor, getModifiers, setCursor, setModifiers
-
Constructor Details
-
TranslatingGraphMousePlugin
public TranslatingGraphMousePlugin() -
TranslatingGraphMousePlugin
public TranslatingGraphMousePlugin(int modifiers) create an instance with passed modifer value- Parameters:
modifiers- the mouse event modifier to activate this function
-
-
Method Details
-
mousePressed
Check the event modifiers. Set the 'down' point for later use. If this event satisfies the modifiers, change the cursor to the system 'move cursor'- Specified by:
mousePressedin interfaceMouseListener- Parameters:
e- the event
-
mouseReleased
unset the 'down' point and change the cursoe back to the system default cursor- Specified by:
mouseReleasedin interfaceMouseListener
-
mouseDragged
chack the modifiers. If accepted, translate the graph according to the dragging of the mouse pointer- Specified by:
mouseDraggedin interfaceMouseMotionListener- Parameters:
e- the event
-
mouseClicked
- Specified by:
mouseClickedin interfaceMouseListener
-
mouseEntered
- Specified by:
mouseEnteredin interfaceMouseListener
-
mouseExited
- Specified by:
mouseExitedin interfaceMouseListener
-
mouseMoved
- Specified by:
mouseMovedin interfaceMouseMotionListener
-