Class TLcdEarthGXYRasterPainter

All Implemented Interfaces:
ILcdCloneable, ILcdPropertyChangeSource, ILcdStatusSource, ILcdGXYPainter, ILcdGXYPainterProvider, Serializable, Cloneable
Direct Known Subclasses:
TLcdEarthGXYSinglevaluedRasterPainter, TLcdHypsometricEarthPainter

public class TLcdEarthGXYRasterPainter extends ALcdEarthGXYPainter implements ILcdStatusSource
This ILcdGXYPainter can paint the raster data of ILcdEarthTileSet instances in a 2D view.

This painter has been replaced by TLcdGXYImagePainter. Please consider using it instead of this one.

Supported objects

This painter can visualize any ILcdEarthTileSet that can produce tiles with raster data. The tile data should however be supported by the createRasterTile(com.luciad.earth.tileset.ALcdEarthTile) implementation. The default implementation only supports RenderedImages as tile data. The first coverage in the tile set that can produce tiles with a RenderedImage will be used (see chooseTileSetCoverage(com.luciad.earth.tileset.ILcdEarthTileSet)).

Visualization

By default the tile level is chosen such that each pixel in the view maps to at least one raster value, if possible. This avoids pixelation effects (e.g. that individual pixels are visible). To achieve this a tile level is chosen with a higher pixel density than the view. This behavior can be changed by either setting the quality or by overriding the chooseTileSetLevel(java.awt.Graphics, int, com.luciad.view.gxy.ILcdGXYContext, com.luciad.shape.ILcdBounds) method.

If some tiles are not available, the tiles at lower levels will be used automatically to avoid gaps.

If required this painter will warp the raster data between different coordinate systems, otherwise it will just paint their linearly scaled images.

The bounds of the tile set will be painted instead of the tiles if the pixel density of the least detailed level is too high. There is no limit on the pixel density by default so the bounds of a tile set will never be painted unless the start resolution factor is set to a lower value. Typically this is fine for tile sets that cover the entire world but it may be necessary to lower the start resolution factor if there are multiple smaller tile sets in a view.

Incremental visualization

If the tile set supports asynchronous tile production, the visualization can be done incrementally. This means that the tiles will be requested asynchronously and the view will be repainted as the tiles become available. To enable this the ALcdEarthGXYPainter.isAsynchronousTileRequestAllowed() and ALcdEarthGXYPainter.isRepaintViewWhenTileAvailable() should be set to true (default).

Caching

By default only the tiles necessary for the view will be cached using hard references (see setCacheSize(int)). Other tiles will also be cached if there is enough memory (see isSoftCachingEnabled()). Tiles that reside in either of these caches will be updated automatically every minute (see getUpdateInterval()). You can use the updateTiles(com.luciad.view.gxy.ILcdGXYView) method to update all tiles that are currently cached immediately.

Performance considerations

  • To achieve optimal performance the reference of the tile set and the world reference should match. If this is not the case the raster data will need to be warped on-the-fly.
  • When incremental visualization is enabled other layers may also be repainted more frequently. This could result in reduced performance if this takes too much time.
  • When incremental visualization is enabled in combination with asynchronous painting it may sometimes take a significant amount of time before a paint is completed. More specifically this situation occurs if the painting is interrupted before it can finish due to a repaint for tile that has just become available. To avoid this you can disable the interruption of paints (see TLcdGXYAsynchronousPaintQueue.setInterruptPainting(boolean))
Since:
8.2
See Also:
  • Constructor Details

    • TLcdEarthGXYRasterPainter

      public TLcdEarthGXYRasterPainter(int aCacheSize)
      Creates a new earth 2D raster painter with the given cache size. The cache size will be increased automatically if it is too small to contain all visible tiles.
      Parameters:
      aCacheSize - the maximum number of entries in the cache
      See Also:
    • TLcdEarthGXYRasterPainter

      public TLcdEarthGXYRasterPainter()
      Creates a new earth 2D raster painter with the default cache size. The cache size will be increased automatically if it is too small to contain all visible tiles.
  • Method Details

    • getColorModel

      public ColorModel getColorModel()
      Returns:
      the color model
      See Also:
    • setColorModel

      public void setColorModel(ColorModel aColorModel)
      Sets the ColorModel that determines how a tile pixel is transformed into color components for a screen pixel. If it is not set, the raster tiles created by createRasterTile(com.luciad.earth.tileset.ALcdEarthTile) determine the ColorModel.
      Parameters:
      aColorModel - the color model
    • getRGBImageFilter

      public RGBImageFilter getRGBImageFilter()
      Returns:
      the image filter
      See Also:
    • setRGBImageFilter

      public void setRGBImageFilter(RGBImageFilter aRGBImageFilter)
      Sets the optional filter that is applied to painted tiles. The filter should be spatially invariant. Any brightness and transparency settings are applied on top of it.
      Parameters:
      aRGBImageFilter - the new image filter or null
    • getTransparency

      public float getTransparency()
      Returns:
      the transparency
      See Also:
    • setTransparency

      public void setTransparency(float aTransparency)
      Sets the transparency factor that is applied to painted tiles. It is an alpha value between 0 and 1, with 0 being perfectly transparent, and 1 (the default) being perfectly opaque.
      Parameters:
      aTransparency - the transparency
    • getBrightness

      public float getBrightness()
      Returns:
      the brightness
      See Also:
    • setBrightness

      public void setBrightness(float aBrightness)
      Sets the brightness that is applied to painted tiles. It is a value in [0, 2]. A value of 1 (the default) leaves the brightness unchanged. Values larger than 1 makes the colors brighter, while a value smaller than 1 makes the colors less bright.
      Parameters:
      aBrightness - the brightness
    • getContrast

      public float getContrast()
      Returns:
      the contrast
      See Also:
    • setContrast

      public void setContrast(float aContrast)
      Sets the contrast that is applied to painted tiles. It is a value in [0, 2]. A value of 1 (the default) leaves the contrast unchanged. A value larger than 1 enhances the contrast of dark colors by making them brighter, while a value smaller than 1 enhances the contrast of bright colors by making them darker.
      Parameters:
      aContrast - the contrast
    • setWarpBlockSize

      public void setWarpBlockSize(int aWarpBlockSize)
      Sets the width and height of the block in which the raster transformation is approximated using bilinear interpolation. This transformation is only applied if the reference of the tile set and view do not match. Smaller values result in more accurate results, but also larger computation times. The default is 64. With a value of 1, every pixel is transformed without approximation.
      Parameters:
      aWarpBlockSize - the width and height, expressed in pixels.
    • getWarpBlockSize

      public int getWarpBlockSize()
      Returns the width and height of the block in which the raster transformation is approximated using bilinear interpolation.
      Returns:
      the warp block size
      See Also:
    • setOversamplingRate

      public void setOversamplingRate(int aOverSamplingRate)
      Sets the number of samples used per pixel when transforming a raster. The default is 1. The total number of samples used per pixel equals (aOverSamplingRate * aOverSamplingRate). For instance, if the oversampling rate is set to 2, the painter will take 4 samples per pixel and average their values. This increases the image quality, especially if the raster contains sharp edges, but it also increases the computational cost.

      This property is only relevant for rasters that have to be warped, that is, when the model reference of the raster is different from the world reference of the view.

      Parameters:
      aOverSamplingRate - the number of samples used per pixel in one direction.
    • getOversamplingRate

      public int getOversamplingRate()
      Returns the sampling rate used when transforming the raster. The returned value equals the number of samples used per pixel in one direction.
      Returns:
      the oversampling rate
      See Also:
    • getCacheSize

      public int getCacheSize()
      Returns the size of the fixed cache which uses hard references (in #tiles).

      This painter will never paint more tiles for a view than fit in this cache. So if it is too small coarse data may be painted instead of the data at the optimal level of detail. To avoid this you can set the setAutoIncreaseCacheSize(boolean) property.

      Next to this cache there is also an optional cache that uses soft references (see isSoftCachingEnabled()).

      Overrides:
      getCacheSize in class ALcdEarthGXYPainter
      Returns:
      the cache size
    • setCacheSize

      public void setCacheSize(int aCacheSize)
      Sets the size of the fixed cache which uses hard references (in #tiles).
      Overrides:
      setCacheSize in class ALcdEarthGXYPainter
      Parameters:
      aCacheSize - the new cache size
      See Also:
    • clearCache

      public void clearCache()
      Clears both the fixed cached cache and the soft cache if it is enabled.
      Overrides:
      clearCache in class ALcdEarthGXYPainter
      See Also:
    • clearCache

      public void clearCache(Object aObject)
      Clears both the fixed cached cache and the soft cache, if it is enabled, for an object.
      Parameters:
      aObject - the object whose cache should be cleared
      See Also:
    • releaseHardReferencedCache

      public void releaseHardReferencedCache()
      Releases the hard references to all tiles of all objects painted by this painter.
      See Also:
    • releaseHardReferencedCache

      public void releaseHardReferencedCache(Object aObject)
      Releases the hard references to all tiles for a particular object

      Normally the painter keeps a hard reference to the set of tiles needed in the last paint. This ensures that this data is immediately available in subsequent paints. Doing this is essential when using incremental visualization, otherwise data might disappear. However this cache is not cleaned up automatically when the data is not painted anymore (ex. the layer is set to invisible). In this case you can use this method to allow garbage collection of this data when the memory is needed for other purposes. So calling this indicates the data may be garbage collected but usually this will only happen if there is memory pressure.

      Typically this method should only be invoked when the object no longer needs to be painted. For example when the layer is set to invisible.

      Parameters:
      aObject - the object whose tiles should not be hard-referenced anymore
    • setAsynchronousTileRequestAllowed

      public void setAsynchronousTileRequestAllowed(boolean aAsynchronousTileRequestAllowed)
      Description copied from class: ALcdEarthGXYPainter
      Sets whether the tiles can be requested asynchronously.
      Overrides:
      setAsynchronousTileRequestAllowed in class ALcdEarthGXYPainter
      Parameters:
      aAsynchronousTileRequestAllowed - True if the tiles can be requested asynchronously
      See Also:
    • setRepaintViewWhenTileAvailable

      public void setRepaintViewWhenTileAvailable(boolean aRepaintViewWhenTileAvailable)
      Description copied from class: ALcdEarthGXYPainter
      Sets whether the view is repainted when a tile becomes available.
      Overrides:
      setRepaintViewWhenTileAvailable in class ALcdEarthGXYPainter
      Parameters:
      aRepaintViewWhenTileAvailable - whether the view should repainted when a tile becomes available
    • updateTiles

      public void updateTiles(ILcdGXYView aGXYView)
      Updates all tiles that are cached in both the fixed cache and the soft cache.
      Parameters:
      aGXYView - the view that this painter is painting in
      See Also:
    • updateTiles

      public void updateTiles(Object aObject, ILcdGXYView aGXYView)
      Updates all tiles that are cached in both the fixed cache and the soft cache for an object.
      Parameters:
      aObject - the object whose tiles should be updated
      aGXYView - the view that this painter is painting in
      See Also:
    • isAutoIncreaseCacheSize

      public boolean isAutoIncreaseCacheSize()
      Returns whether the size of the fixed cache will be increased automatically if it is too small to contain all visible tiles at the optimal level of detail.
      Returns:
      true if the size of the fixed cache will be increased automatically if it is too small to contain
      See Also:
    • setAutoIncreaseCacheSize

      public void setAutoIncreaseCacheSize(boolean aAutoIncreaseCacheSize)
      Sets whether the size of the fixed cache should be increased automatically if it is too small to contain all visible tiles at the optimal level of detail.
      Parameters:
      aAutoIncreaseCacheSize - whether if the size of the fixed cache should be increased automatically if it is too small to contain
      See Also:
    • isSoftCachingEnabled

      public boolean isSoftCachingEnabled()
      Returns whether the soft cache is enabled or not.

      If the soft cache is enabled all tiles that have been retrieved will be cached, even those outside the view, as long as there is enough memory available.

      The soft cache is disabled by default.

      Returns:
      true if the soft cache is enabled
      See Also:
    • setSoftCachingEnabled

      public void setSoftCachingEnabled(boolean aSoftCachingEnabled)
      Enables or disables the soft cache.
      Parameters:
      aSoftCachingEnabled - whether the soft cache should be enabled
      See Also:
    • setPaintCache

      public void setPaintCache(boolean aCache)
      Specifies whether this painter should cache the warped raster images it has painted. Caching it may improve performance if it can be reused but increases memory usage. The default is false.

      This property is only relevant for rasters that have to be warped, that is, when the model reference of the raster is different from the world reference of the view.

    • getPaintCache

      public boolean getPaintCache()
      Returns whether this painter caches the warped raster images it has painted.
      See Also:
    • setUpdateInterval

      public void setUpdateInterval(long aTime)
      Sets the time between two updates for a tile.
      Parameters:
      aTime - the time in milliseconds
      See Also:
    • getUpdateInterval

      public long getUpdateInterval()
      Returns the time between two updates for a tile.

      The tiles in the internal cache and the soft cache will be updated by invoking ILcdEarthTileSet.updateTile(com.luciad.earth.tileset.ALcdEarthTile, com.luciad.earth.tileset.TLcdEarthTileOperationMode, com.luciad.earth.tileset.ILcdEarthTileSetCallback, java.lang.Object) if they are older than this time. The tiles will never be updated automatically if Long.MAX_VALUE is set as the time. The tiles will be updated continuously if 0 is set as the time.

      The default time is 1 minute.

      Returns:
      the time in milliseconds
    • isAllowOutdatedTiles

      public boolean isAllowOutdatedTiles()
      Returns whether outdated tiles may be returned if an exception occurs while retrieving a tile.

      If enabled, any cached version of the requested tile may be returned if an exception occurs. Otherwise the tile will not be painted.

      The default value is true.

      Returns:
      true if outdated tiles may be returned if an exception occurs while retrieving a tile
    • setAllowOutdatedTiles

      public void setAllowOutdatedTiles(boolean aAllowOutdatedTiles)
      Sets whether outdated tiles may be returned if an exception occurs while retrieving a tile.
      Parameters:
      aAllowOutdatedTiles - true if outdated tiles may be returned if an exception occurs while retrieving a tile
      See Also:
    • getQuality

      public double getQuality()
      Returns the current painting quality.
      Returns:
      the current painting quality
      See Also:
    • setQuality

      public void setQuality(double aQuality)
      Sets the quality of the painted result. The quality influences how quickly the level of detail changes when zooming in or out. The value should be between 0 and 1. A value of 1 means that the tile level is chosen such that each pixel in the view maps to at least one raster value, if possible. This avoids pixelation effects (e.g. that individual pixels are visible). A value of 0.25 means that 4 pixels in the view will map to one raster value on average. A value of 0 means that you only the least detailed level will be painted.

      The default value is 1.0.

      Parameters:
      aQuality - the new quality
    • setExceptionHandler

      public void setExceptionHandler(ILcdExceptionHandler aExceptionHandler)
      Description copied from class: ALcdEarthGXYPainter
      Sets the exception handler that is used to handle exceptions that occur during tile retrieval.
      Overrides:
      setExceptionHandler in class ALcdEarthGXYPainter
      Parameters:
      aExceptionHandler - the exception handler
    • setStartResolutionFactor

      public void setStartResolutionFactor(double aStartResolutionFactor)
      Sets the highest pixel density (number of raster pixels per screen pixel) at which a tile set is painted. If the pixel density is too high, the bounds may be painted instead. This can avoid having to load a large number of tiles to fill a relatively small view.

      The default value is Double.POSITIVE_INFINITY which result in always painting the tiles.

      Parameters:
      aStartResolutionFactor - the start resolution factor
      See Also:
    • getStartResolutionFactor

      public double getStartResolutionFactor()
      Returns the highest pixel density (number of raster pixels per screen pixel) at which a tile set is painted.
      Returns:
      the start resolution factor
      See Also:
    • isParentTileRequestAllowed

      public boolean isParentTileRequestAllowed()
      Returns whether a request for parent tiles may be made when tiles are requested.
      Returns:
      whether the parent tiles of the visible tiles may be requested
      Since:
      2018.0
      See Also:
    • setParentTileRequestAllowed

      public void setParentTileRequestAllowed(boolean aParentTileRequestAllowed)
      Sets whether parent tiles of the visible tiles may be requested. This is true by default, because it benefits user experience (e.g. data is immediately available when zooming out). Disabling this might be required to support stringent operation conditions that require the minimum possible amount of tile requests; in this case, only the visible tiles will be requested.
      Parameters:
      aParentTileRequestAllowed - whether the parent tiles of the visible tiles may be requested
      Since:
      2018.0
    • setPaintBoundsOutline

      public void setPaintBoundsOutline(boolean aPaint)
      Sets whether the outline of the bounds of a tile set is painted when the pixel density is too high.

      Note that if this flag is set to true then the bounds line style must be valid.

      The default value is true.

      Parameters:
      aPaint - true if the outline of the bounds of a tile set should be painted.
      See Also:
    • setPaintBoundsFill

      public void setPaintBoundsFill(boolean aPaint)
      Sets whether the fill of the bounds of a tile set is painted when the pixel density is too high.

      Note that if this flag is set to true then the bounds fill style must be valid.

      The default value is true.

      Parameters:
      aPaint - true if the fill of the bounds of a tile set should be painted.
      See Also:
    • isPaintBoundsOutline

      public boolean isPaintBoundsOutline()
      Returns whether the outline of the bounds of a tile set is painted.
      Returns:
      whether the outline of the bounds of a tile set is painted.
      See Also:
    • isPaintBoundsFill

      public boolean isPaintBoundsFill()
      Returns whether the fill of the bounds of a tile set is painted.
      Returns:
      whether the fill of the bounds of a tile set is painted.
      See Also:
    • setBoundsLineStyle

      public void setBoundsLineStyle(ILcdGXYPainterStyle aLineStyle)
      Sets the style that is used when painting the outline of the bounds of tile set. If the outline style is set to null and paint bounds outline is enabled the result visual result on screen is undefined.

      The default value is a red line style.

      Parameters:
      aLineStyle - the line style to use
      See Also:
    • setBoundsFillStyle

      public void setBoundsFillStyle(ILcdGXYPainterStyle aFillStyle)
      Sets the style that is used when painting the fill of the bounds of tile set. If the fill style is set to null and paint bounds fill is enabled the result visual result on screen is undefined.

      The default value is a red hatched fill style.

      Parameters:
      aFillStyle - the fill style to use
      See Also:
    • getBoundsLineStyle

      public ILcdGXYPainterStyle getBoundsLineStyle()
      Returns the style that is used when painting the outline of the bounds of tile set.
      Returns:
      the line style
      See Also:
    • getBoundsFillStyle

      public ILcdGXYPainterStyle getBoundsFillStyle()
      Returns the style that is used when painting the fill of the bounds of tile set.
      Returns:
      the fill style
      See Also:
    • getTileContext

      public TLcdEarthTileContext getTileContext(Object aObject)
      Returns the tile context for the most recent paint of an object.

      This method may return null if the specified object has never been painted, if its cache as been cleared.

      The set of painted tiles may or may not contain some painted tiles if they are no longer available (for example due to garbage collection).

      The returned map will never change and is thread-safe for reading.

      Parameters:
      aObject - the object
      Returns:
      the context or null
    • setObject

      public void setObject(Object aObject)
      Sets the tile set to the specified object, chooses a coverage in it and chooses a tile format.
      Specified by:
      setObject in interface ILcdGXYPainter
      Overrides:
      setObject in class ALcdEarthGXYPainter
      Parameters:
      aObject - the object for which the representation shall be handled by this painter.
      See Also:
    • getTileSet

      protected ILcdEarthTileSet getTileSet(Object aObject)
      The first time the tile set for an object is retrieved this base tile set is configured and then wrapped with an asynchronous tile set to ensure smooth painting.
      Overrides:
      getTileSet in class ALcdEarthGXYPainter
      Parameters:
      aObject - the object being painted
      Returns:
      the tile set
    • configureBaseTileSet

      protected ILcdEarthTileSet configureBaseTileSet(Object aObject, ILcdEarthTileSet aTileSet)
      Configures the base tile set.

      The default implementation just returns the base tile set.

      This method can be overridden to add custom tile set wrappers to the tile set.

      Parameters:
      aObject - the object being painted
      aTileSet - the base tile set
      Returns:
      the configured tile set
      See Also:
    • createAsynchronousTileSet

      protected ILcdEarthTileSet createAsynchronousTileSet(Object aObject, ILcdEarthTileSet aTileSet)
      Creates a tile set that can produce tiles asynchronously.

      The default implementation creates a new asynchronous tile set that uses 1 thread for tile production unless the tile set already is an asynchronous tile set.

      Parameters:
      aObject - the object being painted
      aTileSet - the tile set
      Returns:
      the asynchronous tile set
      See Also:
    • getRequestFormat

      protected TLcdEarthTileFormat getRequestFormat()
      Returns the tile format used to request tiles.
      Returns:
      the tile format used to request tiles.
    • chooseTileSetCoverage

      protected ILcdEarthTileSetCoverage chooseTileSetCoverage(ILcdEarthTileSet aTileSet)
      Chooses a coverage from the given tile set to be drawn by this painter.

      The default implementation returns the first coverage that is valid.

      Specified by:
      chooseTileSetCoverage in class ALcdEarthGXYPainter
      Parameters:
      aTileSet - the tile set whose tiles are being painted
      Returns:
      the coverage from which tiles should be obtained
      See Also:
    • isValidCoverage

      protected boolean isValidCoverage(ILcdEarthTileSetCoverage aCoverage)
      Returns whether the given coverage can be drawn by this painter. The returned coverage should support a format that can be handled by createRasterTile(com.luciad.earth.tileset.ALcdEarthTile).

      The default implementation returns true if the coverage is a raster coverage and the tiles set supports a format with RenderedImage as format class and no format name with the specified coverage.

      Parameters:
      aCoverage - the candidate coverage
      Returns:
      true if the given coverage can be painted
      See Also:
    • chooseTileFormat

      protected TLcdEarthTileFormat chooseTileFormat(ILcdEarthTileSet aTileSet, ILcdEarthTileSetCoverage aCoverage)
      Chooses a tile format from the given tile set and coverage to be used for producing tiles. The format should be supported by createRasterTile(com.luciad.earth.tileset.ALcdEarthTile).

      The default implementation returns a format with RenderedImage as format class and no format name.

      Parameters:
      aTileSet - the tile set whose tiles are being painted
      aCoverage - the coverage whose tiles are being painted.
      Returns:
      the format in which tiles should be obtained
    • paint

      public void paint(Graphics aGraphics, int aMode, ILcdGXYContext aContext)
      Description copied from interface: ILcdGXYPainter
      Displays the representation of the object in the given mode on the Graphics passed, taking into account the supplied context.

      The visual representation of an object depends on the context. Depending on the context (e.g. is the location covered by the view), an object may or may not have a representation. The context contains:

      • transformations which allow to compute the location in view space of points and bounds given in model, space
      • a pen which can connect points with a line or create arcs around a point,
      • the view for which the object's representation must be painted. This can be useful when the painted object depends on the scale of the view, or the presence of other layers in the view.
      • the current location(s) of the mouse or input device and the last location(s) the mouse or input device was pressed.

      The mode passed in this method indicates what part of the object must be painted, whether it should be painted as selected or not, and whether user interaction (via mouse movements) must be taken into account.

      When the mode passed contains either TRANSLATING, RESHAPING or CREATING, this method is also responsible for interpreting interaction on the representation of an object and modifying the representation of the object accordingly. The painter is not responsible for modifying the object itself, this is done by a corresponding ILcdGXYEditor . Implementations of ILcdGXYPainter and ILcdGXYEditor interfaces must be consistent for an object: the painter must display the result of the user interaction on the object, while the editor is responsible for modifying the object as a result of the user interaction. A good practice to ensure a consistent implementation is to implement both the ILcdGXYPainter and ILcdGXYEditor interfaces in a single class.

      When the mode passed includes SNAPS, the part of the representation which corresponds to the object returned as snap target by the method snapTarget must be painted in order to provide the user with a visual indication of the snap target.

      The Graphics passed in this method can be different from the Graphics returned by a view due to techniques such as double buffering (as applied in Swing). Basic drawing operations must always be performed on the Graphics passed as an argument in this method.

      Specified by:
      paint in interface ILcdGXYPainter
      Parameters:
      aGraphics - the Graphics on which the representation of the object is painted
      aMode - the mode the object is represented in (see class documentation).
      aContext - the ILcdGXYContext the drawing depends on.
    • chooseTileSetLevel

      protected int chooseTileSetLevel(Graphics aGraphics, int aMode, ILcdGXYContext aContext, ILcdBounds aViewModelBounds)
      Called by paint(java.awt.Graphics, int, com.luciad.view.gxy.ILcdGXYContext) to choose the level in the tile set that should be painted. Note that tiles at lower levels may still be painted (ex. if some tiles at the desired level are not available).

      The default implementation chooses a level such that each pixel in the view maps to at least one raster value, if possible. If the pixel density of the least detailed level is too high then -1 is returned.

      Parameters:
      aGraphics - the graphics
      aMode - the mode
      aContext - the context
      aViewModelBounds - the bounds of the view in model coordinates
      Returns:
      the level that should be painted or -1 if the bounds should be painted instead
    • getEmptyTile

      protected ILcdTile getEmptyTile()
      Returns a representative empty tile for this painter. For example, the tile's default value may be used when painting missing data.
      Returns:
      an empty tile.
      Since:
      2022.0
    • createRasterTile

      protected ILcdTile createRasterTile(ALcdEarthTile aTile)
      Creates an ILcdTile corresponding to the specified ALcdEarthTile. The resulting raster tile is used in order to draw the output of a tile set using TLcdRasterPainter.

      The default implementation can only create a tile for tiles with a RenderedImage as tile data.

      Parameters:
      aTile - the tile to convert into a raster tile
      Returns:
      a raster tile
    • getPixelDensity

      protected double getPixelDensity(int aLevel)
      Returns the pixel density of the data (in the tile set reference) at the given level.

      The default implementation assumes that the coverage is a ILcdEarthRasterTileSetCoverage and returns its pixel density at the specified level.

      Parameters:
      aLevel - a level
      Returns:
      the pixel density
      See Also:
    • getDisplayName

      public String getDisplayName()
      Description copied from class: ALcdGXYPainter
      Returns the display name of this ILcdGXYPainter.
      Specified by:
      getDisplayName in interface ILcdGXYPainter
      Overrides:
      getDisplayName in class ALcdGXYPainter
      Returns:
      the name that has been set using setDisplayName(), or this.toString() if no name has been set.
    • clone

      public Object clone()
      Description copied from interface: ILcdCloneable

      Makes Object.clone() public.

      When for example extending from java.lang.Object, it can be implemented like this:
      
       public Object clone() {
         try {
           return super.clone();
         } catch ( CloneNotSupportedException e ) {
           // Cannot happen: extends from Object and implements Cloneable (see also Object.clone)
           throw new RuntimeException( e );
         }
       }
       
      Specified by:
      clone in interface ILcdCloneable
      Specified by:
      clone in interface ILcdGXYPainterProvider
      Overrides:
      clone in class ALcdEarthGXYPainter
      Returns:
      a clone of this painter provider.
      See Also:
    • addStatusListener

      public void addStatusListener(ILcdStatusListener aStatusListener)
      Description copied from interface: ILcdStatusSource

      Registers the given listener so it will receive status events from this source.

      In case you need to register a listener which keeps a reference to an object with a shorter life-time than this status source, you can use a ALcdWeakStatusListener instance as status listener.

      Specified by:
      addStatusListener in interface ILcdStatusSource
      Parameters:
      aStatusListener - The listener to be notified when the status has changed.
    • removeStatusListener

      public void removeStatusListener(ILcdStatusListener aStatusListener)
      Description copied from interface: ILcdStatusSource
      Removes the specified listener so it is no longer notified.
      Specified by:
      removeStatusListener in interface ILcdStatusSource
      Parameters:
      aStatusListener - The listener to remove.