Class MouseWheelHandler

java.lang.Object
org.jfree.chart.MouseWheelHandler
All Implemented Interfaces:
MouseWheelListener, Serializable, EventListener

public class MouseWheelHandler extends Object implements MouseWheelListener, Serializable
A class that handles mouse wheel events for the ChartPanel class.
See Also:
  • Field Details

    • chartPanel

      private ChartPanel chartPanel
      The chart panel.
    • zoomFactor

      double zoomFactor
      The zoom factor.
  • Constructor Details

    • MouseWheelHandler

      public MouseWheelHandler(ChartPanel chartPanel)
      Creates a new instance for the specified chart panel.
      Parameters:
      chartPanel - the chart panel (null not 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

      public void mouseWheelMoved(MouseWheelEvent e)
      Handles a mouse wheel event from the underlying chart panel.
      Specified by:
      mouseWheelMoved in interface MouseWheelListener
      Parameters:
      e - the event.
    • handleZoomable

      private void handleZoomable(Zoomable zoomable, MouseWheelEvent e)
      Handle the case where a plot implements the Zoomable interface.
      Parameters:
      zoomable - the zoomable plot.
      e - the mouse wheel event.