|
JIDE 3.5.15 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.jidesoft.chart.event.MouseDragPanner
public class MouseDragPanner
A MouseListener and MouseMotionListener that effects a pan by changing the ranges of the supplied Chart's axes when the mouse is dragged.
As a user of this class, you can find out when a pan has occurred by registering as a
PanListener
This class also supports continuous panning, which means that the chart continues to move even after you have finished with the drag. A friction coefficient is applied to slow it down and eventually stop it. It gives the user the impression that the chart has momentum when you drag it.
Field Summary | |
---|---|
static String |
PROPERTY_HORIZONTAL_PAN
|
static String |
PROPERTY_VERTICAL_PAN
|
static String |
PROPERTY_X_LIMITS
|
static String |
PROPERTY_Y_LIMITS
|
Constructor Summary | |
---|---|
MouseDragPanner(Chart chart)
Create a MouseDragPanner on the supplied chart that pans in both directions. |
|
MouseDragPanner(Chart chart,
boolean panHorizontally,
boolean panVertically)
Create a MouseDragPanner on the supplied chart that pans in the specified directions. |
Method Summary | |
---|---|
void |
addPanListener(PanListener listener)
Register an object's interest in pan events |
void |
addPropertyChangeListener(PropertyChangeListener listener)
Register interest in the properties of this class |
Cursor |
getDragCursor()
Returns the Cursor that is shown while the chart canvas is being dragged |
double |
getFrictionCoefficient()
Returns the current friction coefficient, used with the continuous panning feature |
Range<?> |
getXLimits()
Returns the current limits for panning in the x direction |
Range<?> |
getYLimits()
Returns the current limits for panning in the y direction |
boolean |
isChangeCursorWhileDragging()
Returns a boolean to indicate whether the cursor is to change while the chart canvas is being dragged |
boolean |
isContinuous()
Returns a boolean to indicate whether the pan is continuous. |
boolean |
isHandled()
If this returns true, the handler has consumed the event. |
boolean |
isHorizontalPan()
Is panning allowed in the horizontal direction? |
boolean |
isVerticalPan()
Is panning allowed in the vertical direction? |
void |
mouseClicked(MouseEvent event)
One of the methods of the MouseHandler interface |
void |
mouseDragged(MouseEvent e)
Receive a mouseDrag gesture and interpret it as a pan |
void |
mouseEntered(MouseEvent event)
One of the methods of the MouseHandler interface |
void |
mouseExited(MouseEvent event)
One of the methods of the MouseHandler interface |
void |
mouseMoved(MouseEvent event)
One of the methods of the MouseHandler interface |
void |
mousePressed(MouseEvent e)
One of the methods of the MouseHandler interface |
void |
mouseReleased(MouseEvent e)
One of the methods of the MouseHandler interface |
void |
mouseWheelMoved(MouseWheelEvent e)
One of the methods of the MouseHandler interface |
void |
removePanListener(PanListener listener)
De-register an object's interest in pan events |
void |
removePropertyChangeListener(PropertyChangeListener listener)
De-register interest in the properties of this class |
void |
setChangeCursorWhileDragging(boolean changeCursorWhileDragging)
Specify whether the cursor should change while the chart canvas is being dragged. |
void |
setContinuous(boolean continuous)
Specify whether the pan is continuous. |
void |
setDragCursor(Cursor dragCursor)
Provide the facility to customise the cursor that is shown while the chart canvas is being dragged |
void |
setFrictionCoefficient(double friction)
Specify the friction coefficient used with the continuous panning feature. |
void |
setHandled(boolean handled)
Specify whether the handler has handled the event |
void |
setHorizontalPan(boolean horizontalPan)
Specify whether to allow horizontal panning |
void |
setVerticalPan(boolean verticalPan)
Specify whether to allow vertical panning |
void |
setXLimits(Range<?> xPanLimits)
Specify the limits in the x direction beyond which panning is not allowed |
void |
setYLimits(Range<?> yPanLimits)
Specify the limits in the y direction beyond which panning is not allowed |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String PROPERTY_HORIZONTAL_PAN
public static final String PROPERTY_VERTICAL_PAN
public static final String PROPERTY_X_LIMITS
public static final String PROPERTY_Y_LIMITS
Constructor Detail |
---|
public MouseDragPanner(Chart chart)
chart
- the chart we want to panpublic MouseDragPanner(Chart chart, boolean panHorizontally, boolean panVertically)
chart
- the chart we want to be able to panpanHorizontally
- whether the user is able to pan in the horizontal directionpanVertically
- whether the user is able to pan in the vertical directionMethod Detail |
---|
public void addPropertyChangeListener(PropertyChangeListener listener)
listener
- the object to be notified of property changespublic void removePropertyChangeListener(PropertyChangeListener listener)
listener
- the object to removed as a property change listenerpublic boolean isHorizontalPan()
public void setHorizontalPan(boolean horizontalPan)
horizontalPan
- the new value for the horizontalPan propertypublic boolean isVerticalPan()
public void setVerticalPan(boolean verticalPan)
verticalPan
- the new value for the verticalPan propertypublic Cursor getDragCursor()
public void setDragCursor(Cursor dragCursor)
dragCursor
- the Cursor to show while the chart canvas is being draggedpublic boolean isChangeCursorWhileDragging()
public void setChangeCursorWhileDragging(boolean changeCursorWhileDragging)
changeCursorWhileDragging
- whether to change the canvas while dragging the chartpublic boolean isContinuous()
public void setContinuous(boolean continuous)
continuous
- whether the pan should be continuouspublic double getFrictionCoefficient()
public void setFrictionCoefficient(double friction)
friction
- the friction coefficientpublic Range<?> getXLimits()
public void setXLimits(Range<?> xPanLimits)
xPanLimits
- the minimum and maximum possible x value under panningpublic Range<?> getYLimits()
public void setYLimits(Range<?> yPanLimits)
yPanLimits
- the minimum and maximum possible y value under panningpublic void addPanListener(PanListener listener)
listener
- the object interested in pan eventspublic void removePanListener(PanListener listener)
listener
- the object no longer interested in pan eventspublic void mousePressed(MouseEvent e)
mousePressed
in interface MouseListener
public void mouseReleased(MouseEvent e)
mouseReleased
in interface MouseListener
public void mouseClicked(MouseEvent event)
mouseClicked
in interface MouseListener
public void mouseEntered(MouseEvent event)
mouseEntered
in interface MouseListener
public void mouseExited(MouseEvent event)
mouseExited
in interface MouseListener
public void mouseDragged(MouseEvent e)
mouseDragged
in interface MouseMotionListener
public void mouseMoved(MouseEvent event)
mouseMoved
in interface MouseMotionListener
public boolean isHandled()
isHandled
in interface MouseHandler
public void setHandled(boolean handled)
setHandled
in interface MouseHandler
handled
- whether the event was handledpublic void mouseWheelMoved(MouseWheelEvent e)
mouseWheelMoved
in interface MouseWheelListener
|
JIDE 3.5.15 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |