Class TranslatingGraphMousePlugin
- java.lang.Object
-
- org.jungrapht.visualization.control.AbstractGraphMousePlugin
-
- org.jungrapht.visualization.control.TranslatingGraphMousePlugin
-
- All Implemented Interfaces:
MouseListener,MouseMotionListener,EventListener,GraphMousePlugin
- Direct Known Subclasses:
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.- Author:
- Tom Nelson
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.jungrapht.visualization.control.AbstractGraphMousePlugin
AbstractGraphMousePlugin.Selecting
-
-
Field Summary
Fields Modifier and Type Field Description protected inttranslatingMask-
Fields inherited from class org.jungrapht.visualization.control.AbstractGraphMousePlugin
cursor, down, modifiers
-
-
Constructor Summary
Constructors Constructor Description TranslatingGraphMousePlugin(int translatingMask)create an instance with passed translatingMask value
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidmouseClicked(MouseEvent e)voidmouseDragged(MouseEvent e)check the modifiers.voidmouseEntered(MouseEvent e)voidmouseExited(MouseEvent e)voidmouseMoved(MouseEvent e)voidmousePressed(MouseEvent e)Check the event modifiers.voidmouseReleased(MouseEvent e)unset the 'down' point and change the cursor back to the system default cursorStringtoString()-
Methods inherited from class org.jungrapht.visualization.control.AbstractGraphMousePlugin
checkModifiers, getCursor, getModifiersEx, setCursor, setModifiers
-
-
-
-
Method Detail
-
mousePressed
public void mousePressed(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 interfaceMouseListener- Parameters:
e- the event
-
mouseReleased
public void mouseReleased(MouseEvent e)
unset the 'down' point and change the cursor back to the system default cursor- Specified by:
mouseReleasedin interfaceMouseListener
-
mouseDragged
public void mouseDragged(MouseEvent e)
check the modifiers. If accepted, translate the graph according to the dragging of the mouse pointer- Specified by:
mouseDraggedin interfaceMouseMotionListener- Parameters:
e- the event
-
mouseClicked
public void mouseClicked(MouseEvent e)
- Specified by:
mouseClickedin interfaceMouseListener
-
mouseEntered
public void mouseEntered(MouseEvent e)
- Specified by:
mouseEnteredin interfaceMouseListener
-
mouseExited
public void mouseExited(MouseEvent e)
- Specified by:
mouseExitedin interfaceMouseListener
-
mouseMoved
public void mouseMoved(MouseEvent e)
- Specified by:
mouseMovedin interfaceMouseMotionListener
-
-