Package com.luciad.controllers
Class RotateEventHandler
java.lang.Object
com.luciad.controllers.RotateEventHandler
- All Implemented Interfaces:
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 Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
protected void
finalize()
boolean
Returns whether theRotateEventHandler
can change the pitch of the camera.boolean
Returns whether theRotateEventHandler
can change the yaw of the camera.onDragEvent
(DragEvent dragEvent, Map map) Rotates the map's camera following the drag direction.void
setPitchEnabled
(boolean pitchEnabled) Sets whether theRotateEventHandler
can change the pitch of the camera.void
setYawEnabled
(boolean yawEnabled) Sets whether theRotateEventHandler
can change the yaw of the camera.
-
Constructor Details
-
Method Details
-
finalize
protected void finalize() -
close
public void close()- Specified by:
close
in interfaceAutoCloseable
-
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 moreEventStatus#InProgress
event and finally aEventStatus#End
event. If the sequence is not correct, this method returnsEventResult#NotConsumed
.- Parameters:
dragEvent
- a drag event. Cannot benull
.map
- the map. Cannot benull
.- Returns:
- whether the drag event is consumed or not.
- Throws:
NullPointerException
- when passingnull
for the map or the event.
-
setYawEnabled
public void setYawEnabled(boolean yawEnabled) Sets whether theRotateEventHandler
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 is3D
.- Parameters:
yawEnabled
- the desired state of the flag.
-
isYawEnabled
public boolean isYawEnabled()Returns whether theRotateEventHandler
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 theRotateEventHandler
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 is3D
.- Parameters:
pitchEnabled
- the desired state of the flag.
-
isPitchEnabled
public boolean isPitchEnabled()Returns whether theRotateEventHandler
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:
-