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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()booleanprotected voidfinalize()longReturns the margin used to detect if a feature is considered under the cursor or not.inthashCode()onMouseMoveEvent(MouseMoveEvent moveEvent, Map map) Changes theFeatureState#hover()state of features located under the mouse position.voidsetMargin(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:
closein 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 passingnullfor 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.
-
hashCode
public int hashCode() -
equals
-