public class ToggleAnnotation extends DummyGlobeAnnotation implements java.io.Serializable
| Modifier and Type | Field and Description |
|---|---|
private boolean |
_selected
Indicates whether this annotation is currently selected.
|
private java.lang.String |
_selectedText
Text to display when the annotation is selected.
|
private java.lang.String |
_unselectedText
Text to display when the annotation is not selected.
|
static java.awt.Color |
DEFAULT_SELECTED_BACKGROUND_COLOR
Default selected background color is a half-transparent green
|
private java.awt.Color |
selectedBackgroundColor
The background color that is used when the annotation is selected.
|
private static long |
serialVersionUID |
private java.awt.Color |
unselectedBackgroundColor
Temporary storage of the original unselected background color when the annotation is selected.
|
private java.util.UUID |
uuid |
altitudeMode, dragEnabled, draggableSupport, heightInMeter, position| Constructor and Description |
|---|
ToggleAnnotation(gov.nasa.worldwind.render.GlobeAnnotation annotation)
Converts a standard GlobeAnnotation to a ToggleAnnotation where the selected and unselected texts are the same.
|
ToggleAnnotation(java.lang.String unselectedText,
java.lang.String selectedText,
gov.nasa.worldwind.geom.Position pos)
Build a new toggling annotation.
|
ToggleAnnotation(java.lang.String unselectedText,
java.lang.String selectedText,
gov.nasa.worldwind.geom.Position pos,
gov.nasa.worldwind.render.AnnotationAttributes attr)
Build a new toggling annotation with custom attributes
|
ToggleAnnotation(ToggleAnnotation ta)
Copy constructor
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object other) |
int |
hashCode() |
boolean |
isSelected()
Accessor for the current selected state
|
private void |
readObject(java.io.ObjectInputStream in)
Custom deserialization process to deserialize non-serializable superclass.
|
protected void |
selectedFalseAction()
Protected method that performs action when annotation is set to unselected.
|
protected void |
selectedTrueAction()
Protected method that performs action when annotation is set to selected.
|
void |
setSelected(boolean selected)
Sets the annotation to either the selected or non-selected state.
|
void |
setSelectedBackgroundColor(java.awt.Color c)
Sets the background color to use when the annotation is selected.
|
void |
toggleText()
Toggle between selected and unselected.
|
java.lang.String |
toString()
Overridden toString to show values
|
private void |
writeObject(java.io.ObjectOutputStream out)
Custom serialization process to serialize non-serializable superclass
|
computeBounds, computeDistanceScaleAndOpacity, computeLookAtDistance, doDrag, doRenderNow, drag, getAltitudeMode, getAnnotationDrawPoint, getAnnotationDrawPointLegacy, getHeightInMeter, getPosition, getReferencePosition, getRestorableState, isDragEnabled, move, moveTo, restoreState, setAltitudeMode, setDepthFunc, setDragEnabled, setHeightInMeter, setPositionaddChild, adjustSizeToChildren, adjustSizeToText, applyBackgroundTextureState, applyColor, applyScreenTransform, beginDraw, beginDrawChildren, bindPickableObject, computeBoundingRectangle, computeFreeBounds, computeInsetBounds, computeOpacity, computeScale, computeTextBounds, dispose, doDraw, doDrawBackgroundTexture, doDrawChildren, draw, drawBackground, drawBackgroundImage, drawBorder, drawCallout, drawChildren, drawContent, drawHTML, drawPlainText, drawText, drawText, drawTopLevelAnnotation, endDraw, endDrawChildren, getAttributes, getBounds, getChildren, getDelegateOwner, getLayout, getMaxActiveAltitude, getMinActiveAltitude, getMultiLineTextRenderer, getPickSupport, getPreferredSize, getText, getTextBounds, getTextRenderer, getWrappedText, glPointFromAWTPoint, isAlwaysOnTop, isPickEnabled, modulateColorOpacity, pick, removeAllChildren, removeChild, render, renderNow, setAlwaysOnTop, setAttributes, setDelegateOwner, setLayout, setMaxActiveAltitude, setMinActiveAltitude, setPickEnabled, setPickSupport, setText, transformBackgroundImageCoordsToAnnotationCoords, transformByModelview, transformImageCoordsToBackgroundImageCoords, wrapTextaddPropertyChangeListener, 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, setValuesprivate static final long serialVersionUID
public static final java.awt.Color DEFAULT_SELECTED_BACKGROUND_COLOR
private java.lang.String _unselectedText
private java.lang.String _selectedText
private boolean _selected
private java.awt.Color selectedBackgroundColor
private java.awt.Color unselectedBackgroundColor
private java.util.UUID uuid
public ToggleAnnotation(java.lang.String unselectedText,
java.lang.String selectedText,
gov.nasa.worldwind.geom.Position pos)
unselectedText - - text to display when annotation is not selectedselectedText - - text to display when annotation is selectedpos - - position of annotationpublic ToggleAnnotation(java.lang.String unselectedText,
java.lang.String selectedText,
gov.nasa.worldwind.geom.Position pos,
gov.nasa.worldwind.render.AnnotationAttributes attr)
unselectedText - - text to display when annotation is not selectedselectedText - - text to display when annotation is selectedpos - - position of annotationattr - - display attributes for the annotation.public ToggleAnnotation(ToggleAnnotation ta)
ta - ToggleAnnotation to copypublic ToggleAnnotation(gov.nasa.worldwind.render.GlobeAnnotation annotation)
annotation - The GlobeAnnotation to convert.public void setSelectedBackgroundColor(java.awt.Color c)
c - The background color to use when selected.public void setSelected(boolean selected)
selected - Whether or not the annotation will be selected.protected void selectedTrueAction()
protected void selectedFalseAction()
public boolean isSelected()
public void toggleText()
private void writeObject(java.io.ObjectOutputStream out)
throws java.io.IOException
out - Output stream for serializationjava.io.IOExceptionprivate void readObject(java.io.ObjectInputStream in)
throws java.io.IOException,
java.lang.ClassNotFoundException
in - Input stream for deserializationjava.io.IOExceptionjava.lang.ClassNotFoundExceptionpublic java.lang.String toString()
toString in class java.lang.Objectpublic boolean equals(java.lang.Object other)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Object