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 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 boolean |
alwaysOnTop |
protected java.util.List<LatLon> |
corners |
protected boolean |
dragEnabled |
protected DraggableSupport |
draggableSupport |
protected WWTexture |
generatedTexture |
protected boolean |
generatedTextureExpired |
protected java.lang.Object |
imageSource |
protected Layer |
pickLayer |
protected PickSupport |
pickSupport |
protected WWTexture |
previousGeneratedTexture |
protected WWTexture |
previousSourceTexture |
protected WWTexture |
sourceTexture |
protected java.util.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(java.lang.Object imageSource,
java.lang.Iterable<? extends LatLon> corners) |
SurfaceImage(java.lang.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(java.lang.Object o) |
void |
export(java.lang.String mimeType,
java.lang.Object output)
Export the Surface Image.
|
protected void |
exportAsKML(java.lang.Object output)
Export the surface image to KML as a
<GroundOverlay> element. |
protected void |
exportKMLLatLonBox(javax.xml.stream.XMLStreamWriter xmlWriter) |
protected void |
exportKMLLatLonQuad(javax.xml.stream.XMLStreamWriter xmlWriter) |
java.util.List<LatLon> |
getCorners() |
double |
getDistanceFromEye()
Returns the ordered renderable's distance from the current view's eye point.
|
Extent |
getExtent(DrawContext dc) |
java.lang.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(java.lang.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.
|
java.lang.String |
isExportFormatSupported(java.lang.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,
java.awt.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(java.lang.Iterable<? extends LatLon> corners) |
void |
setDragEnabled(boolean enabled)
Controls whether the object is enabled for dragging.
|
void |
setImageSource(java.lang.Object imageSource,
java.lang.Iterable<? extends LatLon> corners) |
void |
setImageSource(java.lang.Object imageSource,
Sector sector) |
void |
setOpacity(double opacity) |
void |
setPickEnabled(boolean pickEnabled) |
protected void |
setReferencePosition(Position referencePosition) |
onMessage, 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, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
addPropertyChangeListener, addPropertyChangeListener, clearList, copy, firePropertyChange, firePropertyChange, getEntries, getStringValue, getValue, getValues, hasKey, removeKey, removePropertyChangeListener, removePropertyChangeListener, setValue, setValues
protected boolean alwaysOnTop
protected java.util.List<LatLon> corners
protected boolean dragEnabled
protected DraggableSupport draggableSupport
protected WWTexture generatedTexture
protected boolean generatedTextureExpired
protected java.lang.Object imageSource
protected Layer pickLayer
protected PickSupport pickSupport
protected WWTexture previousGeneratedTexture
protected WWTexture previousSourceTexture
protected WWTexture sourceTexture
protected java.util.List<SurfaceImage> thisList
public SurfaceImage()
public SurfaceImage(java.lang.Object imageSource, java.lang.Iterable<? extends LatLon> corners)
public SurfaceImage(java.lang.Object imageSource, Sector sector)
imageSource
- either the file path to a local image or a BufferedImage
reference.sector
- the sector covered by the image.public void applyInternalTransform(DrawContext dc, boolean textureIdentityActive)
applyInternalTransform
in interface SurfaceTile
public boolean bind(DrawContext dc)
bind
in interface SurfaceTile
public void dispose()
Disposable
dispose
in interface Disposable
protected void doDrag(DragContext dragContext)
public void drag(DragContext dragContext)
Draggable
DragContext
.drag
in interface Draggable
dragContext
- the DragContext
of this dragging event.protected void draw(DrawContext dc)
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public void export(java.lang.String mimeType, java.lang.Object output) throws java.io.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 Exportable
mimeType
- 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).java.io.IOException
- If an exception occurs writing to the output object.Exportable.isExportFormatSupported(String)
protected void exportAsKML(java.lang.Object output) throws java.io.IOException, javax.xml.stream.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.javax.xml.stream.XMLStreamException
- If an exception occurs while writing the KMLjava.io.IOException
- if an exception occurs while exporting the data.export(String, Object)
protected void exportKMLLatLonBox(javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException
javax.xml.stream.XMLStreamException
protected void exportKMLLatLonQuad(javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException
javax.xml.stream.XMLStreamException
public java.util.List<LatLon> getCorners()
getCorners
in interface SurfaceTile
public double getDistanceFromEye()
OrderedRenderable
getDistanceFromEye
in interface OrderedRenderable
public Extent getExtent(DrawContext dc)
getExtent
in interface SurfaceTile
public java.lang.Object getImageSource()
public double getOpacity()
public Position getReferencePosition()
Movable
getReferencePosition
in interface Movable
public Sector getSector()
getSector
in interface SurfaceTile
public int hashCode()
hashCode
in class java.lang.Object
protected WWTexture initializeGeneratedTexture(DrawContext dc)
protected void initializeGeometry(java.lang.Iterable<? extends LatLon> corners)
protected void initializeSourceTexture(DrawContext dc)
public boolean isAlwaysOnTop()
true
if the always-on-top flag is set, otherwise false
.setAlwaysOnTop(boolean)
public boolean isDragEnabled()
Draggable
isDragEnabled
in interface Draggable
public java.lang.String isExportFormatSupported(java.lang.String format)
isExportFormatSupported
in interface Exportable
format
- 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)
Movable
public void moveTo(Position position)
Movable
public void pick(DrawContext dc, java.awt.Point pickPoint)
OrderedRenderable
pick
in interface OrderedRenderable
dc
- the current draw context.pickPoint
- the pick point.public void preRender(DrawContext dc)
preRender
in interface PreRenderable
public void render(DrawContext dc)
Renderable
Renderable
to render itself using the provided draw context.render
in interface Renderable
dc
- the DrawContext
to be usedDrawContext
public 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 setCorners(java.lang.Iterable<? extends LatLon> corners)
public void setDragEnabled(boolean enabled)
Draggable
setDragEnabled
in interface Draggable
enabled
- true
if the object is enabled, else false
.public void setImageSource(java.lang.Object imageSource, java.lang.Iterable<? extends LatLon> corners)
public void setImageSource(java.lang.Object imageSource, Sector sector)
public void setOpacity(double opacity)
public void setPickEnabled(boolean pickEnabled)
protected void setReferencePosition(Position referencePosition)