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 voidmouseClicked(java.awt.event.MouseEvent e)voidmouseDragged(java.awt.event.MouseEvent e)chack the modifiers.voidmouseEntered(java.awt.event.MouseEvent e)voidmouseExited(java.awt.event.MouseEvent e)voidmouseMoved(java.awt.event.MouseEvent e)voidmousePressed(java.awt.event.MouseEvent e)Check the event modifiers.voidmouseReleased(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:
mousePressedin 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:
mouseReleasedin 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:
mouseDraggedin interfacejava.awt.event.MouseMotionListener- Parameters:
e- the event
-
mouseClicked
public void mouseClicked(java.awt.event.MouseEvent e)
- Specified by:
mouseClickedin interfacejava.awt.event.MouseListener
-
mouseEntered
public void mouseEntered(java.awt.event.MouseEvent e)
- Specified by:
mouseEnteredin interfacejava.awt.event.MouseListener
-
mouseExited
public void mouseExited(java.awt.event.MouseEvent e)
- Specified by:
mouseExitedin interfacejava.awt.event.MouseListener
-
mouseMoved
public void mouseMoved(java.awt.event.MouseEvent e)
- Specified by:
mouseMovedin interfacejava.awt.event.MouseMotionListener
-
-