public class SurfaceImage extends WWObjectImpl implements SurfaceTile, OrderedRenderable, PreRenderable, Movable, Disposable, Exportable, Draggable
BufferedImage.
Note: The view input handlers detect the surface image rather than the terrain as the top picked object in SelectEvents 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 boolean |
alwaysOnTop |
protected List<LatLon> |
corners |
protected boolean |
dragEnabled |
protected DraggableSupport |
draggableSupport |
protected WWTexture |
generatedTexture |
protected boolean |
generatedTextureExpired |
protected Object |
imageSource |
protected Layer |
pickLayer |
protected PickSupport |
pickSupport |
protected WWTexture |
previousGeneratedTexture |
protected WWTexture |
previousSourceTexture |
protected WWTexture |
sourceTexture |
protected List<SurfaceImage> |
thisList
A list that contains only a reference to this instance.
|
FORMAT_NOT_SUPPORTED, FORMAT_PARTIALLY_SUPPORTED, FORMAT_SUPPORTED| Constructor and Description |
|---|
SurfaceImage()
Create a new surface image with no image source.
|
SurfaceImage(Object imageSource,
Iterable<? extends LatLon> corners) |
SurfaceImage(Object imageSource,
Sector sector)
Renders a single image tile from a local image source.
|
| Modifier and Type | Method and Description |
|---|---|
void |
applyInternalTransform(DrawContext dc,
boolean textureIdentityActive) |
boolean |
bind(DrawContext dc) |
void |
dispose()
Disposes of any internal resources allocated by the object.
|
protected void |
doDrag(DragContext dragContext) |
void |
drag(DragContext dragContext)
Drag the object given the provided
DragContext. |
protected void |
draw(DrawContext dc) |
boolean |
equals(Object o) |
void |
export(String mimeType,
Object output)
Export the Surface Image.
|
protected void |
exportAsKML(Object output)
Export the surface image to KML as a
<GroundOverlay> element. |
protected void |
exportKMLLatLonBox(XMLStreamWriter xmlWriter) |
protected void |
exportKMLLatLonQuad(XMLStreamWriter xmlWriter) |
List<LatLon> |
getCorners() |
double |
getDistanceFromEye()
Returns the ordered renderable's distance from the current view's eye point.
|
Extent |
getExtent(DrawContext dc) |
Object |
getImageSource() |
double |
getOpacity() |
Position |
getReferencePosition()
A position associated with the object that indicates its aggregate geographic position.
|
Sector |
getSector() |
int |
hashCode() |
protected WWTexture |
initializeGeneratedTexture(DrawContext dc) |
protected void |
initializeGeometry(Iterable<? extends LatLon> corners) |
protected void |
initializeSourceTexture(DrawContext dc) |
boolean |
isAlwaysOnTop()
Indicates the state of this surface image's always-on-top flag.
|
boolean |
isDragEnabled()
Indicates whether the object is enabled for dragging.
|
String |
isExportFormatSupported(String format)
Does this object support a certain export format?
|
boolean |
isPickEnabled() |
void |
move(Position delta)
Shift the shape over the globe's surface while maintaining its original azimuth, its orientation relative to
North.
|
void |
moveTo(Position position)
Move the shape over the globe's surface while maintaining its original azimuth, its orientation relative to
North.
|
void |
pick(DrawContext dc,
Point pickPoint)
Executes a pick of the ordered renderable.
|
void |
preRender(DrawContext dc) |
void |
render(DrawContext dc)
Causes this
Renderable to render itself using the provided draw context. |
void |
setAlwaysOnTop(boolean alwaysOnTop)
Specifies whether this surface image should appear on top of other image layers and surface shapes in the scene.
|
void |
setCorners(Iterable<? extends LatLon> corners) |
void |
setDragEnabled(boolean enabled)
Controls whether the object is enabled for dragging.
|
void |
setImageSource(Object imageSource,
Iterable<? extends LatLon> corners) |
void |
setImageSource(Object imageSource,
Sector sector) |
void |
setOpacity(double opacity) |
void |
setPickEnabled(boolean pickEnabled) |
protected void |
setReferencePosition(Position referencePosition) |
onMessage, propertyChangeaddPropertyChangeListener, 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, setValuesclone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitaddPropertyChangeListener, addPropertyChangeListener, clearList, copy, firePropertyChange, firePropertyChange, getEntries, getStringValue, getValue, getValues, hasKey, removeKey, removePropertyChangeListener, removePropertyChangeListener, setValue, setValuesprotected boolean alwaysOnTop
protected boolean dragEnabled
protected DraggableSupport draggableSupport
protected WWTexture generatedTexture
protected boolean generatedTextureExpired
protected Object imageSource
protected Layer pickLayer
protected PickSupport pickSupport
protected WWTexture previousGeneratedTexture
protected WWTexture previousSourceTexture
protected WWTexture sourceTexture
protected List<SurfaceImage> thisList
public SurfaceImage()
public void applyInternalTransform(DrawContext dc, boolean textureIdentityActive)
applyInternalTransform in interface SurfaceTilepublic boolean bind(DrawContext dc)
bind in interface SurfaceTilepublic void dispose()
Disposabledispose in interface Disposableprotected void doDrag(DragContext dragContext)
public void drag(DragContext dragContext)
DraggableDragContext.drag in interface DraggabledragContext - the DragContext of this dragging event.protected void draw(DrawContext dc)
public void export(String mimeType, Object output) throws IOException
output object will receive the exported data. The type of this object
depends on the export format. The formats and object types supported by this class are:
Format Supported output object types
================================================================================
KML (application/vnd.google-earth.kml+xml) java.io.Writer
java.io.OutputStream
javax.xml.stream.XMLStreamWriter
export in interface ExportablemimeType - MIME type of desired export format.output - An object that will receive the exported data. The type of this object depends on the export
format (see above).IOException - If an exception occurs writing to the output object.Exportable.isExportFormatSupported(String)protected void exportAsKML(Object output) throws IOException, XMLStreamException
<GroundOverlay> element. The output object will receive the
data. This object must be one of: java.io.Writer java.io.OutputStream javax.xml.stream.XMLStreamWriteroutput - Object to receive the generated KML.XMLStreamException - If an exception occurs while writing the KMLIOException - if an exception occurs while exporting the data.export(String, Object)protected void exportKMLLatLonBox(XMLStreamWriter xmlWriter) throws XMLStreamException
XMLStreamExceptionprotected void exportKMLLatLonQuad(XMLStreamWriter xmlWriter) throws XMLStreamException
XMLStreamExceptionpublic List<LatLon> getCorners()
getCorners in interface SurfaceTilepublic double getDistanceFromEye()
OrderedRenderablegetDistanceFromEye in interface OrderedRenderablepublic Extent getExtent(DrawContext dc)
getExtent in interface SurfaceTilepublic Object getImageSource()
public double getOpacity()
public Position getReferencePosition()
MovablegetReferencePosition in interface Movablepublic Sector getSector()
getSector in interface SurfaceTileprotected WWTexture initializeGeneratedTexture(DrawContext dc)
protected void initializeSourceTexture(DrawContext dc)
public boolean isAlwaysOnTop()
true if the always-on-top flag is set, otherwise false.setAlwaysOnTop(boolean)public boolean isDragEnabled()
DraggableisDragEnabled in interface Draggablepublic String isExportFormatSupported(String format)
isExportFormatSupported in interface Exportableformat - Desired export format.Exportable.FORMAT_SUPPORTED, Exportable.FORMAT_NOT_SUPPORTED, or Exportable.FORMAT_PARTIALLY_SUPPORTED.Exportable.export(String, Object)public boolean isPickEnabled()
public void move(Position delta)
Movablepublic void moveTo(Position position)
Movablepublic void pick(DrawContext dc, Point pickPoint)
OrderedRenderablepick in interface OrderedRenderabledc - the current draw context.pickPoint - the pick point.public void preRender(DrawContext dc)
preRender in interface PreRenderablepublic void render(DrawContext dc)
RenderableRenderable to render itself using the provided draw context.render in interface Renderabledc - the DrawContext to be usedDrawContextpublic void setAlwaysOnTop(boolean alwaysOnTop)
true, this surface image appears visually above other image layers and surface
shapes. Otherwise, this surface image appears interleaved with other image layers according to its relative order
in the layer list, and appears beneath all surface shapes. The default is false.alwaysOnTop - true if the surface image should appear always on top, otherwise
false.public void setDragEnabled(boolean enabled)
DraggablesetDragEnabled in interface Draggableenabled - true if the object is enabled, else false.public void setOpacity(double opacity)
public void setPickEnabled(boolean pickEnabled)
protected void setReferencePosition(Position referencePosition)