Class LensTranslatingGraphMousePlugin
java.lang.Object
edu.uci.ics.jung.visualization.control.AbstractGraphMousePlugin
edu.uci.ics.jung.visualization.control.TranslatingGraphMousePlugin
edu.uci.ics.jung.visualization.control.LensTranslatingGraphMousePlugin
- All Implemented Interfaces:
GraphMousePlugin, MouseListener, MouseMotionListener, EventListener
public class LensTranslatingGraphMousePlugin
extends TranslatingGraphMousePlugin
implements MouseListener, MouseMotionListener
Extends TranslatingGraphMousePlugin and adds the capability
to drag and resize the viewing
lens in the graph view. Mouse1 in the center moves the lens,
mouse1 on the edge resizes the lens. The default mouse button and
modifiers can be overridden in the constructor.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanprotected booleanprotected doubleFields inherited from class AbstractGraphMousePlugin
cursor, down, modifiers -
Constructor Summary
ConstructorsConstructorDescriptioncreate an instance with default modifiersLensTranslatingGraphMousePlugin(int modifiers) create an instance with passed modifer value -
Method Summary
Modifier and TypeMethodDescriptionvoidcheck the modifiers.voidCheck the event modifiers.voidunset the 'down' point and change the cursoe back to the system default cursorprivate voidsetViewCenter(MutableTransformer transformer, Point2D point) called to change the location of the lensprivate voidsetViewRadius(MutableTransformer transformer, Point2D point) called to change the radius of the lensprivate voidtestViewCenter(MutableTransformer transformer, Point2D point) called to set up translating the lens center or changing the sizeMethods inherited from class TranslatingGraphMousePlugin
mouseClicked, mouseEntered, mouseExited, mouseMovedMethods inherited from class AbstractGraphMousePlugin
checkModifiers, getCursor, getModifiers, setCursor, setModifiersMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface MouseListener
mouseClicked, mouseEntered, mouseExitedMethods inherited from interface MouseMotionListener
mouseMoved
-
Field Details
-
dragOnLens
protected boolean dragOnLens -
dragOnEdge
protected boolean dragOnEdge -
edgeOffset
protected double edgeOffset
-
-
Constructor Details
-
LensTranslatingGraphMousePlugin
public LensTranslatingGraphMousePlugin()create an instance with default modifiers -
LensTranslatingGraphMousePlugin
public LensTranslatingGraphMousePlugin(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- Overrides:
mousePressedin classTranslatingGraphMousePlugin- Parameters:
e- the event
-
setViewCenter
called to change the location of the lens- Parameters:
point-Function-
-
setViewRadius
called to change the radius of the lens- Parameters:
point-Function-
-
testViewCenter
called to set up translating the lens center or changing the size- Parameters:
point-Function-
-
mouseReleased
unset the 'down' point and change the cursoe back to the system default cursor- Specified by:
mouseReleasedin interfaceMouseListener- Overrides:
mouseReleasedin classTranslatingGraphMousePlugin
-
mouseDragged
check the modifiers. If accepted, move or resize the lens according to the dragging of the mouse pointer- Specified by:
mouseDraggedin interfaceMouseMotionListener- Overrides:
mouseDraggedin classTranslatingGraphMousePlugin- Parameters:
e- the event
-