Class AbstractShapeEditor
- java.lang.Object
-
- gov.nasa.worldwind.avlist.AVListImpl
-
- gov.nasa.worldwind.WWObjectImpl
-
- gov.nasa.worldwind.layers.AbstractLayer
-
- gov.nasa.worldwindx.examples.shapebuilder.AbstractShapeEditor
-
- All Implemented Interfaces:
AVList
,Disposable
,MessageListener
,Layer
,Restorable
,WWObject
,java.awt.event.MouseListener
,java.awt.event.MouseMotionListener
,java.beans.PropertyChangeListener
,java.util.EventListener
- Direct Known Subclasses:
ExtrudedPolygonEditor
,RigidShapeEditor
public abstract class AbstractShapeEditor extends AbstractLayer implements java.awt.event.MouseListener, java.awt.event.MouseMotionListener
An abstract class defining common functionality and fields for editors used in the RigidShapeBuilder example. These include field variables and getters and setters for the shape's annotations that are displayed during editing (and related labels), references to the current WorldWindow and mouse location, flags indicating whether the editor is currently armed and whether annotations should be shown, as well as fields indicating the current action being performed, the current editMode, and the current altitudeMode.In addition, the class contains several helper functions related to displaying annotations, which all editors should be able to do.
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean
aboveGround
static java.lang.String
ACCUMULATED_LABEL
protected java.lang.String
activeAction
static java.lang.String
ALTITUDE_LABEL
protected int
altitudeMode
static java.lang.String
ANGLE_LABEL
Labels used in the annotations which are displayed during editing to show the current value of various shape parameters.protected ScreenAnnotation
annotation
protected AnnotationAttributes
annotationAttributes
static java.lang.String
AREA_LABEL
protected boolean
armed
static java.lang.String
CENTER_ALTITUDE_LABEL
static java.lang.String
CENTER_LATITUDE_LABEL
static java.lang.String
CENTER_LONGITUDE_LABEL
static java.lang.String
EAST_SKEW_LABEL
protected java.lang.String
editMode
protected long
frameTimestamp
static java.lang.String
HEADING_LABEL
static java.lang.String
HEIGHT_LABEL
static java.lang.String
LATITUDE_LABEL
static java.lang.String
LENGTH_LABEL
static java.lang.String
LONGITUDE_LABEL
static java.lang.String
MAJOR_AXIS_LABEL
static java.lang.String
MINOR_AXIS_LABEL
protected java.awt.Point
mousePoint
static java.lang.String
NORTH_SKEW_LABEL
static java.lang.String
PERIMETER_LABEL
static java.lang.String
RADIUS_LABEL
static java.lang.String
ROLL_LABEL
protected boolean
showAnnotation
static java.lang.String
TILT_LABEL
protected UnitsFormat
unitsFormat
static java.lang.String
WIDTH_LABEL
protected WorldWindow
wwd
-
Constructor Summary
Constructors Constructor Description AbstractShapeEditor()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected boolean
arePositionsRedundant(Position posA, Position posB)
int
getAltitudeMode()
protected AnnotationAttributes
getAnnotationAttributes()
abstract java.lang.String
getEditMode()
java.lang.String
getLabel(java.lang.String labelName)
WorldWindow
getWorldWindow()
protected void
initializeAnnotation()
boolean
isAboveGround()
boolean
isArmed()
boolean
isShowAnnotation()
void
setAboveGround(boolean state)
void
setAltitudeMode(int altitudeMode)
protected void
setAnnotationAttributes(AnnotationAttributes attributes)
void
setArmed(boolean armed)
abstract void
setEditMode(java.lang.String editMode)
protected void
setInitialLabels()
void
setLabel(java.lang.String labelName, java.lang.String label)
abstract void
setShape(AbstractShape shape)
void
setShowAnnotation(boolean state)
void
setWorldWindow(WorldWindow wwd)
abstract void
updateAnnotation(Position pos)
-
Methods inherited from class gov.nasa.worldwind.layers.AbstractLayer
createLayerConfigElements, dispose, doPick, doPreRender, doRender, getDataFileStore, getExpiryTime, getLayerConfigParams, getMaxActiveAltitude, getMaxEffectiveAltitude, getMinActiveAltitude, getMinEffectiveAltitude, getName, getOpacity, getRestorableState, getScale, getScreenCredit, isAtMaxResolution, isEnabled, isLayerActive, isLayerConfigDocument, isLayerInView, isMultiResolution, isNetworkRetrievalEnabled, isPickEnabled, pick, preRender, render, restoreState, setDataFileStore, setEnabled, setExpiryTime, setMaxActiveAltitude, setMinActiveAltitude, setName, setNetworkRetrievalEnabled, setOpacity, setPickEnabled, setScreenCredit, toString
-
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, 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 gov.nasa.worldwind.event.MessageListener
onMessage
-
-
-
-
Field Detail
-
ANGLE_LABEL
public static final java.lang.String ANGLE_LABEL
Labels used in the annotations which are displayed during editing to show the current value of various shape parameters. Actual label values are retrieved from the WorldWind message resource bundle.- See Also:
- Constant Field Values
-
AREA_LABEL
public static final java.lang.String AREA_LABEL
- See Also:
- Constant Field Values
-
LENGTH_LABEL
public static final java.lang.String LENGTH_LABEL
- See Also:
- Constant Field Values
-
PERIMETER_LABEL
public static final java.lang.String PERIMETER_LABEL
- See Also:
- Constant Field Values
-
RADIUS_LABEL
public static final java.lang.String RADIUS_LABEL
- See Also:
- Constant Field Values
-
HEIGHT_LABEL
public static final java.lang.String HEIGHT_LABEL
- See Also:
- Constant Field Values
-
WIDTH_LABEL
public static final java.lang.String WIDTH_LABEL
- See Also:
- Constant Field Values
-
HEADING_LABEL
public static final java.lang.String HEADING_LABEL
- See Also:
- Constant Field Values
-
TILT_LABEL
public static final java.lang.String TILT_LABEL
- See Also:
- Constant Field Values
-
ROLL_LABEL
public static final java.lang.String ROLL_LABEL
- See Also:
- Constant Field Values
-
EAST_SKEW_LABEL
public static final java.lang.String EAST_SKEW_LABEL
- See Also:
- Constant Field Values
-
NORTH_SKEW_LABEL
public static final java.lang.String NORTH_SKEW_LABEL
- See Also:
- Constant Field Values
-
CENTER_LATITUDE_LABEL
public static final java.lang.String CENTER_LATITUDE_LABEL
- See Also:
- Constant Field Values
-
CENTER_LONGITUDE_LABEL
public static final java.lang.String CENTER_LONGITUDE_LABEL
- See Also:
- Constant Field Values
-
CENTER_ALTITUDE_LABEL
public static final java.lang.String CENTER_ALTITUDE_LABEL
- See Also:
- Constant Field Values
-
LATITUDE_LABEL
public static final java.lang.String LATITUDE_LABEL
- See Also:
- Constant Field Values
-
LONGITUDE_LABEL
public static final java.lang.String LONGITUDE_LABEL
- See Also:
- Constant Field Values
-
ALTITUDE_LABEL
public static final java.lang.String ALTITUDE_LABEL
- See Also:
- Constant Field Values
-
ACCUMULATED_LABEL
public static final java.lang.String ACCUMULATED_LABEL
- See Also:
- Constant Field Values
-
MAJOR_AXIS_LABEL
public static final java.lang.String MAJOR_AXIS_LABEL
- See Also:
- Constant Field Values
-
MINOR_AXIS_LABEL
public static final java.lang.String MINOR_AXIS_LABEL
- See Also:
- Constant Field Values
-
wwd
protected WorldWindow wwd
-
mousePoint
protected java.awt.Point mousePoint
-
annotation
protected ScreenAnnotation annotation
-
annotationAttributes
protected AnnotationAttributes annotationAttributes
-
unitsFormat
protected UnitsFormat unitsFormat
-
armed
protected boolean armed
-
showAnnotation
protected boolean showAnnotation
-
aboveGround
protected boolean aboveGround
-
frameTimestamp
protected long frameTimestamp
-
activeAction
protected java.lang.String activeAction
-
editMode
protected java.lang.String editMode
-
altitudeMode
protected int altitudeMode
-
-
Method Detail
-
getWorldWindow
public WorldWindow getWorldWindow()
-
setWorldWindow
public void setWorldWindow(WorldWindow wwd)
-
isArmed
public boolean isArmed()
-
setArmed
public void setArmed(boolean armed)
-
getAltitudeMode
public int getAltitudeMode()
-
setAltitudeMode
public void setAltitudeMode(int altitudeMode)
-
isShowAnnotation
public boolean isShowAnnotation()
-
setShowAnnotation
public void setShowAnnotation(boolean state)
-
isAboveGround
public boolean isAboveGround()
-
setAboveGround
public void setAboveGround(boolean state)
-
getLabel
public java.lang.String getLabel(java.lang.String labelName)
-
setLabel
public void setLabel(java.lang.String labelName, java.lang.String label)
-
setAnnotationAttributes
protected void setAnnotationAttributes(AnnotationAttributes attributes)
-
getAnnotationAttributes
protected AnnotationAttributes getAnnotationAttributes()
-
setShape
public abstract void setShape(AbstractShape shape)
-
getEditMode
public abstract java.lang.String getEditMode()
-
setEditMode
public abstract void setEditMode(java.lang.String editMode)
-
updateAnnotation
public abstract void updateAnnotation(Position pos)
-
initializeAnnotation
protected void initializeAnnotation()
-
setInitialLabels
protected void setInitialLabels()
-
-