NASA World Wind

gov.nasa.worldwind.render
Class PointPlacemark

java.lang.Object
  extended by gov.nasa.worldwind.avlist.AVListImpl
      extended by gov.nasa.worldwind.WWObjectImpl
          extended by gov.nasa.worldwind.render.PointPlacemark
All Implemented Interfaces:
AVList, MessageListener, Exportable, Locatable, Movable, Declutterable, Highlightable, OrderedRenderable, Renderable, WWObject, PropertyChangeListener, EventListener
Direct Known Subclasses:
KMLPointPlacemarkImpl

public class PointPlacemark
extends WWObjectImpl
implements OrderedRenderable, Locatable, Movable, Highlightable, Exportable, Declutterable

Represents a point placemark consisting of an image, an optional line linking the image to a corresponding point on the terrain, and an optional label. The image and the label are displayed in the plane of the screen.

Point placemarks have separate attributes for normal rendering and highlighted rendering. If highlighting is requested but no highlight attributes are specified, the normal attributes are used. If the normal attributes are not specified, default attributes are used. See getDefaultAttributes().

This class implements and extends the functionality of a KML Point.

Point placemarks can participate in global text decluttering by setting their decluttering-enabled flag to true. See setEnableDecluttering(boolean). The default for this flag is false. When participating in decluttering, only the point placemark's label is considered when determining interference with other text.


Field Summary
protected  PointPlacemarkAttributes activeAttributes
           
protected  WWTexture activeTexture
           
protected  int altitudeMode
           
protected  boolean applyVerticalExaggeration
           
protected  Font boundsFont
           
protected  boolean clipToHorizon
           
protected static Double DEFAULT_HIGHLIGHT_SCALE
          The scale to use when highlighting if no highlight attributes are specified.
protected static Offset DEFAULT_LABEL_OFFSET_IF_UNSPECIFIED
          The label offset to use if none is specified but an image has been specified.
protected static Double DEFAULT_POINT_SIZE
          The point size to use when none is specified.
protected static PointPlacemarkAttributes defaultAttributes
          The attributes used if attributes are not specified.
protected  Object delegateOwner
           
protected  double dx
           
protected  double dy
           
protected  boolean enableBatchPicking
           
protected  boolean enableBatchRendering
           
protected  boolean enableDecluttering
           
protected  double eyeDistance
           
protected  long frameNumber
           
protected  PointPlacemarkAttributes highlightAttrs
           
protected  boolean highlighted
           
protected  Rectangle2D labelBounds
           
protected  String labelText
           
protected  boolean lineEnabled
           
protected  int linePickWidth
           
protected  PointPlacemarkAttributes normalAttrs
           
protected  Layer pickLayer
           
protected  PickSupport pickSupport
           
protected  Vec4 placePoint
           
protected  Position position
           
protected  Vec4 screenPoint
           
protected  Vec4 terrainPoint
           
protected  Map<String,WWTexture> textures
           
protected  boolean visible
           
 
Fields inherited from interface gov.nasa.worldwind.Exportable
FORMAT_NOT_SUPPORTED, FORMAT_PARTIALLY_SUPPORTED, FORMAT_SUPPORTED
 
Constructor Summary
PointPlacemark(Position position)
          Construct a point placemark.
 
Method Summary
protected  void beginDrawing(DrawContext dc)
          Establish the OpenGL state needed to draw Paths.
protected  WWTexture chooseTexture(PointPlacemarkAttributes attrs)
          Determines the appropriate texture for the current availability.
protected  void computeImageOffset(DrawContext dc)
           
protected  Rectangle computeImageRectangle(DrawContext dc)
          Computes the screen-space rectangle bounding the placemark image.
protected  void computePlacemarkPoints(DrawContext dc)
          Computes and stores the placemark's Cartesian location, the Cartesian location of the corresponding point on the terrain (if the altitude mode requires it), and the screen-space projection of the placemark's point.
protected  PickedObject createPickedObject(DrawContext dc, Color pickColor)
          Create a PickedObject for this placemark.
