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 Link icon

    • RotateEventHandler Link icon

      public RotateEventHandler()
      Creates a new instance.
  • 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
    • onDragEvent Link icon

      @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 Link icon

      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 Link icon

      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 Link icon

      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 Link icon

      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: