Package org.jfree.chart
Class MouseWheelHandler
java.lang.Object
org.jfree.chart.MouseWheelHandler
- All Implemented Interfaces:
MouseWheelListener,Serializable,EventListener
A class that handles mouse wheel events for the
ChartPanel class.- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate ChartPanelThe chart panel.(package private) doubleThe zoom factor. -
Constructor Summary
ConstructorsConstructorDescriptionMouseWheelHandler(ChartPanel chartPanel) Creates a new instance for the specified chart panel. -
Method Summary
Modifier and TypeMethodDescriptiondoubleReturns the current zoom factor.private voidhandleZoomable(Zoomable zoomable, MouseWheelEvent e) Handle the case where a plot implements theZoomableinterface.voidHandles a mouse wheel event from the underlying chart panel.voidsetZoomFactor(double zoomFactor) Sets the zoom factor.
-
Field Details
-
chartPanel
The chart panel. -
zoomFactor
double zoomFactorThe zoom factor.
-
-
Constructor Details
-
MouseWheelHandler
Creates a new instance for the specified chart panel.- Parameters:
chartPanel- the chart panel (nullnot permitted).
-
-
Method Details
-
getZoomFactor
public double getZoomFactor()Returns the current zoom factor. The default value is 0.10 (ten percent).- Returns:
- The zoom factor.
- See Also:
-
setZoomFactor
public void setZoomFactor(double zoomFactor) Sets the zoom factor.- Parameters:
zoomFactor- the zoom factor.- See Also:
-
mouseWheelMoved
Handles a mouse wheel event from the underlying chart panel.- Specified by:
mouseWheelMovedin interfaceMouseWheelListener- Parameters:
e- the event.
-
handleZoomable
Handle the case where a plot implements theZoomableinterface.- Parameters:
zoomable- the zoomable plot.e- the mouse wheel event.
-