protected  void determineActiveAttributes()
          Determines which attributes -- normal, highlight or default -- to use each frame.
protected  void doDrawOrderedRenderable(DrawContext dc, PickSupport pickCandidates)
          Draw this placemark as an ordered renderable.
protected  void drawBatched(DrawContext dc)
          Draws this ordered renderable and all subsequent PointPlacemark ordered renderables in the ordered renderable list.
protected  void drawLabel(DrawContext dc)
          Draws the placemark's label if a label is specified.
protected  void drawLine(DrawContext dc, PickSupport pickCandidates)
          Draws the placemark's line.
protected  void drawOrderedRenderable(DrawContext dc)
          Draws the path as an ordered renderable.
protected  void drawPoint(DrawContext dc, PickSupport pickCandidates)
          Draws the placemark's line.
protected  void endDrawing(DrawContext dc)
          Pop the state set in beginDrawing.
 void export(String mimeType, Object output)
          Export the Placemark.
protected  void exportAsKML(Object output)
          Export the placemark to KML as a <Placemark> element.
protected  PointPlacemarkAttributes getActiveAttributes()
           
 int getAltitudeMode()
          Returns the placemark's altitude mode.
 PointPlacemarkAttributes getAttributes()
          Returns the attributes used when the placemark is drawn normally, not highlighted.
 Rectangle2D getBounds(DrawContext dc)
           
 PointPlacemarkAttributes getDefaultAttributes()
          Returns the attributes used if normal attributes are not specified.
 Object getDelegateOwner()
          Returns the delegate owner of this placemark.
 double getDistanceFromEye()
          Returns the ordered renderable's distance from the current view's eye point.
 PointPlacemarkAttributes getHighlightAttributes()
          Returns the attributes used to draw the placemark when it's highlighted.
protected  Rectangle2D getLabelBounds(DrawContext dc)
          Determines the screen coordinate boundaries of this placemark's label.
 String getLabelText()
          Returns the placemark's label text.
 int getLinePickWidth()
           
 Position getPosition()
          Returns the placemark's position.
 Position getReferencePosition()
          A position associated with the object that indicates its aggregate geographic position.
protected  WWTexture initializeTexture(String address)
          Load a texture.
protected  boolean intersectsFrustum(DrawContext dc)
          Determines whether the placemark image intersects the view frustum.
 boolean isApplyVerticalExaggeration()
           
 boolean isClipToHorizon()
          Indicates whether this placemark is shown if it is beyond the horizon.
protected  boolean isDrawLine(DrawContext dc)
          Determines whether the placemark's optional line should be drawn and whether it intersects the view frustum.
protected  boolean isDrawPoint(DrawContext dc)
          Indicates whether a point should be drawn when the active texture is null.
 boolean isEnableBatchPicking()
          Indicates whether batch picking is enabled.
 boolean isEnableBatchRendering()
          Indicates whether batch rendering is enabled.
 boolean isEnableDecluttering()
          Indicates whether this placemark participates in global text decluttering.
 String isExportFormatSupported(String format)
          Does this object support a certain export format?
 boolean isHighlighted()
          Indicates whether the placemark is drawn highlighted.
 boolean isLineEnabled()
          Indicates whether a line from the placemark point to the corresponding position on the terrain is drawn.
 boolean isVisible()
          Indicates whether the placemark is drawn when in view.
protected  void makeOrderedRenderable(DrawContext dc)
          If the scene controller is rendering ordered renderables, this method draws this placemark's image as an ordered renderable.
 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.
