Class ScrollEvent

java.lang.Object
com.luciad.input.ScrollEvent
All Implemented Interfaces:
IInputEvent, AutoCloseable

public final class ScrollEvent extends Object implements IInputEvent, AutoCloseable
Implementation of IInputEvent that represents a scroll gesture (for example using the mouse wheel).

This class contains the location, the scroll amount and direction and modifiers if any.

  • Constructor Details Link icon

    • ScrollEvent Link icon

      public ScrollEvent(@NotNull Coordinate location, @NotNull ModifierKeys modifierKeys, double deltaY)
      Creates a scroll event.
      Parameters:
      location - The location of the event, defined in device independent pixels.
      modifierKeys - The modifiers of the event.
      deltaY - the vertical scroll amount and direction.
  • Method Details Link icon

    • finalize Link icon

      protected void finalize()
      Overrides:
      finalize in class Object
    • close Link icon

      public void close()
      Specified by:
      close in interface AutoCloseable
    • getLocation Link icon

      @NotNull public Coordinate getLocation()
      Returns the position of the event.

      It is expressed in device independent pixel coordinates with top-left corner of the map being the (0,0) position.

      Returns:
      the position of the event.
    • getModifierKeys Link icon

      @NotNull public ModifierKeys getModifierKeys()
      Returns the modifiers of the event.
      Returns:
      the modifiers of the event.
    • getDeltaY Link icon

      public double getDeltaY()
      Returns the vertical scroll amount and direction.

      A positive value indicates scrolling up, a negative value indicates scrolling down.

      A delta of 1.0 (or -1.0) should be interpreted as follows:

      • for mouse wheels, this would correspond to 1 tick, typically 15 degrees of rotation
      • for other devices, this would correspond to 10 pixels (device independent pixels)
      Returns:
      the vertical scroll amount and scroll direction.