Package gov.nasa.worldwind.shape
Class PlacemarkAttributes
- java.lang.Object
-
- gov.nasa.worldwind.shape.PlacemarkAttributes
-
public class PlacemarkAttributes extends java.lang.Object
Holds attributes applied toPlacemark
shapes.
-
-
Constructor Summary
Constructors Constructor Description PlacemarkAttributes()
Constructs a placemark attributes bundle.PlacemarkAttributes(PlacemarkAttributes attributes)
Constructs a placemark attribute bundle from the specified attributes.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static PlacemarkAttributes
createWithImage(ImageSource imageSource)
static PlacemarkAttributes
createWithImageAndLeader(ImageSource imageSource)
boolean
equals(java.lang.Object o)
Color
getImageColor()
Returns the image color.Offset
getImageOffset()
Returns the location within the placemark's image to align with the placemark's geographic position.double
getImageScale()
Returns the amount to scale the placemark's image.ImageSource
getImageSource()
Returns the source of the placemark's image.TextAttributes
getLabelAttributes()
Returns the attributes to apply to the placemark's label, if any.ShapeAttributes
getLeaderAttributes()
Returns the attributes to apply to the leader line if it's drawn.double
getMinimumImageScale()
Returns the minimum amount to scale the placemark's image.int
hashCode()
boolean
isDepthTest()
Returns whether the placemark should be depth-tested against other objects in the scene.boolean
isDrawLeader()
Returns whether to draw a line from the placemark's geographic position to the ground.PlacemarkAttributes
set(PlacemarkAttributes attributes)
PlacemarkAttributes
setDepthTest(boolean depthTest)
Sets whether the placemark should be depth-tested against other objects in the scene.PlacemarkAttributes
setDrawLeader(boolean drawLeader)
Sets whether to draw a line from the placemark's geographic position to the ground.PlacemarkAttributes
setImageColor(Color imageColor)
Sets the image color.PlacemarkAttributes
setImageOffset(Offset imageOffset)
Sets the location within the placemark's image to align with the placemark's geographic position.PlacemarkAttributes
setImageScale(double imageScale)
Sets the amount to scale the placemark's image.PlacemarkAttributes
setImageSource(ImageSource imageSource)
PlacemarkAttributes
setLabelAttributes(TextAttributes labelAttributes)
Sets the attributes to apply to the placemark's label, if any.PlacemarkAttributes
setLeaderAttributes(ShapeAttributes leaderAttributes)
Sets the attributes to apply to the leader line if it's drawn.PlacemarkAttributes
setMinimumImageScale(double minimumImageScale)
Sets the minimum amount to scale the placemark's image whenPlacemark.isEyeDistanceScaling()
is true.
-
-
-
Constructor Detail
-
PlacemarkAttributes
public PlacemarkAttributes()
Constructs a placemark attributes bundle. The defaults indicate a placemark displayed as a white 1x1 pixel square centered on the placemark's geographic position.
-
PlacemarkAttributes
public PlacemarkAttributes(PlacemarkAttributes attributes)
Constructs a placemark attribute bundle from the specified attributes. Performs a deep copy of the color, offset, label attributes and leader-line attributes.- Parameters:
attributes
- The attributes to be copied.- Throws:
java.lang.IllegalArgumentException
- If the location is null
-
-
Method Detail
-
set
public PlacemarkAttributes set(PlacemarkAttributes attributes)
-
createWithImage
public static PlacemarkAttributes createWithImage(ImageSource imageSource)
-
createWithImageAndLeader
public static PlacemarkAttributes createWithImageAndLeader(ImageSource imageSource)
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
getImageSource
public ImageSource getImageSource()
Returns the source of the placemark's image. If null, the placemark is drawn as a square whose width and height are the value of this attribute object's [imageScale]getImageScale()
property.
-
setImageSource
public PlacemarkAttributes setImageSource(ImageSource imageSource)
-
getImageColor
public Color getImageColor()
Returns the image color. When this attribute bundle has a valid image path the placemark's image is composed with this image color to achieve the final placemark color. Otherwise the placemark is drawn in this color. The color white, the default, causes the image to be drawn in its native colors.
-
setImageColor
public PlacemarkAttributes setImageColor(Color imageColor)
Sets the image color. When this attribute bundle has a valid image path the placemark's image is composed with this image color to achieve the final placemark color. Otherwise the placemark is drawn in this color. The color white, the default, causes the image to be drawn in its native colors.- Parameters:
imageColor
- The new image color
-
getImageOffset
public Offset getImageOffset()
Returns the location within the placemark's image to align with the placemark's geographic position. The default value centers the image at the geographic position.
-
setImageOffset
public PlacemarkAttributes setImageOffset(Offset imageOffset)
Sets the location within the placemark's image to align with the placemark's geographic position.- Parameters:
imageOffset
- The new location used to align the placemark's image.
-
getImageScale
public double getImageScale()
Returns the amount to scale the placemark's image. When this attribute bundle has a valid image path the scale is applied to the image's dimensions. Otherwise the scale indicates the dimensions in pixels of a square drawn at the placemark's geographic position. A scale of 0 causes the placemark to disappear; however, the placemark's label, if any, is still drawn.
-
setImageScale
public PlacemarkAttributes setImageScale(double imageScale)
Sets the amount to scale the placemark's image. When this attribute bundle has a valid image path the scale is applied to the image's dimensions. Otherwise the scale indicates the dimensions in pixels of a square drawn at the placemark's geographic position. A scale of 0 causes the placemark to disappear; however, the placemark's label, if any, is still drawn.- Parameters:
imageScale
- The new image scale value.
-
getMinimumImageScale
public double getMinimumImageScale()
Returns the minimum amount to scale the placemark's image. When aPlacemark.isEyeDistanceScaling()
is true, this value controls the minimum size of the rendered placemark. A value of 0 allows the placemark to disappear.
-
setMinimumImageScale
public PlacemarkAttributes setMinimumImageScale(double minimumImageScale)
Sets the minimum amount to scale the placemark's image whenPlacemark.isEyeDistanceScaling()
is true. This value controls the minimum size of the rendered placemark. A value of 0 allows the placemark to disappear.- Parameters:
minimumImageScale
- The new image scale value.
-
isDrawLeader
public boolean isDrawLeader()
Returns whether to draw a line from the placemark's geographic position to the ground.
-
setDrawLeader
public PlacemarkAttributes setDrawLeader(boolean drawLeader)
Sets whether to draw a line from the placemark's geographic position to the ground.- Parameters:
drawLeader
- The new draw leader-line setting.
-
isDepthTest
public boolean isDepthTest()
Returns whether the placemark should be depth-tested against other objects in the scene. If true, the placemark may be occluded by terrain and other objects in certain viewing situations. If false, the placemark will not be occluded by terrain and other objects. If this value is true, the placemark's label, if any, has an independent depth-test control.
-
setDepthTest
public PlacemarkAttributes setDepthTest(boolean depthTest)
Sets whether the placemark should be depth-tested against other objects in the scene. If true, the placemark may be occluded by terrain and other objects in certain viewing situations. If false, the placemark will not be occluded by terrain and other objects. If this value is true, the placemark's label, if any, has an independent depth-test control.- Parameters:
depthTest
- The new depth test setting.
-
getLabelAttributes
public TextAttributes getLabelAttributes()
Returns the attributes to apply to the placemark's label, if any. If null, the placemark's label is not drawn.
-
setLabelAttributes
public PlacemarkAttributes setLabelAttributes(TextAttributes labelAttributes)
Sets the attributes to apply to the placemark's label, if any. If null, the placemark's label is not drawn.- Parameters:
labelAttributes
- The new label attributes for the placemark. May be null.
-
getLeaderAttributes
public ShapeAttributes getLeaderAttributes()
Returns the attributes to apply to the leader line if it's drawn. If null, the placemark's leader line is not drawn.
-
setLeaderAttributes
public PlacemarkAttributes setLeaderAttributes(ShapeAttributes leaderAttributes)
Sets the attributes to apply to the leader line if it's drawn. If null, the placemark's leader line is not drawn.- Parameters:
leaderAttributes
- The new leader-line attributes. May be null.
-
-