protected  boolean mustDrawLabel()
          Determines if the placemark label will be rendered.
 void pick(DrawContext dc, Point pickPoint)
          Executes a pick of the ordered renderable.
 void render(DrawContext dc)
          Causes this Renderable to render itself using the provided draw context.
 void setAltitudeMode(int altitudeMode)
          Specifies the placemark's altitude mode.
 void setApplyVerticalExaggeration(boolean applyVerticalExaggeration)
           
 void setAttributes(PointPlacemarkAttributes attrs)
          Specifies the attributes used when the placemark is drawn normally, not highlighted.
 void setClipToHorizon(boolean clipToHorizon)
          Specifies whether this placemark is shown if it is beyond the horizon.
 void setDelegateOwner(Object owner)
          Specifies the delegate owner of this placemark.
 void setEnableBatchPicking(boolean enableBatchPicking)
          Specifies whether adjacent PointPlacemarks in the ordered renderable list may be pick-tested together if they are contained in the same layer.
 void setEnableBatchRendering(boolean enableBatchRendering)
          Specifies whether adjacent PointPlacemarks in the ordered renderable list may be rendered together if they are contained in the same layer.
 void setEnableDecluttering(boolean enableDecluttering)
          Specifies whether this placemark participates in globe text decluttering.
 void setHighlightAttributes(PointPlacemarkAttributes attrs)
          Specifies the attributes used to draw the placemark when it's highlighted.
 void setHighlighted(boolean highlighted)
          Specfies whether the placemark is drawn highlighted.
 void setLabelText(String labelText)
          Specifies the placemark's label text that is displayed alongside the placemark.
protected  void setLineColor(DrawContext dc, PickSupport pickCandidates)
          Sets the color of the placemark's line during rendering.
 void setLineEnabled(boolean lineEnabled)
          Specifies whether a line from the placemark point to the corresponding position on the terrain is drawn.
 void setLinePickWidth(int linePickWidth)
           
protected  void setLineWidth(DrawContext dc)
          Sets the width of the placemark's line during rendering.
protected  void setPointSize(DrawContext dc)
          Sets the width of the placemark's point during rendering.
 void setPosition(Position position)
          Sets the placemark's position.
 void setVisible(boolean visible)
          Specifies whether the placemark is drawn when in view.
 
Methods inherited from class gov.nasa.worldwind.WWObjectImpl
onMessage, propertyChange
 
Methods inherited from class gov.nasa.worldwind.avlist.AVListImpl
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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface gov.nasa.worldwind.avlist.AVList
addPropertyChangeListener, addPropertyChangeListener, clearList, copy, firePropertyChange, firePropertyChange, getEntries, getStringValue, getValue, getValues, hasKey, removeKey, removePropertyChangeListener, removePropertyChangeListener, setValue, setValues
 

Field Detail

activeAttributes

protected PointPlacemarkAttributes activeAttributes

activeTexture

protected WWTexture activeTexture

altitudeMode

protected int altitudeMode

applyVerticalExaggeration

protected boolean applyVerticalExaggeration

boundsFont

protected Font boundsFont

clipToHorizon

protected boolean clipToHorizon

DEFAULT_HIGHLIGHT_SCALE

protected static final Double DEFAULT_HIGHLIGHT_SCALE
The scale to use when highlighting if no highlight attributes are specified.


DEFAULT_LABEL_OFFSET_IF_UNSPECIFIED

protected static final Offset DEFAULT_LABEL_OFFSET_IF_UNSPECIFIED
The label offset to use if none is specified but an image has been specified.


DEFAULT_POINT_SIZE

protected static final Double DEFAULT_POINT_SIZE
The point size to use when none is specified.


defaultAttributes

protected static final PointPlacemarkAttributes defaultAttributes
The attributes used if attributes are not specified.


delegateOwner

protected Object delegateOwner

dx

protected double dx

dy

protected double dy

enableBatchPicking

protected boolean enableBatchPicking

enableBatchRendering

protected boolean enableBatchRendering

enableDecluttering

protected boolean enableDecluttering

eyeDistance

protected double eyeDistance

frameNumber

protected long frameNumber

highlightAttrs

protected PointPlacemarkAttributes highlightAttrs

highlighted

protected boolean highlighted

labelBounds

protected Rectangle2D labelBounds

labelText

protected String labelText

lineEnabled

protected boolean lineEnabled

linePickWidth

