Class CoverageCanvas

All Implemented Interfaces:
Localized

@DefaultProperty("coverage") public class CoverageCanvas extends MapCanvasAWT
A canvas for Rendered­Image provided by a Grid­Coverage or a Grid­Coverage­Resource. In the latter case where the source of data is specified by resource­Property, the grid coverage instance (given by coverage­Property) will change automatically according the zoom level.
Since:
1.1
See Also:
  • Field Details

  • Constructor Details

    • CoverageCanvas

      public CoverageCanvas()
      Creates a new two-dimensional canvas for Rendered­Image.
  • Method Details

    • getResource

      public final GridCoverageResource getResource()
      Returns 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 null if none.
      Since:
      1.2
      See Also:
    • setResource

      public final void setResource(GridCoverageResource resource)
      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 the coverage­Property value will be updated after an undetermined amount of time.
      Parameters:
      resource - the source of data to show in this viewer, or null if none.
      Since:
      1.2
      See Also:
    • getCoverage

      public final GridCoverage 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 the resource­Property has a non-null value.
      Returns:
      the coverage shown in this explorer, or null if none.
      See Also:
    • setCoverage

      public final void setCoverage(GridCoverage coverage)
      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 resource­Property value to null.

      Parameters:
      coverage - the data to show in this viewer, or null if none.
      See Also:
    • getSliceExtent

      public final GridExtent 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

      public final void setSliceExtent(GridExtent sliceExtent)
      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 this Coverage­Canvas is associated with a Grid­Slice­Selector.
      Parameters:
      slice­Extent - subspace of the grid coverage extent where all dimensions except two have a size of 1 cell.
      See Also:
    • getInterpolation

      public final Interpolation getInterpolation()
      Gets the interpolation method used during resample operations.
      Returns:
      the current interpolation method.
      See Also:
    • setInterpolation

      public final void setInterpolation(Interpolation interpolation)
      Sets the interpolation method to use during resample operations.
      Parameters:
      interpolation - the new interpolation method.
      See Also:
    • createRenderer

      protected MapCanvasAWT.Renderer 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 to Map­Canvas­AWT​.Renderer​.paint(Graphics2D).
      Specified by:
      create­Renderer in class Map­Canvas­AWT
      Returns:
      rendering process to be executed in background thread, or null if there is nothing to paint.
    • clear

      protected void clear()
      Removes the image shown and releases memory.

      Usage

      Overriding methods in subclasses should invoke super​.clear(). Other methods should generally not invoke this method directly, and use the following code instead:
      runAfterRendering(this::clear);
      
      Overrides:
      clear in class Map­Canvas­AWT
      See Also:
    • toString

      public String toString()
      Returns a string representation for debugging purposes. The string content may change in any future version.
      Overrides:
      to­String in class Map­Canvas
      Returns:
      debug string (may change in any future version).