Package gov.nih.mipav.model.algorithms
Class ContourPlot.CoordSysPanning
java.lang.Object
java.awt.event.MouseAdapter
gov.nih.mipav.model.algorithms.ContourPlot.CoordSysPanning
- All Implemented Interfaces:
ContourPlot.InteractionConstants,MouseListener,MouseMotionListener,MouseWheelListener,EventListener
- Enclosing class:
ContourPlot
public class ContourPlot.CoordSysPanning
extends MouseAdapter
implements ContourPlot.InteractionConstants
The CoordSysPanning class implements a
and
that realize panning functionality
for the coordinate view of the
invalid reference
MouseListener
invalid reference
MouseMotionListener
ContourPlot.CoordSysRenderer.
When registering this with an ContourPlot.JPlotterCanvas and CoordSysRenderer dragging with the left mouse
button over the Canvas while holding down CTRL will set the coordinate view accordingly.
Intended use: CoordSysPanning pan = new CoordSysPanning(canvas, coordsys).register();
Per default the extended modifier mask for a dragging mouse event to trigger
panning is InputEvent.CTRL_DOWN_MASK.
If this is undesired the extModifierMask has to be overridden.
For example to not need to press any key:
new CoordSysPanning(canvas){{extModifierMask=0;}}.register();- Author:
- hageldave
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected intprotected Componentprotected ContourPlot.CoordSysRendererprotected intprotected PointFields inherited from interface gov.nih.mipav.model.algorithms.ContourPlot.InteractionConstants
X_AXIS, Y_AXIS -
Constructor Summary
ConstructorsConstructorDescriptionCoordSysPanning(ContourPlot.JPlotterCanvas canvas, ContourPlot.CoordSysRenderer coordsys) Creates a newContourPlot.CoordSysPanningfor the specified canvas and corresponding coordinate system. -
Method Summary
Modifier and TypeMethodDescriptionRemoves thisContourPlot.CoordSysPanningfrom the associated canvas' mouse and mouse motion listeners.intprotected booleanisTriggerMouseEvent(MouseEvent e, int method) voidvoidvoidregister()Adds thisContourPlot.CoordSysPanningasandinvalid reference
MouseListenerto the associated canvas.invalid reference
MouseMotionListenersetPannedAxes(int axes) Sets the axes to which this panning is applied.Methods inherited from class java.awt.event.MouseAdapter
mouseClicked, mouseEntered, mouseExited, mouseMoved, mouseWheelMoved
-
Field Details
-
startPoint
-
canvas
-
coordsys
-
extModifierMask
protected int extModifierMask -
axes
protected int axes
-
-
Constructor Details
-
CoordSysPanning
Creates a newContourPlot.CoordSysPanningfor the specified canvas and corresponding coordinate system.- Parameters:
canvas- displaying the coordsyscoordsys- the coordinate system to apply the panning in
-
-
Method Details
-
mousePressed
- Specified by:
mousePressedin interfaceMouseListener- Overrides:
mousePressedin classMouseAdapter
-
mouseDragged
- Specified by:
mouseDraggedin interfaceMouseMotionListener- Overrides:
mouseDraggedin classMouseAdapter
-
mouseReleased
- Specified by:
mouseReleasedin interfaceMouseListener- Overrides:
mouseReleasedin classMouseAdapter
-
isTriggerMouseEvent
-
setPannedAxes
Sets the axes to which this panning is applied. Default are both x and y axis.- Parameters:
axes-ContourPlot.InteractionConstants.X_AXIS,ContourPlot.InteractionConstants.Y_AXISorX_AXIS|Y_AXIS- Returns:
- this for chaining
-
getPannedAxes
public int getPannedAxes()- Returns:
- the axes this panning applies to, i.e.
ContourPlot.InteractionConstants.X_AXIS,ContourPlot.InteractionConstants.Y_AXISorX_AXIS|Y_AXIS
-
register
Adds thisContourPlot.CoordSysPanningasandinvalid reference
MouseListenerto the associated canvas.invalid reference
MouseMotionListener- Returns:
- this for chaining
-
deRegister
Removes thisContourPlot.CoordSysPanningfrom the associated canvas' mouse and mouse motion listeners.- Returns:
- this for chaining
-