protected int linePickWidth

normalAttrs

protected PointPlacemarkAttributes normalAttrs

pickLayer

protected Layer pickLayer

pickSupport

protected PickSupport pickSupport

placePoint

protected Vec4 placePoint

position

protected Position position

screenPoint

protected Vec4 screenPoint

terrainPoint

protected Vec4 terrainPoint

textures

protected Map<String,WWTexture> textures

visible

protected boolean visible
Constructor Detail

PointPlacemark

public PointPlacemark(Position position)
Construct a point placemark.

Parameters:
position - the placemark position.
Throws:
IllegalArgumentException - if the position is null.
Method Detail

beginDrawing

protected void beginDrawing(DrawContext dc)
Establish the OpenGL state needed to draw Paths.

Parameters:
dc - the current draw context.

chooseTexture

protected WWTexture chooseTexture(PointPlacemarkAttributes attrs)
Determines the appropriate texture for the current availability.

Parameters:
attrs - the attributes specifying the placemark image and properties.
Returns:
the appropriate texture, or null if an image is not available.

computeImageOffset

protected void computeImageOffset(DrawContext dc)

computeImageRectangle

protected Rectangle computeImageRectangle(DrawContext dc)
Computes the screen-space rectangle bounding the placemark image.

Parameters:
dc - the current draw context.
Returns:
the bounding rectangle.

computePlacemarkPoints

protected void computePlacemarkPoints(DrawContext dc)
Computes and stores the placemark's Cartesian location, the Cartesian location of the corresponding point on the terrain (if the altitude mode requires it), and the screen-space projection of the placemark's point. Applies the placemark's altitude mode when computing the points.

Parameters:
dc - the current draw context.

createPickedObject

protected PickedObject createPickedObject(DrawContext dc,
                                          Color pickColor)
Create a PickedObject for this placemark. The PickedObject returned by this method will be added to the pick list to represent the current placemark.

Parameters:
dc - Active draw context.
pickColor - Unique color for this PickedObject.
Returns:
A new picked object.

determineActiveAttributes

protected void determineActiveAttributes()
Determines which attributes -- normal, highlight or default -- to use each frame.


doDrawOrderedRenderable

protected void doDrawOrderedRenderable(DrawContext dc,
                                       PickSupport pickCandidates)
Draw this placemark as an ordered renderable. If in picking mode, add it to the picked object list of specified PickSupport. The PickSupport may not be the one associated with this instance. During batch picking the PickSupport of the instance initiating the batch picking is used so that all shapes rendered in batch are added to the same pick list.

Parameters:
dc - the current draw context.
pickCandidates - a pick support holding the picked object list to add this shape to.

drawBatched

protected void drawBatched(DrawContext dc)
Draws this ordered renderable and all subsequent PointPlacemark ordered renderables in the ordered renderable list.

Parameters:
dc - the current draw context.

drawLabel

protected void drawLabel(DrawContext dc)
Draws the placemark's label if a label is specified.

Parameters:
dc - the current draw context.

drawLine

protected void drawLine(DrawContext dc,
                        PickSupport pickCandidates)
Draws the placemark's line.

Parameters:
dc - the current draw context.
pickCandidates - the pick support object to use when adding this as a pick candidate.

drawOrderedRenderable

protected void drawOrderedRenderable(DrawContext dc)
Draws the path as an ordered renderable.

Parameters:
dc - the current draw context.

drawPoint

protected void drawPoint(DrawContext dc,
                         PickSupport pickCandidates)
Draws the placemark's line.

Parameters:
dc - the current draw context.
pickCandidates - the pick support object to use when adding this as a pick candidate.

endDrawing

protected void endDrawing(DrawContext dc)
Pop the state set in beginDrawing.

Parameters:
dc - the current draw context.

export

public void export(String mimeType,
                   Object output)
            throws IOException
Export the Placemark. The 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
 

Specified by:
export in interface Exportable
Parameters:
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).
Throws:
IOException - If an exception occurs writing to the output object.
See Also:
Exportable.isExportFormatSupported(String)

