JIDE 3.5.15

com.jidesoft.chart.event
Class ChartPanner

java.lang.Object
  extended by com.jidesoft.chart.event.ChartPanner

public class ChartPanner
extends Object

A class that can pan a chart, but provides no UI to do so. Instead, this class may be called by other UI elements - in particular it is used by the MouseDragPanner class. You will probably not need to use this class directly, but may wish to do so on occasions if you have alternative GUI elements in your user-interface that should drive chart panning.

As a user of this class, you can find out when a pan has occurred by registering as a PanListener


Constructor Summary
ChartPanner(Chart chart)
           
ChartPanner(Chart chart, boolean horizontalPan, boolean verticalPan)
           
 
Method Summary
 void addPanListener(PanListener listener)
          Register an object's interest in pan events
 void drag(Point dragStart, Point dragEnd)
           
protected  void firePan()
           
protected  void firePan(int xOffset, int yOffset)
           
protected  void firePan(PanEvent event)
           
 double getFrictionCoefficient()
          Returns the current friction coefficient, used with the continuous panning feature
 Range<?> getXLimits()
           
 Range<?> getYLimits()
           
 boolean isContinuous()
          Returns a boolean to indicate whether the pan is continuous.
 boolean isHorizontalPan()
           
 boolean isVerticalPan()
           
 void removePanListener(PanListener listener)
          De-register an object's interest in pan events
 void resetSpeeds()
           
 void setContinuous(boolean continuous)
          Specify whether the pan is continuous.
 void setFrictionCoefficient(double friction)
          Specify the friction coefficient used with the continuous panning feature.
 void setHorizontalPan(boolean horizontalPan)
           
 void setVerticalPan(boolean verticalPan)
           
 void setXLimits(Range<?> xLimits)
           
 void setYLimits(Range<?> yLimits)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ChartPanner

public ChartPanner(Chart chart)

ChartPanner

public ChartPanner(Chart chart,
                   boolean horizontalPan,
                   boolean verticalPan)
Method Detail

isHorizontalPan

public boolean isHorizontalPan()

setHorizontalPan

public void setHorizontalPan(boolean horizontalPan)

isVerticalPan

public boolean isVerticalPan()

setVerticalPan

public void setVerticalPan(boolean verticalPan)

isContinuous

public boolean isContinuous()
Returns a boolean to indicate whether the pan is continuous.

Returns:
a boolean to indicate whether the pan is continuous.

setContinuous

public void setContinuous(boolean continuous)
Specify whether the pan is continuous. A continuous pan is one where the chart continues to pan after you have released the mouse. It gives the effect of momentum to the drag, and is subject to a friction coefficient.

Parameters:
continuous - whether the pan should be continuous

resetSpeeds

public void resetSpeeds()

getFrictionCoefficient

public double getFrictionCoefficient()
Returns the current friction coefficient, used with the continuous panning feature

Returns:
the current friction coefficient

setFrictionCoefficient

public void setFrictionCoefficient(double friction)
Specify the friction coefficient used with the continuous panning feature. The friction coefficient is a number between 0 and 1 (default 0.1). The higher the value, the more friction and the quicker the chart will come to a halt when panned.

Parameters:
friction - the friction coefficient

addPanListener

public void addPanListener(PanListener listener)
Register an object's interest in pan events

Parameters:
listener - the object interested in pan events

removePanListener

public void removePanListener(PanListener listener)
De-register an object's interest in pan events

Parameters:
listener - the object no longer interested in pan events

firePan

protected void firePan()

firePan

protected void firePan(int xOffset,
                       int yOffset)

firePan

protected void firePan(PanEvent event)

getXLimits

public Range<?> getXLimits()

setXLimits

public void setXLimits(Range<?> xLimits)

getYLimits

public Range<?> getYLimits()

setYLimits

public void setYLimits(Range<?> yLimits)

drag

public void drag(Point dragStart,
                 Point dragEnd)

JIDE 3.5.15