Package org.apache.sis.gui.map
Class ValuesUnderCursor
Object
ValuesUnderCursor
Provider of textual content to show in a
StatusBar
for values under cursor position.
When the mouse cursor moves, evaluate(DirectPosition)
is invoked with the same
"real world" coordinates than the ones shown in the status bar.
Multi-threading
Instances ofValueUnderCursor
do not need to be thread-safe.
ValuesUnderCursor
methods will be invoked from JavaFX thread.- Since:
- 1.1
Defined in the sis-javafx
module
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final Menu
Menu offering choices among the values that thisValuesUnderCursor
can show. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract String
evaluate
(DirectPosition point) Returns a string representation of data under given "real world" position.abstract boolean
isEmpty()
Returnstrue
if thisValuesUnderCursor
has currently no data to show.
-
Field Details
-
valueChoices
protected final Menu valueChoicesMenu offering choices among the values that thisValuesUnderCursor
can show. This menu will be available as a contextual menu in theStatusBar
. It is subclass responsibility to listen to menu selections and adapt theirevaluate(DirectPosition)
output accordingly.
-
-
Constructor Details
-
ValuesUnderCursor
protected ValuesUnderCursor()Creates a new evaluator instance. ThevalueChoices
list of items is initially empty; subclass constructor should set a text and add items.
-
-
Method Details
-
isEmpty
public abstract boolean isEmpty()Returnstrue
if thisValuesUnderCursor
has currently no data to show. AValuesUnderCursor
may be empty for example if user unselected all bands from the contextual menu.- Returns:
true
if there is no data to show yet.
-
evaluate
Returns a string representation of data under given "real world" position. The position CRS should be non-null for avoiding ambiguity about what is the default CRS. The position CRS may be anything; this method shall transform coordinates itself if needed.- Parameters:
point
- the cursor location in arbitrary CRS (usually the CRS shown in the status bar). May benull
for declaring that the point is outside canvas region.- Returns:
- string representation of data under given position, or
null
if none.
-