exportAsKML

protected void exportAsKML(Object output)
                    throws IOException,
                           XMLStreamException
Export the placemark to KML as a <Placemark> element. The output object will receive the data. This object must be one of: java.io.Writer java.io.OutputStream javax.xml.stream.XMLStreamWriter

Parameters:
output - Object to receive the generated KML.
Throws:
XMLStreamException - If an exception occurs while writing the KML
IOException - if an exception occurs while exporting the data.
See Also:
export(String, Object)

getActiveAttributes

protected PointPlacemarkAttributes getActiveAttributes()

getAltitudeMode

public int getAltitudeMode()
Returns the placemark's altitude mode. See setAltitudeMode(int) for a description of the modes.

Returns:
the placemark's altitude mode.

getAttributes

public PointPlacemarkAttributes getAttributes()
Returns the attributes used when the placemark is drawn normally, not highlighted.

Returns:
the attributes used in normal mode. May be null to indicate use of default attributes.

getBounds

public Rectangle2D getBounds(DrawContext dc)
Specified by:
getBounds in interface Declutterable

getDefaultAttributes

public PointPlacemarkAttributes getDefaultAttributes()
Returns the attributes used if normal attributes are not specified.

Returns:
the default attributes.

getDelegateOwner

public Object getDelegateOwner()
Returns the delegate owner of this placemark. If non-null, the returned object replaces the placemark as the pickable object returned during picking. If null, the placemark itself is the pickable object returned during picking.

Returns:
the object used as the pickable object returned during picking, or null to indicate the the placemark is returned during picking.

getDistanceFromEye

public double getDistanceFromEye()
Returns the ordered renderable's distance from the current view's eye point. Intended to be used only to sort a list of ordered renderables according to eye distance, and only during frame generation when a view is active. *

Specified by:
getDistanceFromEye in interface OrderedRenderable
Returns:
the distance of the ordered renderable from the current view's eye point.

getHighlightAttributes

public PointPlacemarkAttributes getHighlightAttributes()
Returns the attributes used to draw the placemark when it's highlighted.

Returns:
the attributes used in normal mode. May be null to indicate use of the normal attributes.

getLabelBounds

protected Rectangle2D getLabelBounds(DrawContext dc)
Determines the screen coordinate boundaries of this placemark's label.

Parameters:
dc - the current draw context.
Returns:
the label bounds, in lower-left origin screen coordinates.

getLabelText

public String getLabelText()
Returns the placemark's label text.

Returns:
the placemark's label next, which man be null.

getLinePickWidth

public int getLinePickWidth()

getPosition

public Position getPosition()
Returns the placemark's position.

Specified by:
getPosition in interface Locatable
Returns:
the placemark's position.

getReferencePosition

public Position getReferencePosition()
A position associated with the object that indicates its aggregate geographic position. The chosen position varies among implementers of this interface. For objects defined by a list of positions, the reference position is typically the first position in the list. For symmetric objects the reference position is often the center of the object. In many cases the object's reference position may be explicitly specified by the application.

Specified by:
getReferencePosition in interface Movable
Returns:
the object's reference position, or null if no reference position is available.

initializeTexture

protected WWTexture initializeTexture(String address)
Load a texture. If the texture source is not available locally, this method requests the texture source and returns null.

Parameters:
address - Path or URL to the image to load into a texture.
Returns:
The new texture, or null if the texture could not be created because the resource is not yet available locally.

intersectsFrustum

protected boolean intersectsFrustum(DrawContext dc)
Determines whether the placemark image intersects the view frustum.

Parameters:
dc - the current draw context.
Returns:
true if the image intersects the frustum, otherwise false.

isApplyVerticalExaggeration

public boolean isApplyVerticalExaggeration()

isClipToHorizon

public boolean isClipToHorizon()
Indicates whether this placemark is shown if it is beyond the horizon.

Returns:
the value of the clip-to-horizon flag. true if horizon clipping is enabled, otherwise false. The default value is true.

