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,java.awt.event.MouseListener,java.awt.event.MouseMotionListener,java.awt.event.MouseWheelListener,java.util.EventListener
- Enclosing class:
 - ContourPlot
 
public class ContourPlot.CoordSysPanning extends java.awt.event.MouseAdapter implements ContourPlot.InteractionConstants
The CoordSysPanning class implements aMouseListenerandMouseMotionListenerthat realize panning functionality for the coordinate view of theContourPlot.CoordSysRenderer. When registering this with anContourPlot.JPlotterCanvasand 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 theextModifierMaskhas to be overridden.
For example to not need to press any key:new CoordSysPanning(canvas){{extModifierMask=0;}}.register();- Author:
 - hageldave
 
 
- 
- 
Field Summary
Fields Modifier and Type Field Description protected intaxesprotected java.awt.Componentcanvasprotected ContourPlot.CoordSysRenderercoordsysprotected intextModifierMaskprotected java.awt.PointstartPoint- 
Fields inherited from interface gov.nih.mipav.model.algorithms.ContourPlot.InteractionConstants
X_AXIS, Y_AXIS 
 - 
 
- 
Constructor Summary
Constructors Constructor Description CoordSysPanning(ContourPlot.JPlotterCanvas canvas, ContourPlot.CoordSysRenderer coordsys)Creates a newContourPlot.CoordSysPanningfor the specified canvas and corresponding coordinate system. 
- 
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ContourPlot.CoordSysPanningdeRegister()Removes thisContourPlot.CoordSysPanningfrom the associated canvas' mouse and mouse motion listeners.intgetPannedAxes()protected booleanisTriggerMouseEvent(java.awt.event.MouseEvent e, int method)voidmouseDragged(java.awt.event.MouseEvent e)voidmousePressed(java.awt.event.MouseEvent e)voidmouseReleased(java.awt.event.MouseEvent e)ContourPlot.CoordSysPanningregister()Adds thisContourPlot.CoordSysPanningasMouseListenerandMouseMotionListenerto the associated canvas.ContourPlot.CoordSysPanningsetPannedAxes(int axes)Sets the axes to which this panning is applied. 
 - 
 
- 
- 
Field Detail
- 
startPoint
protected java.awt.Point startPoint
 
- 
canvas
protected java.awt.Component canvas
 
- 
coordsys
protected ContourPlot.CoordSysRenderer coordsys
 
- 
extModifierMask
protected int extModifierMask
 
- 
axes
protected int axes
 
 - 
 
- 
Constructor Detail
- 
CoordSysPanning
public CoordSysPanning(ContourPlot.JPlotterCanvas canvas, ContourPlot.CoordSysRenderer coordsys)
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 Detail
- 
mousePressed
public void mousePressed(java.awt.event.MouseEvent e)
- Specified by:
 mousePressedin interfacejava.awt.event.MouseListener- Overrides:
 mousePressedin classjava.awt.event.MouseAdapter
 
- 
mouseDragged
public void mouseDragged(java.awt.event.MouseEvent e)
- Specified by:
 mouseDraggedin interfacejava.awt.event.MouseMotionListener- Overrides:
 mouseDraggedin classjava.awt.event.MouseAdapter
 
- 
mouseReleased
public void mouseReleased(java.awt.event.MouseEvent e)
- Specified by:
 mouseReleasedin interfacejava.awt.event.MouseListener- Overrides:
 mouseReleasedin classjava.awt.event.MouseAdapter
 
- 
isTriggerMouseEvent
protected boolean isTriggerMouseEvent(java.awt.event.MouseEvent e, int method) 
- 
setPannedAxes
public ContourPlot.CoordSysPanning setPannedAxes(int axes)
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
public ContourPlot.CoordSysPanning register()
Adds thisContourPlot.CoordSysPanningasMouseListenerandMouseMotionListenerto the associated canvas.- Returns:
 - this for chaining
 
 
- 
deRegister
public ContourPlot.CoordSysPanning deRegister()
Removes thisContourPlot.CoordSysPanningfrom the associated canvas' mouse and mouse motion listeners.- Returns:
 - this for chaining
 
 
 - 
 
 -