|
NASA World Wind | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectgov.nasa.worldwind.avlist.AVListImpl
gov.nasa.worldwind.WWObjectImpl
gov.nasa.worldwind.layers.AbstractLayer
gov.nasa.worldwind.layers.AnnotationLayer
public class AnnotationLayer
The AnnotationLayer
class manages a collection of Annotation
objects
for rendering and picking. AnnotationLayer
delegates to its internal
AnnotationRenderer
for rendering and picking operations. The
AnnotationRenderer
is specified by calling setAnnotationRenderer(gov.nasa.worldwind.render.AnnotationRenderer)
.
Annotation
,
AnnotationRenderer
Field Summary |
---|
Fields inherited from class gov.nasa.worldwind.avlist.AVListImpl |
---|
changeSupport |
Constructor Summary | |
---|---|
AnnotationLayer()
Creates a new AnnotationLayer with an empty collection of Annotations. |
Method Summary | |
---|---|
void |
addAnnotation(Annotation annotation)
Adds the specified annotation to this layer's internal collection. |
void |
addAnnotations(java.lang.Iterable<Annotation> annotations)
Adds the contents of the specified annotations to this layer's internal collection. |
protected void |
doPick(DrawContext dc,
java.awt.Point pickPoint)
|
protected void |
doRender(DrawContext dc)
|
AnnotationRenderer |
getAnnotationRenderer()
Returns the AnnotationRenderer this layer delegates to during picking and rendering. |
java.lang.Iterable<Annotation> |
getAnnotations()
Returns the Iterable of Annotations currently in use by this layer. |
void |
removeAllAnnotations()
Clears the contents of this layer's internal Annotation collection. |
void |
removeAnnotation(Annotation annotation)
Removes the specified annotation from this layer's internal collection, if it exists. |
void |
setAnnotationRenderer(AnnotationRenderer annotationRenderer)
Sets the AnnotationRenderer this layer delegates to during picking and rendering. |
void |
setAnnotations(java.lang.Iterable<Annotation> annotationIterable)
Overrides the collection of currently active Annotations with the specified annotationIterable . |
java.lang.String |
toString()
|
Methods inherited from class gov.nasa.worldwind.layers.AbstractLayer |
---|
dispose, getMaxActiveAltitude, getMinActiveAltitude, getName, getOpacity, getRestorableState, getScale, isAtMaxResolution, isEnabled, isLayerActive, isLayerInView, isMultiResolution, isPickEnabled, pick, render, restoreState, setEnabled, setMaxActiveAltitude, setMinActiveAltitude, setName, setOpacity, setPickEnabled |
Methods inherited from class gov.nasa.worldwind.WWObjectImpl |
---|
propertyChange |
Methods inherited from class gov.nasa.worldwind.avlist.AVListImpl |
---|
addPropertyChangeListener, addPropertyChangeListener, clearList, copy, firePropertyChange, firePropertyChange, getDoubleValue, getDoubleValue, getEntries, getIntegerValue, getIntegerValue, getLongValue, getLongValue, 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, 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 |
Methods inherited from interface java.beans.PropertyChangeListener |
---|
propertyChange |
Constructor Detail |
---|
public AnnotationLayer()
AnnotationLayer
with an empty collection of Annotations.
Method Detail |
---|
public void addAnnotation(Annotation annotation)
annotation
to this layer's internal collection.
If this layer's internal collection has been overriden with a call to setAnnotations(java.lang.Iterable)
,
this will throw an exception.
annotation
- Annotation to add.
java.lang.IllegalArgumentException
- If annotation
is null.
java.lang.IllegalStateException
- If a custom Iterable has been specified by a call to setAnnotations
.public void addAnnotations(java.lang.Iterable<Annotation> annotations)
annotations
to this layer's internal collection.
If this layer's internal collection has been overriden with a call to setAnnotations(java.lang.Iterable)
,
this will throw an exception.
annotations
- Annotations to add.
java.lang.IllegalArgumentException
- If annotations
is null.
java.lang.IllegalStateException
- If a custom Iterable has been specified by a call to setAnnotations
.protected void doPick(DrawContext dc, java.awt.Point pickPoint)
doPick
in class AbstractLayer
protected void doRender(DrawContext dc)
doRender
in class AbstractLayer
public AnnotationRenderer getAnnotationRenderer()
AnnotationRenderer
this layer delegates to during picking and rendering.
AnnotationRenderer
used to pick and render Annotations
.public java.lang.Iterable<Annotation> getAnnotations()
setAnnotations(java.lang.Iterable)
, this will returns a reference
to that Iterable. If the caller passed setAnnotations
a null parameter,
or if setAnnotations
has not been called, this returns a view of this layer's internal
collection of Annotations.
public void removeAllAnnotations()
setAnnotations(java.lang.Iterable)
,
this will throw an exception.
java.lang.IllegalStateException
- If a custom Iterable has been specified by a call to setAnnotations
.public void removeAnnotation(Annotation annotation)
annotation
from this layer's internal collection, if it exists.
If this layer's internal collection has been overriden with a call to setAnnotations(java.lang.Iterable)
,
this will throw an exception.
annotation
- Annotation to remove.
java.lang.IllegalArgumentException
- If annotation
is null.
java.lang.IllegalStateException
- If a custom Iterable has been specified by a call to setAnnotations
.public void setAnnotationRenderer(AnnotationRenderer annotationRenderer)
AnnotationRenderer
this layer delegates to during picking and rendering.
annotationRenderer
- AnnotationRenderer
used to pick and render Annotations
.
java.lang.IllegalArgumentException
- If annotationRenderer
is null.public void setAnnotations(java.lang.Iterable<Annotation> annotationIterable)
annotationIterable
.
This layer will maintain a reference to annotationIterable
strictly for picking and rendering.
This layer will not modify the Iterable reference. However, this will clear
the internal collection of Annotations, and will prevent any modification to its contents via
addAnnotation, addAnnotations, or removeAnnotations
.
If the specified annotationIterable
is null, this layer will revert to maintaining its internal
collection.
annotationIterable
- Iterable to use instead of this layer's internal collection, or null to use this
layer's internal collection.public java.lang.String toString()
toString
in class AbstractLayer
|
NASA World Wind | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |