public class TLcdEarthGXYViewTileSet extends ALcdEarthTileSet implements ILcdLayered
GXY layers
, but make sure they have no asynchronous behaviorbackground color
and the tile 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.Modifier and Type | Class and Description |
---|---|
static class |
TLcdEarthGXYViewTileSet.PaintException
An exception that happened during the painting of a layer.
|
Constructor and Description |
---|
TLcdEarthGXYViewTileSet(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 aTileResolution,
ILcdGeoReference aModelReference)
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.
|
Modifier and Type | Method and Description |
---|---|
void |
addGXYLayer(ILcdGXYLayer aGXYLayer)
Adds a GXY layer to this tile set.
|
void |
addLayeredListener(ILcdLayeredListener aILcdLayeredListener)
Registers the given
ILcdLayeredListener to be notified when layers are added, removed or moved. |
boolean |
containsLayer(ILcdLayer aILcdLayer)
Returns whether this
ILcdLayered contains the given layer. |
boolean |
containsTile(ILcdEarthTileSetCoverage aCoverage,
int aLevel,
long aX,
long aY,
Object aContext)
Returns true if the repository contains the specified tile.
|
void |
dispose()
This method releases all resources held by the
repository, such as file locks, threads or server connections.
|
Color |
getBackgroundColor()
Returns the background color for the produced tiles.
|
ILcdBounds |
getBounds()
Returns the bounds of this tile set, expressed in the model reference of the model that
contains this tile set.
|
ILcdGXYLayer |
getGXYLayer(int aIndex) |
ILcdEarthRasterTileSetCoverage |
getImageCoverage()
Returns the coverage with the painted layers.
|
int |
getImageType()
Returns the image type used for the produced images.
|
ILcdLayer |
getLayer(int i)
Returns the
ILcdLayer in this ILcdLayered
with index aIndex . |
int |
getOverSamplingFactor()
Returns the current oversampling factor for the produced images.
|
ILcdEarthTileSetCoverage |
getTileSetCoverage(int aIndex)
Returns the coverage at the specified index.
|
int |
getTileSetCoverageCount()
Returns the number of coverages this tileset contains.
|
int |
indexOf(ILcdLayer aLayer)
Returns the index if the given layer is in the list.
|
boolean |
isAntiAliased()
Specifies if anti-aliasing is enabled or not.
|
boolean |
isGeoReferenceSupported(ILcdEarthTileSetCoverage aCoverage,
ILcdGeoReference aGeoReference)
Returns true only for the coverage's native georeference.
|
int |
layerCount()
Returns the number of
ILcdLayer objects in this ILcdLayered . |
ILcdLayer |
layerOf(ILcdModel aModel)
Returns the
ILcdLayer of this ILcdLayered that contains the given ILcdModel . |
Enumeration |
layers()
Returns an
Enumeration of all ILcdLayer objects currently
in this ILcdLayered ,
starting from the bottom layer to the top layer. |
Enumeration |
layersBackwards()
Returns an
Enumeration of all ILcdLayer objects currently in this ILcdLayered ,
starting from the top layer to the bottom layer. |
void |
moveLayerAt(int i,
ILcdLayer aILcdLayer)
Moves the given layer (which is already in
ILcdLayered ) to the existing index
aIndex. |
void |
produceTile(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.
|
void |
removeAllLayers()
Removes all the
ILcdLayer objects from this ILcdLayered . |
void |
removeLayer(ILcdLayer aILcdLayer)
Removes aLayer from this
ILcdLayered . |
void |
removeLayeredListener(ILcdLayeredListener aILcdLayeredListener)
Unregisters the given
ILcdLayeredListener from receiving layered events for
the ILcdLayered . |
void |
setAntiAliased(boolean aAntiAliased)
Changes the anti-aliasing behavior.
|
void |
setBackgroundColor(Color aColor)
Sets the background color for the produced tiles.
|
void |
setImageType(int aImageType)
Sets the image type used for the produced images.
|
void |
setOverSamplingFactor(int aOverSamplingFactor)
Sets the oversampling factor for the produced images.
|
cancelTile, containsTileSetCoverage, getLevelCount, getTileBoundsSFCT, getTileColumnCount, getTileRowCount, getTileSetCoverage, isFormatSupported, produceTile, updateTile, updateTile
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addLayeredListener, getLayers, removeLayeredListener
close
public TLcdEarthGXYViewTileSet(ILcdBounds aBounds, int aLevels, int aTileResolution)
aBounds
- The geodetic bounds of the tileset.aLevels
- The number of tile levels.aTileResolution
- The resolution of a single tile.public TLcdEarthGXYViewTileSet(ILcdBounds aBounds, int aLevels, long aLevel0Rows, long aLevel0Columns, int aTileResolution)
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.ILcdEarthTileSet.getTileRowCount(int)
,
ILcdEarthTileSet.getTileColumnCount(int)
public TLcdEarthGXYViewTileSet(ILcdBounds aBounds, int aLevels, long aLevel0Rows, long aLevel0Columns, int aTileResolution, ILcdGeoReference aModelReference)
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
definedILcdEarthTileSet.getTileRowCount(int)
,
ILcdEarthTileSet.getTileColumnCount(int)
public TLcdEarthGXYViewTileSet(ILcdBounds aBounds, int aLevels, long aLevel0Rows, long aLevel0Columns, int aTileWidth, int aTileHeight, ILcdGeoReference aModelReference)
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
definedILcdEarthTileSet.getTileRowCount(int)
,
ILcdEarthTileSet.getTileColumnCount(int)
public ILcdEarthRasterTileSetCoverage getImageCoverage()
public void produceTile(ILcdEarthTileSetCoverage aCoverage, int aLevel, long aTileX, long aTileY, ILcdGeoReference aGeoReference, TLcdEarthTileFormat aFormat, TLcdEarthTileOperationMode aMode, ILcdEarthTileSetCallback aCallback, Object aContext)
ILcdEarthTileSet
tileAvailable()
method. If the tile cannot be produced for some reason, the method tileNotAvailable()
should be called instead.
If the tileset supports it and aMode
is TLcdEarthTileOperationMode.PREFER_ASYNCHRONOUS
,
the tile request may be executed asynchronously. However, the callback
must be invoked at some point in time, unless the
cancelTile()
method is used to cancel the tile request before it is executed. If
aMode
is TLcdEarthTileOperationMode.FORCE_SYNCHRONOUS
,
the request must be executed synchronously and the callback must be
invoked before produceTile()
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 call tileNotAvailable()
. If the tileset
calls tileAvailable()
, the geo reference of the resulting tile
must be equal to aGeoReference
, 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, use isFormatSupported()
.
If the specified format is not supported, the tileset should call
tileNotAvailable()
.
The context parameter may be used to pass application-specific data into
the tileset. If it is not needed, its value may be null
.
produceTile
in interface ILcdEarthTileSet
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 anypublic boolean containsTile(ILcdEarthTileSetCoverage aCoverage, int aLevel, long aX, long aY, Object aContext)
ILcdEarthTileSet
containsTile
in interface ILcdEarthTileSet
containsTile
in class ALcdEarthTileSet
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 anypublic void dispose()
ILcdEarthTileSet
dispose
in interface ILcdEarthTileSet
dispose
in interface ILcdDisposable
dispose
in class ALcdEarthTileSet
public ILcdBounds getBounds()
ILcdEarthTileSet
getBounds
in interface ILcdEarthTileSet
getBounds
in interface ILcdBounded
ILcdBounded.getBounds()
public int getTileSetCoverageCount()
ILcdEarthTileSet
getTileSetCoverageCount
in interface ILcdEarthTileSet
public ILcdEarthTileSetCoverage getTileSetCoverage(int aIndex)
ILcdEarthTileSet
getTileSetCoverage
in interface ILcdEarthTileSet
aIndex
- the index of the coverage to returnILcdEarthTileSetCoverage
public boolean isGeoReferenceSupported(ILcdEarthTileSetCoverage aCoverage, ILcdGeoReference aGeoReference)
ALcdEarthTileSet
isGeoReferenceSupported
in interface ILcdEarthTileSet
isGeoReferenceSupported
in class ALcdEarthTileSet
aCoverage
- the coverage to check foraGeoReference
- the reference to check forpublic int getOverSamplingFactor()
setOverSamplingFactor(int)
public void setOverSamplingFactor(int aOverSamplingFactor)
N
results in N
2
samples for each pixel, so it
should always be >=1
.aOverSamplingFactor
- The new oversampling factor.public void setImageType(int aImageType)
BufferedImage.TYPE_INT_ARGB
.aImageType
- A valid image type.BufferedImage.getType()
,
setBackgroundColor(Color)
public int getImageType()
BufferedImage.getType()
public void setBackgroundColor(Color aColor)
tile image type
.aColor
- A background color.setImageType(int)
public Color getBackgroundColor()
public boolean isAntiAliased()
false
, 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.true
if anti-aliasing is enabled, false
otherwise.public void setAntiAliased(boolean aAntiAliased)
isAntiAliased()
for more information.aAntiAliased
- true
to enable anti-aliasing, false
to let layers and painters decide.public void addLayeredListener(ILcdLayeredListener aILcdLayeredListener)
ILcdLayered
Registers the given ILcdLayeredListener
to 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 ALcdWeakLayeredListener
instance as layered listener.
addLayeredListener
in interface ILcdLayered
aILcdLayeredListener
- the listener that from now on will be notified of all changes
to the ILcdLayered
ILcdLayered.removeLayeredListener(com.luciad.view.ILcdLayeredListener)
public void removeLayeredListener(ILcdLayeredListener aILcdLayeredListener)
ILcdLayered
ILcdLayeredListener
from receiving layered events for
the ILcdLayered
.removeLayeredListener
in interface ILcdLayered
aILcdLayeredListener
- the listener that will no longer be notified of changes
to the ILcdLayered
ILcdLayered.addLayeredListener(ILcdLayeredListener)
public ILcdLayer getLayer(int i) throws ArrayIndexOutOfBoundsException
ILcdLayered
ILcdLayer
in this ILcdLayered
with index aIndex
.getLayer
in interface ILcdLayered
i
- the position of the layer to retrieve in the ILcdLayered
.ILcdLayer
in this ILcdLayered
with index aIndex
.ArrayIndexOutOfBoundsException
- if the given index is invalidpublic void addGXYLayer(ILcdGXYLayer aGXYLayer)
TLcdGXYImagePainter
and TLcdEarthGXYRasterPainter
should have
asynchronousTileRequestAllowed
and repaintViewWhenTileAvailable
set to false
ILcdGXYAsynchronousLayerWrapper
or disable its asynchronous behavioraGXYLayer
- the GXY layerpublic ILcdGXYLayer getGXYLayer(int aIndex)
public int layerCount()
ILcdLayered
ILcdLayer
objects in this ILcdLayered
.layerCount
in interface ILcdLayered
ILcdLayer
objects in this ILcdLayered
.public Enumeration layers()
ILcdLayered
Enumeration
of all ILcdLayer
objects currently
in this ILcdLayered
,
starting from the bottom layer to the top layer.layers
in interface ILcdLayered
Enumeration
of all ILcdLayer
objects currently
in this ILcdLayered
,
starting from the bottom layer to the top layer.public Enumeration layersBackwards()
ILcdLayered
Enumeration
of all ILcdLayer
objects currently in this ILcdLayered
,
starting from the top layer to the bottom layer.layersBackwards
in interface ILcdLayered
Enumeration
of all ILcdLayer
objects currently in this ILcdLayered
,
starting from the top layer to the bottom layer.public ILcdLayer layerOf(ILcdModel aModel) throws NoSuchElementException
ILcdLayered
ILcdLayer
of this ILcdLayered
that contains the given ILcdModel
.layerOf
in interface ILcdLayered
aModel
- the model to check for in this ILcdLayered
.ILcdLayer
of this ILcdLayered
that contains the given ILcdModel
.NoSuchElementException
- if there is no layer containing the given modelpublic int indexOf(ILcdLayer aLayer) throws NoSuchElementException
ILcdLayered
indexOf
in interface ILcdLayered
aLayer
- the layer whose index to returnaLayer
NoSuchElementException
- if aLayer
is not in the listpublic void moveLayerAt(int i, ILcdLayer aILcdLayer) throws NoSuchElementException, ArrayIndexOutOfBoundsException
ILcdLayered
ILcdLayered
) 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 aLayer
before the move.
If previousIndex < aIndex, then the index of all ILcdLayer
objects
in from previousIndex + 1 to aIndex is decremented with 1.
If previousIndex > aIndex, then the index of all ILcdLayer
objects
in from aIndex to previousIndex -1 is incremented with 1.
moveLayerAt
in interface ILcdLayered
i
- the index of the position where to move the layer.aILcdLayer
- the layer to move.NoSuchElementException
- if aLayer
is not in this ILcdLayered
.ArrayIndexOutOfBoundsException
- if aIndex
is not an index of one of
the layers of this ILcdLayered
.public void removeLayer(ILcdLayer aILcdLayer) throws NoSuchElementException
ILcdLayered
ILcdLayered
.removeLayer
in interface ILcdLayered
aILcdLayer
- the layer to remove.NoSuchElementException
public void removeAllLayers()
ILcdLayered
ILcdLayer
objects from this ILcdLayered
.removeAllLayers
in interface ILcdLayered
public boolean containsLayer(ILcdLayer aILcdLayer)
ILcdLayered
ILcdLayered
contains the given layer.
More formally, returns true
if and only if the ILcdLayered
contains at least one layer l
such that
(aLayer==null ? l==null : aLayer.equals(l)).containsLayer
in interface ILcdLayered
aILcdLayer
- the layer to check whether it is in this layered.aLayer
is in this ILcdLayered
,
false otherwise.