Package com.luciad.controllers
Class HoverEventHandler
java.lang.Object
com.luciad.controllers.HoverEventHandler
- All Implemented Interfaces:
AutoCloseable
Handler that translates hover gesture events to a hovering operation.
Features under the cursor will have their FeatureState#hover()
state updated.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
protected void
finalize()
long
Returns the margin used to detect if a feature is considered under the cursor or not.onMouseMoveEvent
(MouseMoveEvent moveEvent, Map map) Changes theFeatureState#hover()
state of features located under the mouse position.void
setMargin
(long margin) Sets the margin used to detect if a feature is considered under the cursor or not.
-
Constructor Details
-
HoverEventHandler
public HoverEventHandler()Creates a new instance.
-
-
Method Details
-
finalize
protected void finalize() -
close
public void close()- Specified by:
close
in interfaceAutoCloseable
-
onMouseMoveEvent
@NotNull public EventResult onMouseMoveEvent(@NotNull MouseMoveEvent moveEvent, @NotNull Map map) throws NullPointerException Changes theFeatureState#hover()
state of features located under the mouse position.- Parameters:
moveEvent
- a move event. Cannot benull
.map
- the map. Cannot benull
.- Returns:
- whether the move event is consumed or not. Always
EventResult#Consumed
. - Throws:
NullPointerException
- when passingnull
for the map or the event.- See Also:
-
setMargin
public void setMargin(long margin) Sets the margin used to detect if a feature is considered under the cursor or not.This margin is expressed in device independent pixels. By default, the margin is 5 pixels.
- Parameters:
margin
- the margin, defined in device independent pixels.
-
getMargin
public long getMargin()Returns the margin used to detect if a feature is considered under the cursor or not.The default value is 5 pixels.
- Returns:
- the margin used to detect if a feature is considered under the cursor or not.
-