Package org.apache.sis.gui.coverage
Class CoverageCanvas
Object
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:
Defined in the sis-javafx module
- 
Property Summary
- 
Nested Class SummaryNested classes/interfaces inherited from class MapCanvasAWTMapCanvasAWT.Renderer
- 
Field SummaryFieldsModifier and TypeFieldDescriptionfinal ObjectProperty<GridCoverage>The data shown in this canvas.final ObjectProperty<Interpolation>The interpolation method to use for resampling the image.final ObjectProperty<GridCoverageResource>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 MapCanvasAWTimage, imageMarginFields inherited from class MapCanvasfixedPane, floatingPaneFields inherited from class PlanarCanvasBIDIMENSIONAL, objectiveToDisplayFields inherited from class CanvasDISPLAY_BOUNDS_PROPERTY, OBJECTIVE_CRS_PROPERTY, OBJECTIVE_TO_DISPLAY_PROPERTY, POINT_OF_INTEREST_PROPERTY
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionfinal voidaddPropertyChangeListener(String propertyName, PropertyChangeListener listener) Registers a listener for the property of the given name.protected voidclear()Removes the image shown and releases memory.protected MapCanvasAWT.RendererInvoked in JavaFX thread for creating a renderer to be executed in a background thread.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.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.final GridExtentReturns a subspace of the grid coverage extent where all dimensions except two have a size of 1 cell.protected final booleanhasPropertyChangeListener(String propertyName) Returnstrueif the given property has at least one listener.final voidremovePropertyChangeListener(String propertyName, PropertyChangeListener listener) Unregisters a property listener.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 MapCanvasclearError, errorOccurred, errorProperty, getObjectiveBounds, initialize, renderingProperty, requestRepaint, reset, runAfterRendering, setObjectiveBounds, setObjectiveToDisplay, transformDisplayCoordinates, transformObjectiveCoordinatesMethods inherited from class PlanarCanvasgetDisplayBoundsMethods inherited from class CanvasgetDisplayCRS, getGeographicArea, getGridGeometry, getLocale, getObjectiveCRS, getObjectiveToDisplay, getPointOfInterest, getSpatialResolution, setDisplayBounds, setPointOfInterest
- 
Field Details- 
resourcePropertyThe 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:
 
- 
coveragePropertyThe 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.
- If the 
- 
sliceExtentPropertyA subspace of the grid coverage extent where all dimensions except two have a size of 1 cell. May benullif the grid coverage has only two dimensions with a size greater than 1 cell.
- 
interpolationPropertyThe interpolation method to use for resampling the image.
 
- 
- 
Constructor Details- 
CoverageCanvaspublic CoverageCanvas()Creates a new two-dimensional canvas forRenderedImage.
 
- 
- 
Method Details- 
getResourceReturns the source of coverages for this viewer. 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:
 
- 
setResourceSets 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, or- nullif none.
- Since:
- 1.2
- See Also:
 
- 
getCoverageReturns 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:
 
- 
setCoverageSets 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, or- nullif none.
- See Also:
 
- 
getSliceExtentReturns 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:
 
- 
setSliceExtentSets 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:
 
- 
getInterpolationGets the interpolation method used during resample operations.- Returns:
- the current interpolation method.
- See Also:
 
- 
setInterpolationSets the interpolation method to use during resample operations.- Parameters:
- interpolation- the new interpolation method.
- See Also:
 
- 
createRendererInvoked 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 class- MapCanvasAWT
- Returns:
- rendering process to be executed in background thread,
         or nullif there is nothing to paint.
 
- 
clearprotected void clear()Removes the image shown and releases memory.UsageOverriding methods in subclasses should invokesuper.clear(). Other methods should generally not invoke this method directly, and use the following code instead:runAfterRendering(this::clear); - Overrides:
- clearin class- MapCanvasAWT
- See Also:
 
- 
toStringReturns a string representation for debugging purposes. The string content may change in any future version.- Overrides:
- toStringin class- MapCanvas
- Returns:
- debug string (may change in any future version).
 
- 
addPropertyChangeListenerRegisters a listener for the property of the given name. The listener will be notified every time that the property of the given name got a new value. If the same listener is registered twice for the same property, then it will be notified twice (this method does not perform duplication checks).- Parameters:
- propertyName- name of the property to listen (should be one of the- *_PROPERTYconstants).
- listener- property listener to register.
 
- 
removePropertyChangeListenerpublic final void removePropertyChangeListener(String propertyName, PropertyChangeListener listener) Unregisters a property listener. The givenpropertyNameshould be the name used during listener registration. If the specified listener is not registered for the named property, then nothing happen. If the listener has been registered twice, then only one registration is removed (one registration will remain).- Parameters:
- propertyName- name of the listened property.
- listener- property listener to unregister.
 
- 
hasPropertyChangeListenerReturnstrueif the given property has at least one listener.- Parameters:
- propertyName- name of the property to test.
- Returns:
- trueif the given property has at least one listener.
- Since:
- 1.3
 
- 
firePropertyChangeNotifies all registered listeners that a property of the given name changed its value. The change event source will bethis. It is caller responsibility to verify that the old and new values are different (this method does not check for equality).- Parameters:
- propertyName- name of the property that changed its value.
- oldValue- the old property value (may be- null).
- newValue- the new property value (may be- null).
- See Also:
 
- 
firePropertyChangeNotifies all registered listeners that a property changed its value. It is caller responsibility to verify that the event source and property name are valid.- Parameters:
- event- the event to forward. Cannot be null.
- See Also:
 
 
-