Class ViewTranslatingGraphMousePlugin
- java.lang.Object
-
- edu.uci.ics.jung.visualization.control.AbstractGraphMousePlugin
-
- edu.uci.ics.jung.visualization.control.ViewTranslatingGraphMousePlugin
-
- All Implemented Interfaces:
GraphMousePlugin
,java.awt.event.MouseListener
,java.awt.event.MouseMotionListener
,java.util.EventListener
public class ViewTranslatingGraphMousePlugin extends AbstractGraphMousePlugin implements java.awt.event.MouseListener, java.awt.event.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
Constructors Constructor Description ViewTranslatingGraphMousePlugin()
ViewTranslatingGraphMousePlugin(int modifiers)
create an instance with passed modifer value
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
mouseClicked(java.awt.event.MouseEvent e)
void
mouseDragged(java.awt.event.MouseEvent e)
chack the modifiers.void
mouseEntered(java.awt.event.MouseEvent e)
void
mouseExited(java.awt.event.MouseEvent e)
void
mouseMoved(java.awt.event.MouseEvent e)
void
mousePressed(java.awt.event.MouseEvent e)
Check the event modifiers.void
mouseReleased(java.awt.event.MouseEvent e)
unset the 'down' point and change the cursoe back to the system default cursor-
Methods inherited from class edu.uci.ics.jung.visualization.control.AbstractGraphMousePlugin
checkModifiers, getCursor, getModifiers, setCursor, setModifiers
-
-
-
-
Method Detail
-
mousePressed
public void mousePressed(java.awt.event.MouseEvent e)
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 interfacejava.awt.event.MouseListener
- Parameters:
e
- the event
-
mouseReleased
public void mouseReleased(java.awt.event.MouseEvent e)
unset the 'down' point and change the cursoe back to the system default cursor- Specified by:
mouseReleased
in interfacejava.awt.event.MouseListener
-
mouseDragged
public void mouseDragged(java.awt.event.MouseEvent e)
chack the modifiers. If accepted, translate the graph according to the dragging of the mouse pointer- Specified by:
mouseDragged
in interfacejava.awt.event.MouseMotionListener
- Parameters:
e
- the event
-
mouseClicked
public void mouseClicked(java.awt.event.MouseEvent e)
- Specified by:
mouseClicked
in interfacejava.awt.event.MouseListener
-
mouseEntered
public void mouseEntered(java.awt.event.MouseEvent e)
- Specified by:
mouseEntered
in interfacejava.awt.event.MouseListener
-
mouseExited
public void mouseExited(java.awt.event.MouseEvent e)
- Specified by:
mouseExited
in interfacejava.awt.event.MouseListener
-
mouseMoved
public void mouseMoved(java.awt.event.MouseEvent e)
- Specified by:
mouseMoved
in interfacejava.awt.event.MouseMotionListener
-
-