Class ScalingGraphMousePlugin
java.lang.Object
edu.uci.ics.jung.visualization.control.AbstractGraphMousePlugin
edu.uci.ics.jung.visualization.control.ScalingGraphMousePlugin
- All Implemented Interfaces:
GraphMousePlugin, MouseWheelListener, EventListener
- Direct Known Subclasses:
SatelliteScalingGraphMousePlugin
ScalingGraphMouse applies a scaling transformation to the graph layout.
The Vertices get closer or farther apart, but do not themselves change
size. ScalingGraphMouse uses MouseWheelEvents to apply the scaling.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected floatthe amount to zoom in byprotected floatthe amount to zoom out byprotected ScalingControlcontrols scaling operationsprotected booleanwhether to center the zoom at the current mouse positionFields inherited from class AbstractGraphMousePlugin
cursor, down, modifiers -
Constructor Summary
ConstructorsConstructorDescriptionScalingGraphMousePlugin(ScalingControl scaler, int modifiers) ScalingGraphMousePlugin(ScalingControl scaler, int modifiers, float in, float out) -
Method Summary
Modifier and TypeMethodDescriptionbooleancheck the mouse event modifiers against the instance member modifiers.floatgetIn()floatgetOut()voidzoom the display in or out, depending on the direction of the mouse wheel motion.voidsetIn(float in) voidsetOut(float out) voidsetScaler(ScalingControl scaler) voidsetZoomAtMouse(boolean zoomAtMouse) Methods inherited from class AbstractGraphMousePlugin
getCursor, getModifiers, setCursor, setModifiers
-
Field Details
-
in
protected float inthe amount to zoom in by -
out
protected float outthe amount to zoom out by -
zoomAtMouse
protected boolean zoomAtMousewhether to center the zoom at the current mouse position -
scaler
controls scaling operations
-
-
Constructor Details
-
ScalingGraphMousePlugin
-
ScalingGraphMousePlugin
-
-
Method Details
-
setZoomAtMouse
public void setZoomAtMouse(boolean zoomAtMouse) - Parameters:
zoomAtMouse- The zoomAtMouse to set.
-
checkModifiers
Description copied from class:AbstractGraphMousePlugincheck the mouse event modifiers against the instance member modifiers. Default implementation checks equality. Can be overridden to test with a mask- Specified by:
checkModifiersin interfaceGraphMousePlugin- Overrides:
checkModifiersin classAbstractGraphMousePlugin- Parameters:
e- an event to compare to- Returns:
- whether the member modifiers match the event modifiers
-
mouseWheelMoved
zoom the display in or out, depending on the direction of the mouse wheel motion.- Specified by:
mouseWheelMovedin interfaceMouseWheelListener
-
getIn
public float getIn()- Returns:
- Returns the zoom in value.
-
setIn
public void setIn(float in) - Parameters:
in- The zoom in value to set.
-
getOut
public float getOut()- Returns:
- Returns the zoom out value.
-
setOut
public void setOut(float out) - Parameters:
out- The zoom out value to set.
-
getScaler
-
setScaler
-