isDrawLine

protected boolean isDrawLine(DrawContext dc)
Determines whether the placemark's optional line should be drawn and whether it intersects the view frustum.

Parameters:
dc - the current draw context.
Returns:
true if the line should be drawn and it intersects the view frustum, otherwise false.

isDrawPoint

protected boolean isDrawPoint(DrawContext dc)
Indicates whether a point should be drawn when the active texture is null.

Parameters:
dc - the current draw context.
Returns:
true if a point should be drawn, otherwise false.

isEnableBatchPicking

public boolean isEnableBatchPicking()
Indicates whether batch picking is enabled.

Returns:
true if batch rendering is enabled, otherwise false.
See Also:
setEnableBatchPicking(boolean).

isEnableBatchRendering

public boolean isEnableBatchRendering()
Indicates whether batch rendering is enabled.

Returns:
true if batch rendering is enabled, otherwise false.
See Also:
setEnableBatchRendering(boolean).

isEnableDecluttering

public boolean isEnableDecluttering()
Indicates whether this placemark participates in global text decluttering.

Specified by:
isEnableDecluttering in interface Declutterable
Returns:
true if this placemark participates in global text decluttering, otherwise false. The default value is false. Only the placemark's label is considered during decluttering.

isExportFormatSupported

public String isExportFormatSupported(String format)
Does this object support a certain export format?

Specified by:
isExportFormatSupported in interface Exportable
Parameters:
format - Desired export format.
Returns:
One of Exportable.FORMAT_SUPPORTED, Exportable.FORMAT_NOT_SUPPORTED, or Exportable.FORMAT_PARTIALLY_SUPPORTED.
See Also:
Exportable.export(String, Object)

isHighlighted

public boolean isHighlighted()
Indicates whether the placemark is drawn highlighted.

Specified by:
isHighlighted in interface Highlightable
Returns:
true if the placemark is drawn highlighted, otherwise false.

isLineEnabled

public boolean isLineEnabled()
Indicates whether a line from the placemark point to the corresponding position on the terrain is drawn.

Returns:
true if the line is drawn, otherwise false.

isVisible

public boolean isVisible()
Indicates whether the placemark is drawn when in view.

Returns:
true if the placemark is drawn when in view, otherwise false.

makeOrderedRenderable

protected void makeOrderedRenderable(DrawContext dc)
If the scene controller is rendering ordered renderables, this method draws this placemark's image as an ordered renderable. Otherwise the method determines whether this instance should be added to the ordered renderable list.

The Cartesian and screen points of the placemark are computed during the first call per frame and re-used in subsequent calls of that frame.

Parameters:
dc - the current draw context.

move

public void move(Position delta)
Shift the shape over the globe's surface while maintaining its original azimuth, its orientation relative to North.

Specified by:
move in interface Movable
Parameters:
delta - the latitude and longitude to add to the shape's reference position.

moveTo

public void moveTo(Position position)
Move the shape over the globe's surface while maintaining its original azimuth, its orientation relative to North.

Specified by:
moveTo in interface Movable
Parameters:
position - the new position of the shape's reference position.

mustDrawLabel

protected boolean mustDrawLabel()
Determines if the placemark label will be rendered.

Returns:
True if the label must be drawn.

pick

public void pick(DrawContext dc,
                 Point pickPoint)
Description copied from interface: OrderedRenderable
Executes a pick of the ordered renderable.

Specified by:
pick in interface OrderedRenderable
Parameters:
dc - the current draw context.
pickPoint - the pick point.

render

public void render(DrawContext dc)
Description copied from interface: Renderable
Causes this Renderable to render itself using the provided draw context.

Specified by:
render in interface Renderable
Parameters:
dc - the DrawContext to be used
See Also:
DrawContext

setAltitudeMode

public void setAltitudeMode(int altitudeMode)
Specifies the placemark's altitude mode. Recognized modes are:

Parameters:
altitudeMode - the altitude mode

