Class ScalingMouseWheelListener

All Implemented Interfaces:
EventListener,, org.eclipse.swt.internal.SWTEventListener

public class ScalingMouseWheelListener extends Object implements
A MouseWheelListener that can be added to a NatTable instance to support zoom operations while having the CTRL key pressed and the mousewheel scrolled. Will support 12 dpi min and 288 dpi max.

To support zooming of images (e.g. checkboxes) the registration of the ImagePainter need to be overriden in updatePainter().

  • Constructor Details

    • ScalingMouseWheelListener

      public ScalingMouseWheelListener()
      Creates a new ScalingMouseWheelListener without an updater.

      Without an updater manually registered painters will not be updated and therefore won't reflect the updated scaling. This only works in combination with theme styling, as the painter update is implemented in the themes internally.

    • ScalingMouseWheelListener

      public ScalingMouseWheelListener(Consumer<IConfigRegistry> updater)
      Creates a new ScalingMouseWheelListener with the given updater.
      updater - The updater that should be called on zoom operations. Needed to reflect the updated scaling. E.g. re-register ImagePainters like the CheckBoxPainter, otherwise the images will not be updated according to the scaling.
  • Method Details

    • mouseScrolled

      public void mouseScrolled( e)
      Specified by:
      mouseScrolled in interface