Class CoverageCanvas
Object
Observable
Canvas
PlanarCanvas
MapCanvas
MapCanvasAWT
CoverageCanvas
- All Implemented Interfaces:
Localized
A canvas for
RenderedImage provided by a GridCoverage or a GridCoverageResource.
In the latter case where the source of data is specified by resourceProperty, the grid coverage
instance (given by coverageProperty) will change automatically according the zoom level.- Since:
- 1.1
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class MapCanvasAWT
MapCanvasAWT.RendererModifier and TypeClassDescriptionprotected static classA snapshot ofMapCanvasAWTstate to paint as an image.Nested classes/interfaces inherited from class MapCanvas
MapCanvas.StaticGraphicsModifier and TypeClassDescriptionstatic classJavaFX nodes rendered using a snapshot of the objective to display transform. -
Property Summary
Properties inherited from class MapCanvas
error, positionalAccuracy, renderingTypePropertyDescriptionReturns a property giving the exception or error that occurred during last rendering operation.final ReadOnlyObjectProperty<Length> Returns a property which gives an estimation of positional accuracy, typically in metres.Returns a property telling whether a rendering is in progress. -
Field Summary
FieldsModifier and TypeFieldDescriptionfinal ObjectProperty<GridCoverage> The data shown in this canvas.final ObjectProperty<Interpolation> The interpolation method to use for resampling the image.The source of coverage data shown in this canvas.final ObjectProperty<GridExtent> A subspace of the grid coverage extent where all dimensions except two have a size of 1 cell.Fields inherited from class MapCanvasAWT
image, imageMarginModifier and TypeFieldDescriptionprotected final ImageViewThe node where the rendered map will be shown.final ObjectProperty<Insets> Number of additional pixels to paint on each sides of the image, outside the viewing area.Fields inherited from class MapCanvas
fixedPane, floatingPaneModifier and TypeFieldDescriptionprotected final StackPaneThe pane showing the map and other JavaFX nodes to keep at fixed position regardless pans, zooms or rotations applied on the map.protected final PaneThe pane showing the map and any other JavaFX nodes to scale and translate together with the map.Fields inherited from class PlanarCanvas
BIDIMENSIONAL, objectiveToDisplayModifier and TypeFieldDescriptionprotected static final intThe 2 constant for identifying code specific to bi-dimensional case.protected final AffineTransformThe conversion from objective CRS to the display coordinate system as a Java2D affine transform.Fields inherited from class Canvas
DISPLAY_BOUNDS_PROPERTY, OBJECTIVE_CRS_PROPERTY, OBJECTIVE_TO_DISPLAY_PROPERTY, POINT_OF_INTEREST_PROPERTYModifier and TypeFieldDescriptionstatic final StringThe "displayBounds" property name, used for notifications about changes in bounds of display device.static final StringThe "objectiveCRS" property name, used for notifications about changes in objective CRS.static final StringThe "objectiveToDisplay" property name, used for notifications about changes in objective to display conversion.static final StringThe "pointOfInterest" property name, used for notifications about changes in point of interest. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected MapCanvasAWT.RendererInvoked in JavaFX thread for creating a renderer to be executed in a background thread.Return an identifier derived from the resource identifier.final GridCoverageReturns the source of image for this viewer.final InterpolationGets the interpolation method used during resample operations.final GridCoverageResourceReturns the source of coverages for this viewer, ornullif none.final GridExtentReturns a subspace of the grid coverage extent where all dimensions except two have a size of 1 cell.final voidsetCoverage(GridCoverage coverage) Sets the coverage to show in this viewer.final voidsetInterpolation(Interpolation interpolation) Sets the interpolation method to use during resample operations.final voidsetResource(GridCoverageResource resource) Sets the source of coverages shown in this viewer.final voidsetSliceExtent(GridExtent sliceExtent) Sets a subspace of the grid coverage extent where all dimensions except two have a size of 1 cell.Returns a string representation for debugging purposes.Methods inherited from class MapCanvas
clearError, errorOccurred, errorProperty, getObjectiveBounds, initialize, positionalAccuracyProperty, renderingProperty, requestRepaint, reset, runAfterRendering, setObjectiveBounds, setObjectiveToDisplay, setPositionalAccuracy, transformDisplayCoordinates, transformObjectiveCoordinates, usingFixedTransformModifier and TypeMethodDescriptionprotected final voidClears the error message in the status bar.protected voidSets the error property to the given value.Returns a property giving the exception or error that occurred during last rendering operation.Returns the data bounds to use for computing the initial "objective to display" transform.protected voidinitialize(GridGeometry visibleArea) Sets the objective bounds and/or the zoom level and objective CRS to use for the initial view of data.final ReadOnlyObjectProperty<Length> Returns a property which gives an estimation of positional accuracy, typically in metres.Returns a property telling whether a rendering is in progress.final voidRequests the map to be rendered again, possibly with new data.voidreset()Resets the map view to its default zoom level and default position with no rotation.protected booleanrunAfterRendering(Runnable task) Registers a task to execute after the background thread finished its current rendering task.voidsetObjectiveBounds(Envelope visibleArea) Sets the data bounds to use for computing the initial value ofPlanarCanvas.objectiveToDisplay.voidsetObjectiveToDisplay(LinearTransform newValue) Sets the conversion from objective CRS to display coordinate system.protected voidsetPositionalAccuracy(Quantity<Length> accuracy) Sets an estimation of the positional accuracy of the pixels or features that are rendered on the map.voidUpdates the objective to display transform with the given transform in pixel coordinates.voidUpdates the objective to display transform with the given transform in objective coordinates.Returns a pane where graphics can be added as if the objective to display transform was static.Methods inherited from class PlanarCanvas
getDisplayBoundsModifier and TypeMethodDescriptionReturns the size and location of the display device.Methods inherited from class Canvas
getDisplayCRS, getGeographicArea, getGridGeometry, getLocale, getObjectiveCRS, getObjectiveToDisplay, getPointOfInterest, getSpatialResolution, setDisplayBounds, setPointOfInterestModifier and TypeMethodDescriptionfinal EngineeringCRSReturns the Coordinate Reference System of the display device.Returns the geographic bounding box encompassing the area shown on the display device.Returns canvas properties (CRS, display bounds, conversion) encapsulated in a grid geometry.Returns the locale used for texts or for producing some error messages.Returns the Coordinate Reference System in which all data are transformed before displaying.Returns the (usually affine) conversion from objective CRS to display coordinate system.getPointOfInterest(boolean objective) Returns the coordinates of a point considered representative of the data.Returns an estimation of the resolution (in metres) at the point of interest.voidsetDisplayBounds(Envelope newValue) Sets the size and location of the display device.voidsetPointOfInterest(DirectPosition newValue) Sets the coordinates of a representative point inside the data bounding box.Methods inherited from class Observable
addPropertyChangeListener, firePropertyChange, firePropertyChange, hasPropertyChangeListener, removePropertyChangeListenerModifier and TypeMethodDescriptionfinal voidaddPropertyChangeListener(String propertyName, PropertyChangeListener listener) Registers a listener for the property of the given name.protected voidNotifies all registered listeners that a property changed its value.protected voidfirePropertyChange(String propertyName, Object oldValue, Object newValue) Notifies all registered listeners that a property of the given name changed its value.protected final booleanhasPropertyChangeListener(String propertyName) Returnstrueif the given property has at least one listener.final voidremovePropertyChangeListener(String propertyName, PropertyChangeListener listener) Unregisters a property listener.
-
Field Details
-
resourceProperty
The source of coverage data shown in this canvas. If this property value is non-null, thencoveragePropertyvalue will change at any time (potentially many times) depending on the zoom level or other user interaction. Conversely if a value is set explicitly oncoverageProperty, then thisresourcePropertyis cleared.- Since:
- 1.2
- See Also:
-
coverageProperty
The data shown in this canvas. This property value may be set implicitly or explicitly:- If the
resourcePropertyvalue is non-null, then the value will change automatically at any time (potentially many times) depending on user interaction. - Conversely if an explicit value is set on this property,
then the
resourcePropertyis cleared.
Current implementation is restricted to
GridCoverageinstances, but a future implementation may generalize toorg.opengis.coverage.Coverageinstances.- See Also:
- If the
-
sliceExtentProperty
A subspace of the grid coverage extent where all dimensions except two have a size of 1 cell. The property value may benullif the grid coverage has only two dimensions with a size greater than 1 cell, in which case it is unnecessary to specify a slice.- See Also:
-
interpolationProperty
The interpolation method to use for resampling the image.- See Also:
-
-
Constructor Details
-
CoverageCanvas
public CoverageCanvas()Creates a new two-dimensional canvas forRenderedImage.
-
-
Method Details
-
getContentIdentifier
Return an identifier derived from the resource identifier. This method returns an empty value if no worker has read the resource identifier yet. It may happen randomly depending on thread execution order.- Overrides:
getContentIdentifierin classMapCanvas- Returns:
- an identifier of the rendered coverage.
- Since:
- 1.7
-
getResource
Returns the source of coverages for this viewer, ornullif none. This method, like all other methods in this class, shall be invoked from the JavaFX thread.- Returns:
- the source of coverages shown in this viewer, or
nullif none. - Since:
- 1.2
- See Also:
-
setResource
Sets the source of coverages shown in this viewer. This method shall be invoked from JavaFX thread and returns immediately. The new data are loaded in a background thread and thecoveragePropertyvalue will be updated after an undetermined amount of time.- Parameters:
resource- the source of data to show in this viewer, ornullif none.- Since:
- 1.2
- See Also:
-
getCoverage
Returns the source of image for this viewer. This method, like all other methods in this class, shall be invoked from the JavaFX thread. Note that this value may change at any time (depending on user interaction) if theresourcePropertyhas a non-null value.- Returns:
- the coverage shown in this explorer, or
nullif none. - See Also:
-
setCoverage
Sets the coverage to show in this viewer. This method shall be invoked from JavaFX thread and returns immediately. The new data are loaded in a background thread and will appear after an undetermined amount of time.Invoking this method sets the
resourcePropertyvalue tonull.- Parameters:
coverage- the data to show in this viewer, ornullif none.- See Also:
-
getSliceExtent
Returns a subspace of the grid coverage extent where all dimensions except two have a size of 1 cell.- Returns:
- subspace of the grid coverage extent where all dimensions except two have a size of 1 cell.
- See Also:
-
setSliceExtent
Sets a subspace of the grid coverage extent where all dimensions except two have a size of 1 cell. Note that values set on this property may be overwritten at any time by user interactions if thisCoverageCanvasis associated with aGridSliceSelector.- Parameters:
sliceExtent- subspace of the grid coverage extent where all dimensions except two have a size of 1 cell.- See Also:
-
getInterpolation
Gets the interpolation method used during resample operations.- Returns:
- the current interpolation method.
- See Also:
-
setInterpolation
Sets the interpolation method to use during resample operations.- Parameters:
interpolation- the new interpolation method.- See Also:
-
createRenderer
Invoked in JavaFX thread for creating a renderer to be executed in a background thread. This method prepares the information needed but does not start the rendering itself. The rendering will be done later by a call toMapCanvasAWT.Renderer.paint(Graphics2D).- Specified by:
createRendererin classMapCanvasAWT- Returns:
- rendering process to be executed in background thread,
or
nullif there is nothing to paint.
-
toString
Returns a string representation for debugging purposes. The string content may change in any future version.- Overrides:
toStringin classMapCanvas- Returns:
- debug string (may change in any future version).
-