Class ViewTranslatingGraphMousePlugin
java.lang.Object
edu.uci.ics.jung.visualization.control.AbstractGraphMousePlugin
edu.uci.ics.jung.visualization.control.ViewTranslatingGraphMousePlugin
- All Implemented Interfaces:
GraphMousePlugin
,MouseListener
,MouseMotionListener
,EventListener
public class ViewTranslatingGraphMousePlugin
extends AbstractGraphMousePlugin
implements MouseListener, MouseMotionListener
ViewTranslatingGraphMousePlugin uses a MouseButtonOne press and
drag gesture to translate the graph display in the x and y
direction by changing the AffineTransform applied to the Graphics2D.
The default MouseButtonOne modifier can be overridden
to cause a different mouse gesture to translate the display.
-
Field Summary
Fields inherited from class edu.uci.ics.jung.visualization.control.AbstractGraphMousePlugin
cursor, down, modifiers
-
Constructor Summary
ConstructorsConstructorDescriptionViewTranslatingGraphMousePlugin
(int modifiers) create an instance with passed modifer value -
Method Summary
Modifier and TypeMethodDescriptionvoid
void
chack the modifiers.void
void
void
void
Check the event modifiers.void
unset the 'down' point and change the cursoe back to the system default cursorMethods inherited from class edu.uci.ics.jung.visualization.control.AbstractGraphMousePlugin
checkModifiers, getCursor, getModifiers, setCursor, setModifiers
-
Constructor Details
-
ViewTranslatingGraphMousePlugin
public ViewTranslatingGraphMousePlugin() -
ViewTranslatingGraphMousePlugin
public ViewTranslatingGraphMousePlugin(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:
mousePressed
in interfaceMouseListener
- Parameters:
e
- the event
-
mouseReleased
unset the 'down' point and change the cursoe back to the system default cursor- Specified by:
mouseReleased
in interfaceMouseListener
-
mouseDragged
chack the modifiers. If accepted, translate the graph according to the dragging of the mouse pointer- Specified by:
mouseDragged
in interfaceMouseMotionListener
- Parameters:
e
- the event
-
mouseClicked
- Specified by:
mouseClicked
in interfaceMouseListener
-
mouseEntered
- Specified by:
mouseEntered
in interfaceMouseListener
-
mouseExited
- Specified by:
mouseExited
in interfaceMouseListener
-
mouseMoved
- Specified by:
mouseMoved
in interfaceMouseMotionListener
-