public class SurfaceImageLayer extends RenderableLayer
SelectEvent
s and will not respond to the user's attempts at navigation when the cursor is
over the image. If this is not the desired behavior, disable picking for the layer containing the surface image.Modifier and Type | Field and Description |
---|---|
protected BasicDataRasterReaderFactory |
factory |
protected ConcurrentHashMap<String,ArrayList<SurfaceImage>> |
imageTable |
protected ImageTiler |
imageTiler |
pickSupport, renderables, renderablesOverride
Constructor and Description |
---|
SurfaceImageLayer() |
Modifier and Type | Method and Description |
---|---|
void |
addImage(String imagePath)
Add an image to the collection, reprojecting it to geographic (latitude & longitude) coordinates if necessary.
|
void |
addImage(String name,
BufferedImage image,
List<? extends LatLon> corners)
Add a
BufferedImage to the collection at an explicitly specified location. |
void |
addImage(String name,
BufferedImage image,
Sector sector)
Add a
BufferedImage to the collection at an explicitly specified location. |
void |
addImage(String imagePath,
List<? extends LatLon> corners)
Add an image to the collection at an explicitly specified location.
|
void |
addImage(String imagePath,
Sector sector)
Add an image to the collection and specify its coverage.
|
BufferedImage |
composeImageForSector(Sector sector,
int canvasWidth,
int canvasHeight,
double aspectRatio,
BufferedImage image)
Create an image for the portion of this layer lying within a specified sector.
|
void |
dispose()
Disposes the contents of this layer's internal Renderable collection, but does not remove any elements from that
collection.
|
protected BufferedImage |
getBufferedImage(DataRaster raster) |
int |
getNumImages() |
protected DataRaster |
openDataRaster(Object src,
AVList params) |
void |
removeImage(String imagePath) |
void |
setOpacity(double opacity)
Opacity is not applied to layers of this type because each renderable typically has its own opacity control.
|
addRenderable, addRenderable, addRenderables, clearRenderables, disposeRenderables, doPick, doPick, doPreRender, doPreRender, doRender, doRender, getActiveRenderables, getNumRenderables, getOpacity, getRenderables, onMessage, removeAllRenderables, removeRenderable, setRenderables, toString
createLayerConfigElements, getDataFileStore, getExpiryTime, getLayerConfigParams, getMaxActiveAltitude, getMaxEffectiveAltitude, getMinActiveAltitude, getMinEffectiveAltitude, getName, getRestorableState, getScale, getScreenCredit, isAtMaxResolution, isEnabled, isLayerActive, isLayerConfigDocument, isLayerInView, isMultiResolution, isNetworkRetrievalEnabled, isPickEnabled, pick, preRender, render, restoreState, setDataFileStore, setEnabled, setExpiryTime, setMaxActiveAltitude, setMinActiveAltitude, setName, setNetworkRetrievalEnabled, setPickEnabled, setScreenCredit
propertyChange
addPropertyChangeListener, addPropertyChangeListener, clearList, copy, firePropertyChange, firePropertyChange, getBooleanValue, getBooleanValue, getChangeSupport, getDoubleValue, getDoubleValue, getEntries, getIntegerValue, getIntegerValue, getLongValue, getLongValue, getRestorableStateForAVPair, getStringValue, getStringValue, getStringValue, getValue, getValues, hasKey, removeKey, removePropertyChangeListener, removePropertyChangeListener, setValue, setValues
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
addPropertyChangeListener, addPropertyChangeListener, clearList, copy, firePropertyChange, firePropertyChange, getEntries, getStringValue, getValue, getValues, hasKey, removeKey, removePropertyChangeListener, removePropertyChangeListener, setValue, setValues
propertyChange
protected BasicDataRasterReaderFactory factory
protected ConcurrentHashMap<String,ArrayList<SurfaceImage>> imageTable
protected ImageTiler imageTiler
public void addImage(String imagePath) throws IOException
imagePath
- the path to the image file.IllegalArgumentException
- if the image path is null.IOException
- if an error occurs reading the image file.IllegalStateException
- if an error occurs while reprojecting or otherwise processing the image.WWRuntimeException
- if the image type is unsupported.public void addImage(String name, BufferedImage image, List<? extends LatLon> corners)
BufferedImage
to the collection at an explicitly specified location. The image is assumed to be in
geographic projection (latitude & longitude).name
- a unique name to associate with the image so that it can be subsequently referred to without
having to keep a reference to the image itself. Use this name in calls to removeImage(String)
.image
- the image to add.corners
- the geographic location of the image's corners, specified in order of lower-left, lower-right,
upper-right, upper-left.IllegalArgumentException
- if the image path is null, the corners list is null, contains null values or
fewer than four locations.WWRuntimeException
- if the image type is unsupported.public void addImage(String name, BufferedImage image, Sector sector)
BufferedImage
to the collection at an explicitly specified location. The image is assumed to be in
geographic projection (latitude & longitude).name
- a unique name to associate with the image so that it can be subsequently referred to without having
to keep a reference to the image itself. Use this name in calls to removeImage(String)
.image
- the image to add.sector
- the geographic location of the image.IllegalArgumentException
- if the image path or sector is null.WWRuntimeException
- if the image type is unsupported.public void addImage(String imagePath, List<? extends LatLon> corners) throws IOException, WWRuntimeException
imagePath
- the path to the image file.corners
- the geographic location of the image's corners, specified in order of lower-left, lower-right,
upper-right, upper-left.IllegalArgumentException
- if the image path or sector is null.IOException
- if an error occurs reading the image file.WWRuntimeException
- if the image type is unsupported.public void addImage(String imagePath, Sector sector) throws IOException, WWRuntimeException
imagePath
- the path to the image file.sector
- the geographic location of the image.IllegalArgumentException
- if the image path or sector is null.IOException
- if an error occurs reading the image file.WWRuntimeException
- if the image type is unsupported.public BufferedImage composeImageForSector(Sector sector, int canvasWidth, int canvasHeight, double aspectRatio, BufferedImage image)
sector
- the sector of interest.canvasWidth
- the width of the canvas.canvasHeight
- the height of the canvas.aspectRatio
- the aspect ratio, width/height, of the window. If the aspect ratio is greater or equal to
one, the full width of the canvas is used for the image; the height used is proportional to
the inverse of the aspect ratio. If the aspect ratio is less than one, the full height of the
canvas is used, and the width used is proportional to the aspect ratio.image
- if non-null, a BufferedImage
in which to place the image. If null, a new buffered
image of type BufferedImage.TYPE_INT_RGB
is created. The image must be the width and
height specified in the canvasWidth
and canvasHeight
arguments.canvasWidth
and
canvasHeight
. If the specified aspect ratio is one, all pixels contain values. If the aspect
ratio is greater than one, a full-width segment along the top of the canvas is blank. If the aspect ratio
is less than one, a full-height segment along the right side of the canvase is blank. If the
image
argument was non-null, that buffered image is returned.ImageUtil.mergeImage(Sector, Sector, double, BufferedImage, BufferedImage)
public void dispose()
RenderableLayer
AVList
, this stops forwarding
their property change events to the layer's property change listeners. Any property change listeners the layer
attached to the renderables
in RenderableLayer.addRenderable(gov.nasa.worldwind.render.Renderable)
or
RenderableLayer.addRenderables(Iterable)
are removed.dispose
in interface Disposable
dispose
in class RenderableLayer
protected BufferedImage getBufferedImage(DataRaster raster)
public int getNumImages()
protected DataRaster openDataRaster(Object src, AVList params) throws IllegalArgumentException, WWRuntimeException
public void removeImage(String imagePath)
public void setOpacity(double opacity)
RenderableLayer
setOpacity
in interface Layer
setOpacity
in class RenderableLayer
opacity
- the current opacity value, which is ignored by this layer.