Package org.apache.sis.gui.map
Class ValuesUnderCursor.Formatter
Object
Formatter
- All Implemented Interfaces:
- Runnable
- Enclosing class:
- ValuesUnderCursor
Task for fetching and formatting values in a background thread.
 The background thread and the interaction with JavaFX thread are managed by the enclosing class.
 The same 
Formatter instance can be reused as long as the source of data does not change.
 As a rule of thumbs, all properties in ValuesUnderCursor class shall be read and written
 from the JavaFX thread, while all properties in this Formatter class may be read and written
 from any thread.
- Since:
- 1.3
Defined in the sis-javafx module
- 
Constructor SummaryConstructorsModifierConstructorDescriptionprotectedFormatter(ValuesUnderCursor owner) Creates a new formatter instance.
- 
Method SummaryModifier and TypeMethodDescriptionabstract Stringevaluate(DirectPosition point) Returns a string representation of data under the given "real world" position.voidrun()Invoked in a background thread for formatting values at the most recent position.
- 
Constructor Details- 
FormatterCreates a new formatter instance.- Parameters:
- owner- instance of the enclosing class which will evaluate values under cursor position.
 
 
- 
- 
Method Details- 
runpublic void run()Invoked in a background thread for formatting values at the most recent position. If the cursor moves while this method is formatting values, then this method will continue its execution for formatting also the values at new positions until the cursor stop moving.This method does not need to be invoked explicitly; it is invoked automatically by ValuesUnderCursor. But it may be overridden for adding pretreatment or post-treatment.
- 
evaluateReturns a string representation of data under the 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.This method is invoked by run()in a background thread. Implementations are responsible for fetching data in a thread-safe manner.- Parameters:
- point- the cursor location in arbitrary CRS (usually the CRS shown in the status bar). May be- nullfor declaring that the point is outside canvas region.
- Returns:
- string representation of data under given position, or nullif none.
 
 
-