setApplyVerticalExaggeration

public void setApplyVerticalExaggeration(boolean applyVerticalExaggeration)

setAttributes

public void setAttributes(PointPlacemarkAttributes attrs)
Specifies the attributes used when the placemark is drawn normally, not highlighted.

Parameters:
attrs - the attributes to use in normal mode. May be null to indicate use of default attributes.

setClipToHorizon

public void setClipToHorizon(boolean clipToHorizon)
Specifies whether this placemark is shown if it is beyond the horizon.

Parameters:
clipToHorizon - true if this placemark should not be shown when beyond the horizon, otherwise false.

setDelegateOwner

public void setDelegateOwner(Object owner)
Specifies the delegate owner of this placemark. If non-null, the delegate owner replaces the placemark as the pickable object returned during picking. If null, the placemark itself is the pickable object returned during picking.

Parameters:
owner - the object to use as the pickable object returned during picking, or null to return the placemark.

setEnableBatchPicking

public void setEnableBatchPicking(boolean enableBatchPicking)
Specifies whether adjacent PointPlacemarks in the ordered renderable list may be pick-tested together if they are contained in the same layer. This increases performance but allows only the top-most of the placemarks to be reported in a SelectEvent even if several of the placemarks are at the pick position.

Batch rendering (setEnableBatchRendering(boolean)) must be enabled in order for batch picking to occur.

Parameters:
enableBatchPicking - true to enable batch rendering, otherwise false.

setEnableBatchRendering

public void setEnableBatchRendering(boolean enableBatchRendering)
Specifies whether adjacent PointPlacemarks in the ordered renderable list may be rendered together if they are contained in the same layer. This increases performance and there is seldom a reason to disable it.

Parameters:
enableBatchRendering - true to enable batch rendering, otherwise false.

setEnableDecluttering

public void setEnableDecluttering(boolean enableDecluttering)
Specifies whether this placemark participates in globe text decluttering.

Parameters:
enableDecluttering - true if the placemark participates in global text decluttering, otherwise false. The default value is false. Only the placemark lable is considered during decluttering.

setHighlightAttributes

public void setHighlightAttributes(PointPlacemarkAttributes attrs)
Specifies the attributes used to draw the placemark when it's highlighted.

Parameters:
attrs - the attributes to use in normal mode. May be null to indicate use of the normal attributes.

setHighlighted

public void setHighlighted(boolean highlighted)
Specfies whether the placemark is drawn highlighted.

Specified by:
setHighlighted in interface Highlightable
Parameters:
highlighted - true if the placemark is drawn highlighted, otherwise false.

setLabelText

public void setLabelText(String labelText)
Specifies the placemark's label text that is displayed alongside the placemark.

Parameters:
labelText - the placemark label text. If null, no label is displayed.

setLineColor

protected void setLineColor(DrawContext dc,
                            PickSupport pickCandidates)
Sets the color of the placemark's line during rendering.

Parameters:
dc - the current draw context.
pickCandidates - the pick support object to use when adding this as a pick candidate.

setLineEnabled

public void setLineEnabled(boolean lineEnabled)
Specifies whether a line from the placemark point to the corresponding position on the terrain is drawn.

Parameters:
lineEnabled - true if the line is drawn, otherwise false.

setLinePickWidth

public void setLinePickWidth(int linePickWidth)

setLineWidth

protected void setLineWidth(DrawContext dc)
Sets the width of the placemark's line during rendering.

Parameters:
dc - the current draw context.

setPointSize

protected void setPointSize(DrawContext dc)
Sets the width of the placemark's point during rendering.

Parameters:
dc - the current draw context.

setPosition

public void setPosition(Position position)
Sets the placemark's position.

Parameters:
position - the placemark position.
Throws:
IllegalArgumentException - if the position is null.

setVisible

public void setVisible(boolean visible)
Specifies whether the placemark is drawn when in view.

Parameters:
visible - true if the placemark is drawn when in view, otherwise false.

NASA World Wind