Class RotateEventHandler

java.lang.Object
com.luciad.controllers.RotateEventHandler
All Implemented Interfaces:
AutoCloseable

public final class RotateEventHandler extends Object implements AutoCloseable
Handler that translates drag gesture events to a rotate operation.

Rotation is done using a MapNavigator.RotateAction, please check this class documentation for more information on how the rotation is performed.

  • Constructor Details

    • RotateEventHandler

      public RotateEventHandler()
      Creates a new instance.
  • Method Details

    • finalize

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

      public void close()
      Specified by:
      close in interface AutoCloseable
    • onDragEvent

      @NotNull public EventResult onDragEvent(@NotNull DragEvent dragEvent, @NotNull Map map) throws NullPointerException
      Rotates the map's camera following the drag direction.

      The drag event is consumed only if the sequence of events is the following : a EventStatus#Start event, 0 or more EventStatus#InProgress event and finally a EventStatus#End event. If the sequence is not correct, this method returns EventResult#NotConsumed.

      Parameters:
      dragEvent - a drag event. Cannot be null.
      map - the map. Cannot be null.
      Returns:
      whether the drag event is consumed or not.
      Throws:
      NullPointerException - when passing null for the map or the event.
    • setYawEnabled

      public void setYawEnabled(boolean yawEnabled)
      Sets whether the RotateEventHandler can change the yaw of the camera.

      If true, that means that the horizontal variations of the drag events locations are considered. This is useful only if the map is 3D.

      Parameters:
      yawEnabled - the desired state of the flag.
    • isYawEnabled

      public boolean isYawEnabled()
      Returns whether the RotateEventHandler can change the yaw of the camera.

      The default value is true.

      Returns:
      whether the RotateEventHandler can change the yaw of the camera.
      See Also:
    • setPitchEnabled

      public void setPitchEnabled(boolean pitchEnabled)
      Sets whether the RotateEventHandler can change the pitch of the camera.

      If true, that means that the vertical variations of the drag events locations are considered. This is useful only if the map is 3D.

      Parameters:
      pitchEnabled - the desired state of the flag.
    • isPitchEnabled

      public boolean isPitchEnabled()
      Returns whether the RotateEventHandler can change the pitch of the camera.

      The default value is true.

      Returns:
      whether the RotateEventHandler can change the pitch of the camera.
      See Also: