NASA World Wind

gov.nasa.worldwind.render
Class PointPlacemarkAttributes

java.lang.Object
  extended by gov.nasa.worldwind.render.PointPlacemarkAttributes
All Implemented Interfaces:
Exportable

public class PointPlacemarkAttributes
extends Object
implements Exportable

Holds attributes for PointPlacemarks.


Field Summary
protected  int antiAliasHint
           
protected static Color DEFAULT_IMAGE_COLOR
          The default image color.
static Offset DEFAULT_IMAGE_OFFSET
          The image offset to use if none specified.
static String DEFAULT_IMAGE_PATH
          The image file to use for the placemark's icon if no image file is specified in the placemark attributes.
static Double DEFAULT_IMAGE_SCALE
          The image scale to use if none specified.
protected static Color DEFAULT_LABEL_COLOR
          The default label color.
static Font DEFAULT_LABEL_FONT
          The default font to use for the placemark's label.
static Offset DEFAULT_LABEL_OFFSET
          The default label offset.
static Double DEFAULT_LABEL_SCALE
          The label scale to use if none specified.
protected static Color DEFAULT_LINE_COLOR
          The default line color.
protected  Double heading
           
protected  String headingReference
           
protected  String imageAddress
           
protected  Color imageColor
          Color to be blended with the image.
protected  Offset imageOffset
           
protected  Font labelFont
           
protected  Material labelMaterial
           
protected  Offset labelOffset
           
protected  Double labelScale
           
protected  Material lineMaterial
           
protected  Double lineWidth
           
protected  Double pitch
           
protected  Double scale
           
protected  boolean unresolved
           
protected  boolean usePointAsDefaultImage
           
 
Fields inherited from interface gov.nasa.worldwind.Exportable
FORMAT_NOT_SUPPORTED, FORMAT_PARTIALLY_SUPPORTED, FORMAT_SUPPORTED
 
Constructor Summary
PointPlacemarkAttributes()
          Constructs an instance with default values for image address, image offset, image scale, label offset, label font and label color.
PointPlacemarkAttributes(PointPlacemarkAttributes attrs)
          Constructs an instance and initializes it to the values in a specified instance.
 
Method Summary
 void copy(PointPlacemarkAttributes attrs)
          Copies all values, including null values, from another instance to this one.
 void export(String mimeType, Object output)
          Export the Placemark.
protected  void exportAsKML(Object output)
          Export the placemark attributes to KML as a <Style> element.
 int getAntiAliasHint()
          Returns the anti-alias hint.
 Double getHeading()
          Returns the placemark image heading.
 String getHeadingReference()
          Indicates the heading reference.
 String getImageAddress()
          Returns the address of the placemark's image.
 Color getImageColor()
          Sets the image color.
 Offset getImageOffset()
          Returns the image offset.
 Color getLabelColor()
          Returns the label diffuse component of the label's material color.
 Font getLabelFont()
           
 Material getLabelMaterial()
          Returns the label material.
 Offset getLabelOffset()
          Returns the label offset.
 Double getLabelScale()
          Returns the placemark's label scale.
 Color getLineColor()
          Returns the label diffuse component of the label's material color.
 Material getLineMaterial()
          Returns the line color.
 Double getLineWidth()
          Returns this instance's line width.
 Double getPitch()
          Indicates the placemark image pitch.
 Double getScale()
          Returns the placemark image scale.
 String isExportFormatSupported(String format)
          Does this object support a certain export format?
 boolean isUnresolved()
          Indicates whether one or more members of this remain unresolved because they must be retrieved from an external source.
 boolean isUsePointAsDefaultImage()
          Indicates whether to draw a point when the current source image is null.
 void setAntiAliasHint(int antiAliasHint)
          Specifies whether and how line anti-aliasing is performed.
 void setHeading(Double heading)
          Specifies the placemark image heading, which is used by some placemark implementations to orient the placemark image.
 void setHeadingReference(String headingReference)
          Specifies the heading reference.
 void setImageAddress(String address)
          Specifies the address of the placemark's image.
 void setImageColor(Color imageColor)
          Sets the image color.
 void setImageOffset(Offset offset)
          Specifies a location within the placemark image to align with the placemark point.
 void setLabelColor(String labelColorString)
          Sets the label color as a string in the form 0xAABBGGRR.
 void setLabelFont(Font labelFont)
           
 void setLabelMaterial(Material color)
          Sets the label material.
 void setLabelOffset(Offset offset)
          Specifies a location relative to the placemark's image at which to align the label.
 void setLabelScale(Double scale)
          Specifies the placemark label scale.
 void setLineColor(String lineColorString)
          Sets the line color as a string in the form 0xAABBGGRR.
 void setLineMaterial(Material lineColor)
          Sets the line color.
 void setLineWidth(Double lineWidth)
          Specifies the line width to use when rendering the optional placemark line.
 void setPitch(Double pitch)
          Specifies the placemark image pitch.
 void setScale(Double scale)
          Specifies the placemark image scale.
 void setUnresolved(boolean unresolved)
          Specifies whether one or more fields of this remain unresolved because they must be retrieved from an external source.
 void setUsePointAsDefaultImage(boolean usePointAsDefaultImage)
          Specifies whether to draw a point when the current source image is null.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

antiAliasHint

protected int antiAliasHint

DEFAULT_IMAGE_COLOR

protected static final Color DEFAULT_IMAGE_COLOR
The default image color.


DEFAULT_IMAGE_OFFSET

public static final Offset DEFAULT_IMAGE_OFFSET
The image offset to use if none specified. This value is that required by the default image.


DEFAULT_IMAGE_PATH

public static final String DEFAULT_IMAGE_PATH
The image file to use for the placemark's icon if no image file is specified in the placemark attributes.


DEFAULT_IMAGE_SCALE

public static final Double DEFAULT_IMAGE_SCALE
The image scale to use if none specified. This value is appropriate for the default image.


DEFAULT_LABEL_COLOR

protected static final Color DEFAULT_LABEL_COLOR
The default label color.


DEFAULT_LABEL_FONT

public static final Font DEFAULT_LABEL_FONT
The default font to use for the placemark's label.


DEFAULT_LABEL_OFFSET

public static final Offset DEFAULT_LABEL_OFFSET
The default label offset. This value is appropriate for the default image.


DEFAULT_LABEL_SCALE

public static final Double DEFAULT_LABEL_SCALE
The label scale to use if none specified.


DEFAULT_LINE_COLOR

protected static final Color DEFAULT_LINE_COLOR
The default line color.


heading

protected Double heading

headingReference

protected String headingReference

imageAddress

protected String imageAddress

imageColor

protected Color imageColor
Color to be blended with the image. This can be used to render the same image in different colors for different placemarks.


imageOffset

protected Offset imageOffset

labelFont

protected Font labelFont

labelMaterial

protected Material labelMaterial

labelOffset

protected Offset labelOffset

labelScale

protected Double labelScale

lineMaterial

protected Material lineMaterial

lineWidth

protected Double lineWidth

pitch

protected Double pitch

scale

protected Double scale

unresolved

protected boolean unresolved

usePointAsDefaultImage

protected boolean usePointAsDefaultImage
Constructor Detail

PointPlacemarkAttributes

public PointPlacemarkAttributes()
Constructs an instance with default values for image address, image offset, image scale, label offset, label font and label color.


PointPlacemarkAttributes

public PointPlacemarkAttributes(PointPlacemarkAttributes attrs)
Constructs an instance and initializes it to the values in a specified instance.

Parameters:
attrs - the instance from which to copy the initial attribute values of this. May be null.
Method Detail

copy

public void copy(PointPlacemarkAttributes attrs)
Copies all values, including null values, from another instance to this one.

Parameters:
attrs - the instance to copy values from.

export

public void export(String mimeType,
                   Object output)
            throws IOException,
                   UnsupportedOperationException
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.
UnsupportedOperationException - if the format is not supported by this object, or if the output argument is not of a supported type.
See Also:
Exportable.isExportFormatSupported(String)

exportAsKML

protected void exportAsKML(Object output)
                    throws XMLStreamException
Export the placemark attributes to KML as a <Style> 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
See Also:
export(String, Object)

getAntiAliasHint

public int getAntiAliasHint()
Returns the anti-alias hint. See setAntiAliasHint(int) for the recognized values.

Returns:
the anti-alias hint.

getHeading

public Double getHeading()
Returns the placemark image heading.

Returns:
the placemark image heading.

getHeadingReference

public String getHeadingReference()
Indicates the heading reference.

Returns:
the heading reference.
See Also:
setHeadingReference(String).

getImageAddress

public String getImageAddress()
Returns the address of the placemark's image.

Returns:
the address of the placemark's image. May be null.

getImageColor

public Color getImageColor()
Sets the image color. The image color is blended with the image, allowing the same image to be rendered in different colors for different placemarks.

Returns:
The image color.
See Also:
setImageColor(java.awt.Color)

getImageOffset

public Offset getImageOffset()
Returns the image offset.

Returns:
the image offset.

getLabelColor

public Color getLabelColor()
Returns the label diffuse component of the label's material color.

Returns:
the label's diffuse color.

getLabelFont

public Font getLabelFont()

getLabelMaterial

public Material getLabelMaterial()
Returns the label material.

Returns:
the label material.

getLabelOffset

public Offset getLabelOffset()
Returns the label offset.

Returns:
the label offset.

getLabelScale

public Double getLabelScale()
Returns the placemark's label scale. See [@link #setLabelScale} for its description.

Returns:
the placemark label scale.

getLineColor

public Color getLineColor()
Returns the label diffuse component of the label's material color.

Returns:
the label's diffuse color.

getLineMaterial

public Material getLineMaterial()
Returns the line color.

Returns:
the line color.

getLineWidth

public Double getLineWidth()
Returns this instance's line width.

Returns:
the line width.

getPitch

public Double getPitch()
Indicates the placemark image pitch.

Returns:
the placemark image pitch.

getScale

public Double getScale()
Returns the placemark image scale. See [@link #setScale} for its description.

Returns:
the placemark image scale.

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)

isUnresolved

public boolean isUnresolved()
Indicates whether one or more members of this remain unresolved because they must be retrieved from an external source.

Returns:
true if there are unresolved fields, false if no fields remain unresolved.

isUsePointAsDefaultImage

public boolean isUsePointAsDefaultImage()
Indicates whether to draw a point when the current source image is null.

Returns:
true if a point is drawn when the current source image is null, otherwise false.
See Also:
setUsePointAsDefaultImage(boolean)

setAntiAliasHint

public void setAntiAliasHint(int antiAliasHint)
Specifies whether and how line anti-aliasing is performed. Recognized values are GL.GL_NEAREST, GL.GL_FASTEST, and GL.GL_NICEST.

Parameters:
antiAliasHint - the anti-alias hint.

setHeading

public void setHeading(Double heading)
Specifies the placemark image heading, which is used by some placemark implementations to orient the placemark image.

Parameters:
heading - the placemark heading in degrees clockwise from North. May be null, in which case no heading is applied during rendering.

setHeadingReference

public void setHeadingReference(String headingReference)
Specifies the heading reference. If AVKey.RELATIVE_TO_SCREEN, the heading is interpreted as relative to the screen and the placemark icon maintains the heading relative to the screen's vertical edges. If AVKey.RELATIVE_TO_GLOBE, the heading is interpreted relative to the globe and the placemark icon maintains the heading relative to the globe's north direction.

The default heading reference is null, which PointPlacemark interprets as AVKey.RELATIVE_TO_SCREEN.

Parameters:
headingReference - the heading reference. See the description for possible values.

setImageAddress

public void setImageAddress(String address)
Specifies the address of the placemark's image. The address may be a file path or a URL.

Parameters:
address - the address of the placemark's image. May be null, in which case a default image is used.

setImageColor

public void setImageColor(Color imageColor)
Sets the image color. The image color is blended with the image, allowing the same image to be rendered in different colors for different placemarks.

Parameters:
imageColor - New image color.
See Also:
getImageColor()

setImageOffset

public void setImageOffset(Offset offset)
Specifies a location within the placemark image to align with the placemark point.

Parameters:
offset - the hot spot controlling the image's placement relative to the placemark point. May be null to indicate that the image's lower left corner is aligned with the placemark point.

setLabelColor

public void setLabelColor(String labelColorString)
Sets the label color as a string in the form 0xAABBGGRR.

Parameters:
labelColorString - the line color. May be null.

setLabelFont

public void setLabelFont(Font labelFont)

setLabelMaterial

public void setLabelMaterial(Material color)
Sets the label material.

Parameters:
color - the line material. May be null.

setLabelOffset

public void setLabelOffset(Offset offset)
Specifies a location relative to the placemark's image at which to align the label. The label text begins at the point indicated by the offset. A offset of (0, 0) pixels causes the text to start at the lower left corner of the image. An offset of (1, 1) in fraction units causes the text to start at the upper right corner of the image. The text would also start there if the offset is in units of pixels and the X and Y values are the image width and height, respectively.

If no offset is specified, the label is placed at the right edge of the image with the top of the text at about the same level as the top of the image. (An offset of (X = 1.0, Y = 0.6, both in fraction units.)

Parameters:
offset - the hot spot controlling the image's placement relative to the placemark point. May be null to indicate the default label offset.

setLabelScale

public void setLabelScale(Double scale)
Specifies the placemark label scale. The scale is applied to the placemark label's size after the base size is determined by the font.

Parameters:
scale - the placemark image scale. May be null, in which case no scaling is applied.

setLineColor

public void setLineColor(String lineColorString)
Sets the line color as a string in the form 0xAABBGGRR.

Parameters:
lineColorString - the line color. May be null.

setLineMaterial

public void setLineMaterial(Material lineColor)
Sets the line color.

Parameters:
lineColor - the line color. May be null.

setLineWidth

public void setLineWidth(Double lineWidth)
Specifies the line width to use when rendering the optional placemark line.

Parameters:
lineWidth - the line width. May be null, in which case a width of 1 is used during rendering.

setPitch

public void setPitch(Double pitch)
Specifies the placemark image pitch.

Parameters:
pitch - the placemark pitch in degrees. May be null, in which case no pitch is applied during rendering.

setScale

public void setScale(Double scale)
Specifies the placemark image scale. The scale is applied to the placemark image's width and height during rendering in order to control the rendered size of the image.

Parameters:
scale - the placemark image scale. May be null, in which case no scaling is applied.

setUnresolved

public void setUnresolved(boolean unresolved)
Specifies whether one or more fields of this remain unresolved because they must be retrieved from an external source.

Parameters:
unresolved - true if there are unresolved fields, false if no fields remain unresolved.

setUsePointAsDefaultImage

public void setUsePointAsDefaultImage(boolean usePointAsDefaultImage)
Specifies whether to draw a point when the current source image is null. When drawing the point, the scale of the currently active attributes specifies the diameter of the point in pixels. The point is drawn in the line color of the currently active attributes.

Parameters:
usePointAsDefaultImage - true to draw a point when the current source image is null, otherwise false.
See Also:
isUsePointAsDefaultImage()

NASA World Wind