Class TLcdEarthGXYViewTileSet
- All Implemented Interfaces:
ILcdEarthTileSet,ILcdBounded,ILcdDisposable,ILcdLayered,Serializable,AutoCloseable
- add data through
GXY layers, but make sure they have no asynchronous behavior - for transparent data configure both the
background colorand thetile image type
produceTile(com.luciad.earth.tileset.ILcdEarthTileSetCoverage, int, long, long, com.luciad.reference.ILcdGeoReference, com.luciad.earth.tileset.TLcdEarthTileFormat, com.luciad.earth.tileset.TLcdEarthTileOperationMode, com.luciad.earth.tileset.ILcdEarthTileSetCallback, java.lang.Object) and ALcdEarthTileSet.updateTile(com.luciad.earth.tileset.ALcdEarthTile, com.luciad.earth.tileset.TLcdEarthTileOperationMode, com.luciad.earth.tileset.ILcdEarthTileSetCallback, java.lang.Object) methods generate a TLcdEarthGXYViewTileSet.PaintException when
an error occurs while painting a layer for a tile. It its thrown directly be thrown by the
synchronous methods or passed on the callback
for asynchronous methods.- Since:
- 8.2
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classAn exception that happened during the painting of a layer. -
Constructor Summary
ConstructorsConstructorDescriptionTLcdEarthGXYViewTileSet(ILcdBounds aBounds, int aLevels, int aTileResolution) Creates a gxy view tileset.TLcdEarthGXYViewTileSet(ILcdBounds aBounds, int aLevels, long aLevel0Rows, long aLevel0Columns, int aTileResolution) Creates a gxy view tileset.TLcdEarthGXYViewTileSet(ILcdBounds aBounds, int aLevels, long aLevel0Rows, long aLevel0Columns, int aTileWidth, int aTileHeight, ILcdGeoReference aModelReference) Creates a gxy view tileset.TLcdEarthGXYViewTileSet(ILcdBounds aBounds, int aLevels, long aLevel0Rows, long aLevel0Columns, int aTileResolution, ILcdGeoReference aModelReference) Creates a gxy view tileset. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddGXYLayer(ILcdGXYLayer aGXYLayer) Adds a GXY layer to this tile set.voidaddLayeredListener(ILcdLayeredListener aILcdLayeredListener) Registers the givenILcdLayeredListenerto be notified when layers are added, removed or moved.booleancontainsLayer(ILcdLayer aILcdLayer) Returns whether thisILcdLayeredcontains the given layer.booleancontainsTile(ILcdEarthTileSetCoverage aCoverage, int aLevel, long aX, long aY, Object aContext) Returns true if the repository contains the specified tile.voiddispose()This method releases all resources held by the repository, such as file locks, threads or server connections.Returns the background color for the produced tiles.Returns the bounds of this tile set, expressed in the model reference of the model that contains this tile set.getGXYLayer(int aIndex) Returns the coverage with the painted layers.intReturns the image type used for the produced images.getLayer(int i) Returns theILcdLayerin thisILcdLayeredwith indexaIndex.intReturns the current oversampling factor for the produced images.getTileSetCoverage(int aIndex) Returns the coverage at the specified index.intReturns the number of coverages this tileset contains.intReturns the index if the given layer is in the list.booleanSpecifies if anti-aliasing is enabled or not.booleanisGeoReferenceSupported(ILcdEarthTileSetCoverage aCoverage, ILcdGeoReference aGeoReference) Returns true only for the coverage's native georeference.intReturns the number ofILcdLayerobjects in thisILcdLayered.Returns theILcdLayerof thisILcdLayeredthat contains the givenILcdModel.layers()Returns anEnumerationof allILcdLayerobjects currently in thisILcdLayered, starting from the bottom layer to the top layer.Returns anEnumerationof allILcdLayerobjects currently in thisILcdLayered, starting from the top layer to the bottom layer.voidmoveLayerAt(int i, ILcdLayer aILcdLayer) Moves the given layer (which is already inILcdLayered) to the existing index aIndex.voidproduceTile(ILcdEarthTileSetCoverage aCoverage, int aLevel, long aTileX, long aTileY, ILcdGeoReference aGeoReference, TLcdEarthTileFormat aFormat, TLcdEarthTileOperationMode aMode, ILcdEarthTileSetCallback aCallback, Object aContext) Produces the requested tile, and invoke the supplied callback when done.voidRemoves all theILcdLayerobjects from thisILcdLayered.voidremoveLayer(ILcdLayer aILcdLayer) Removes aLayer from thisILcdLayered.voidremoveLayeredListener(ILcdLayeredListener aILcdLayeredListener) Unregisters the givenILcdLayeredListenerfrom receiving layered events for theILcdLayered.voidsetAntiAliased(boolean aAntiAliased) Changes the anti-aliasing behavior.voidsetBackgroundColor(Color aColor) Sets the background color for the produced tiles.voidsetImageType(int aImageType) Sets the image type used for the produced images.voidsetOverSamplingFactor(int aOverSamplingFactor) Sets the oversampling factor for the produced images.Methods inherited from class com.luciad.earth.tileset.ALcdEarthTileSet
cancelTile, containsTileSetCoverage, getLevelCount, getTileBoundsSFCT, getTileColumnCount, getTileRowCount, getTileSetCoverage, isFormatSupported, produceTile, updateTile, updateTileMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.luciad.util.ILcdDisposable
closeMethods inherited from interface com.luciad.view.ILcdLayered
addLayeredListener, getLayers, removeLayeredListener
-
Constructor Details
-
TLcdEarthGXYViewTileSet
Creates a gxy view tileset.- Parameters:
aBounds- The geodetic bounds of the tileset.aLevels- The number of tile levels.aTileResolution- The resolution of a single tile.
-
TLcdEarthGXYViewTileSet
public TLcdEarthGXYViewTileSet(ILcdBounds aBounds, int aLevels, long aLevel0Rows, long aLevel0Columns, int aTileResolution) Creates a gxy view tileset.- Parameters:
aBounds- The geodetic bounds of the tileset.aLevels- The number of tile levels.aLevel0Rows- The number of tile rows at level 0.aLevel0Columns- The number of tile columns at level 0.aTileResolution- The resolution of a single tile.- See Also:
-
TLcdEarthGXYViewTileSet
public TLcdEarthGXYViewTileSet(ILcdBounds aBounds, int aLevels, long aLevel0Rows, long aLevel0Columns, int aTileResolution, ILcdGeoReference aModelReference) Creates a gxy view tileset.- Parameters:
aBounds- The bounds of the tileset in the model reference.aLevels- The number of tile levels.aLevel0Rows- The number of tile rows at level 0.aLevel0Columns- The number of tile columns at level 0.aTileResolution- The resolution of a single tile.aModelReference- The reference in which the tile set's bounds and tile pyramid are defined- See Also:
-
TLcdEarthGXYViewTileSet
public TLcdEarthGXYViewTileSet(ILcdBounds aBounds, int aLevels, long aLevel0Rows, long aLevel0Columns, int aTileWidth, int aTileHeight, ILcdGeoReference aModelReference) Creates a gxy view tileset.- Parameters:
aBounds- The bounds of the tileset in the model reference.aLevels- The number of tile levels.aLevel0Rows- The number of tile rows at level 0.aLevel0Columns- The number of tile columns at level 0.aTileWidth- The width in pixels of a single tile.aTileHeight- The height in pixels of a single tile.aModelReference- The reference in which the tile set's bounds and tile pyramid are defined- See Also:
-
-
Method Details
-
getImageCoverage
Returns the coverage with the painted layers.- Returns:
- the image coverage.
-
produceTile
public void produceTile(ILcdEarthTileSetCoverage aCoverage, int aLevel, long aTileX, long aTileY, ILcdGeoReference aGeoReference, TLcdEarthTileFormat aFormat, TLcdEarthTileOperationMode aMode, ILcdEarthTileSetCallback aCallback, Object aContext) Description copied from interface:ILcdEarthTileSetProduces the requested tile, and invoke the supplied callback when done. The resulting tile is passed to the call back'stileAvailable()method. If the tile cannot be produced for some reason, the methodtileNotAvailable()should be called instead.If the tileset supports it and
aModeisTLcdEarthTileOperationMode.PREFER_ASYNCHRONOUS, the tile request may be executed asynchronously. However, the callback must be invoked at some point in time, unless thecancelTile()method is used to cancel the tile request before it is executed. IfaModeisTLcdEarthTileOperationMode.FORCE_SYNCHRONOUS, the request must be executed synchronously and the callback must be invoked beforeproduceTile()returns.Tiles may be requested in reference systems other than the native geo reference of the underlying data, provided that the
isGeoReferenceSupported()method returns true for the requested reference. If this is not the case, the tileset should calltileNotAvailable(). If the tileset callstileAvailable(), the geo reference of the resulting tile must be equal toaGeoReference, and the tile's bounds must likewise be expressed in this reference.Similarly, tiles may be requested in different data formats, as described by
TLcdEarthTileFormat. The format determines the type of the data object that will be contained in the requested tile. To check if a format is supported, useisFormatSupported(). If the specified format is not supported, the tileset should calltileNotAvailable().The context parameter may be used to pass application-specific data into the tileset. If it is not needed, its value may be
null.- Specified by:
produceTilein interfaceILcdEarthTileSet- Parameters:
aCoverage- the coverage from which the tile is requestedaLevel- the level from which the tile is requestedaTileX- the column index of the requested tileaTileY- the row index of the requested tileaGeoReference- the reference system in which the tile should be returnedaFormat- the desired format of the tile's dataaMode- controls the synchronous or asynchronous behaviour of the tilesetaCallback- will be invoked when the tile is available to be usedaContext- application-specific data to be used by the tileset, if any
-
containsTile
public boolean containsTile(ILcdEarthTileSetCoverage aCoverage, int aLevel, long aX, long aY, Object aContext) Description copied from interface:ILcdEarthTileSetReturns true if the repository contains the specified tile.- Specified by:
containsTilein interfaceILcdEarthTileSet- Overrides:
containsTilein classALcdEarthTileSet- Parameters:
aCoverage- the coverage from which to query a tileaLevel- the detail level for which to query a tileaX- the column index at which to query a tileaY- the row index at which to query a tileaContext- application-specific data to be used by the tileset, if any- Returns:
- true if the repository contains the requested tile
-
dispose
public void dispose()Description copied from interface:ILcdEarthTileSetThis method releases all resources held by the repository, such as file locks, threads or server connections.- Specified by:
disposein interfaceILcdDisposable- Specified by:
disposein interfaceILcdEarthTileSet- Overrides:
disposein classALcdEarthTileSet
-
getBounds
Description copied from interface:ILcdEarthTileSetReturns the bounds of this tile set, expressed in the model reference of the model that contains this tile set.- Specified by:
getBoundsin interfaceILcdBounded- Specified by:
getBoundsin interfaceILcdEarthTileSet- Returns:
- the bounds of this tile set
- See Also:
-
getTileSetCoverageCount
public int getTileSetCoverageCount()Description copied from interface:ILcdEarthTileSetReturns the number of coverages this tileset contains.- Specified by:
getTileSetCoverageCountin interfaceILcdEarthTileSet- Returns:
- the number of coverages this tileset contains
-
getTileSetCoverage
Description copied from interface:ILcdEarthTileSetReturns the coverage at the specified index.- Specified by:
getTileSetCoveragein interfaceILcdEarthTileSet- Parameters:
aIndex- the index of the coverage to return- Returns:
- the requested
ILcdEarthTileSetCoverage
-
isGeoReferenceSupported
public boolean isGeoReferenceSupported(ILcdEarthTileSetCoverage aCoverage, ILcdGeoReference aGeoReference) Description copied from class:ALcdEarthTileSetReturns true only for the coverage's native georeference.- Specified by:
isGeoReferenceSupportedin interfaceILcdEarthTileSet- Overrides:
isGeoReferenceSupportedin classALcdEarthTileSet- Parameters:
aCoverage- the coverage to check foraGeoReference- the reference to check for- Returns:
- true if the given coverage can be queried with the given reference
-
getOverSamplingFactor
public int getOverSamplingFactor()Returns the current oversampling factor for the produced images.- Returns:
- An oversampling factor.
- See Also:
-
setOverSamplingFactor
public void setOverSamplingFactor(int aOverSamplingFactor) Sets the oversampling factor for the produced images. A higher oversampling factor reduces the amount of aliasing in the images at the cost of performance. An oversampling factorNresults inN2samples for each pixel, so it should always be>=1.- Parameters:
aOverSamplingFactor- The new oversampling factor.
-
setImageType
public void setImageType(int aImageType) Sets the image type used for the produced images. For transparent data you should set it toBufferedImage.TYPE_INT_ARGB.- Parameters:
aImageType- A valid image type.- See Also:
-
getImageType
public int getImageType()Returns the image type used for the produced images.- Returns:
- The current image type.
- See Also:
-
setBackgroundColor
Sets the background color for the produced tiles. For transparent background you should also configure a propertile image type.- Parameters:
aColor- A background color.- See Also:
-
getBackgroundColor
Returns the background color for the produced tiles.- Returns:
- The current background color.
-
isAntiAliased
public boolean isAntiAliased()Specifies if anti-aliasing is enabled or not. Anti-aliasing makes lines and text appear smoother, but slows down rendering a little bit. If this property isfalse, it does not mean anti-aliasing is fully disabled. It only means anti-aliasing is not enabled on the view level, various layers and painters may still decide to enable anti-aliasing for what they render.- Returns:
trueif anti-aliasing is enabled,falseotherwise.- Since:
- 2018.0
-
setAntiAliased
public void setAntiAliased(boolean aAntiAliased) Changes the anti-aliasing behavior. Please refer toisAntiAliased()for more information.- Parameters:
aAntiAliased-trueto enable anti-aliasing,falseto let layers and painters decide.- Since:
- 2018.0
-
addLayeredListener
Description copied from interface:ILcdLayeredRegisters the given
ILcdLayeredListenerto be notified when layers are added, removed or moved.In case you need to register a listener which keeps a reference to an object with a shorter life-time than this layered, you can use a
ALcdWeakLayeredListenerinstance as layered listener.- Specified by:
addLayeredListenerin interfaceILcdLayered- Parameters:
aILcdLayeredListener- the listener that from now on will be notified of all changes to theILcdLayered- See Also:
-
removeLayeredListener
Description copied from interface:ILcdLayeredUnregisters the givenILcdLayeredListenerfrom receiving layered events for theILcdLayered.- Specified by:
removeLayeredListenerin interfaceILcdLayered- Parameters:
aILcdLayeredListener- the listener that will no longer be notified of changes to theILcdLayered- See Also:
-
getLayer
Description copied from interface:ILcdLayeredReturns theILcdLayerin thisILcdLayeredwith indexaIndex.- Specified by:
getLayerin interfaceILcdLayered- Parameters:
i- the position of the layer to retrieve in theILcdLayered.- Returns:
- the
ILcdLayerin thisILcdLayeredwith indexaIndex. - Throws:
ArrayIndexOutOfBoundsException- if the given index is invalid
-
addGXYLayer
Adds a GXY layer to this tile set. Its contents will be rendered into the tiles. Make sure to disable all asynchronous behavior of the layer. Most notably:TLcdGXYImagePainterandTLcdEarthGXYRasterPaintershould haveasynchronousTileRequestAllowedandrepaintViewWhenTileAvailableset tofalse- do not use
ILcdGXYAsynchronousLayerWrapperor disable its asynchronous behavior
- Parameters:
aGXYLayer- the GXY layer
-
getGXYLayer
-
layerCount
public int layerCount()Description copied from interface:ILcdLayeredReturns the number ofILcdLayerobjects in thisILcdLayered.- Specified by:
layerCountin interfaceILcdLayered- Returns:
- the number of
ILcdLayerobjects in thisILcdLayered.
-
layers
Description copied from interface:ILcdLayeredReturns anEnumerationof allILcdLayerobjects currently in thisILcdLayered, starting from the bottom layer to the top layer.- Specified by:
layersin interfaceILcdLayered- Returns:
- an
Enumerationof allILcdLayerobjects currently in thisILcdLayered, starting from the bottom layer to the top layer.
-
layersBackwards
Description copied from interface:ILcdLayeredReturns anEnumerationof allILcdLayerobjects currently in thisILcdLayered, starting from the top layer to the bottom layer.- Specified by:
layersBackwardsin interfaceILcdLayered- Returns:
- an
Enumerationof allILcdLayerobjects currently in thisILcdLayered, starting from the top layer to the bottom layer.
-
layerOf
Description copied from interface:ILcdLayeredReturns theILcdLayerof thisILcdLayeredthat contains the givenILcdModel.- Specified by:
layerOfin interfaceILcdLayered- Parameters:
aModel- the model to check for in thisILcdLayered.- Returns:
- the
ILcdLayerof thisILcdLayeredthat contains the givenILcdModel. - Throws:
NoSuchElementException- if there is no layer containing the given model
-
indexOf
Description copied from interface:ILcdLayeredReturns the index if the given layer is in the list.- Specified by:
indexOfin interfaceILcdLayered- Parameters:
aLayer- the layer whose index to return- Returns:
- the index of
aLayer - Throws:
NoSuchElementException- ifaLayeris not in the list
-
moveLayerAt
public void moveLayerAt(int i, ILcdLayer aILcdLayer) throws NoSuchElementException, ArrayIndexOutOfBoundsException Description copied from interface:ILcdLayeredMoves the given layer (which is already inILcdLayered) to the existing index aIndex. When a layer is moved down, all layers in between the previous and future position of the given layer (including the layer at index aIndex) are moved one position up. When a layer is moved up, all layers in between the previous and future position of the given layer (including the layer at index aIndex) are moved one position down.More formally, let previousIndex be the index of
aLayerbefore the move. If previousIndex < aIndex, then the index of allILcdLayerobjects in from previousIndex + 1 to aIndex is decremented with 1. If previousIndex > aIndex, then the index of allILcdLayerobjects in from aIndex to previousIndex -1 is incremented with 1.- Specified by:
moveLayerAtin interfaceILcdLayered- Parameters:
i- the index of the position where to move the layer.aILcdLayer- the layer to move.- Throws:
NoSuchElementException- ifaLayeris not in thisILcdLayered.ArrayIndexOutOfBoundsException- ifaIndexis not an index of one of the layers of thisILcdLayered.
-
removeLayer
Description copied from interface:ILcdLayeredRemoves aLayer from thisILcdLayered.- Specified by:
removeLayerin interfaceILcdLayered- Parameters:
aILcdLayer- the layer to remove.- Throws:
NoSuchElementException
-
removeAllLayers
public void removeAllLayers()Description copied from interface:ILcdLayeredRemoves all theILcdLayerobjects from thisILcdLayered.- Specified by:
removeAllLayersin interfaceILcdLayered
-
containsLayer
Description copied from interface:ILcdLayeredReturns whether thisILcdLayeredcontains the given layer. More formally, returnstrueif and only if theILcdLayeredcontains at least one layerlsuch that (aLayer==null ? l==null : aLayer.equals(l)).- Specified by:
containsLayerin interfaceILcdLayered- Parameters:
aILcdLayer- the layer to check whether it is in this layered.- Returns:
- true if
aLayeris in thisILcdLayered, false otherwise.
-