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 booleanaboveGroundstatic java.lang.StringACCUMULATED_LABELprotected java.lang.StringactiveActionstatic java.lang.StringALTITUDE_LABELprotected intaltitudeModestatic java.lang.StringANGLE_LABELLabels used in the annotations which are displayed during editing to show the current value of various shape parameters.protected ScreenAnnotationannotationprotected AnnotationAttributesannotationAttributesstatic java.lang.StringAREA_LABELprotected booleanarmedstatic java.lang.StringCENTER_ALTITUDE_LABELstatic java.lang.StringCENTER_LATITUDE_LABELstatic java.lang.StringCENTER_LONGITUDE_LABELstatic java.lang.StringEAST_SKEW_LABELprotected java.lang.StringeditModeprotected longframeTimestampstatic java.lang.StringHEADING_LABELstatic java.lang.StringHEIGHT_LABELstatic java.lang.StringLATITUDE_LABELstatic java.lang.StringLENGTH_LABELstatic java.lang.StringLONGITUDE_LABELstatic java.lang.StringMAJOR_AXIS_LABELstatic java.lang.StringMINOR_AXIS_LABELprotected java.awt.PointmousePointstatic java.lang.StringNORTH_SKEW_LABELstatic java.lang.StringPERIMETER_LABELstatic java.lang.StringRADIUS_LABELstatic java.lang.StringROLL_LABELprotected booleanshowAnnotationstatic java.lang.StringTILT_LABELprotected UnitsFormatunitsFormatstatic java.lang.StringWIDTH_LABELprotected WorldWindowwwd
-
Constructor Summary
Constructors Constructor Description AbstractShapeEditor()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected booleanarePositionsRedundant(Position posA, Position posB)intgetAltitudeMode()protected AnnotationAttributesgetAnnotationAttributes()abstract java.lang.StringgetEditMode()java.lang.StringgetLabel(java.lang.String labelName)WorldWindowgetWorldWindow()protected voidinitializeAnnotation()booleanisAboveGround()booleanisArmed()booleanisShowAnnotation()voidsetAboveGround(boolean state)voidsetAltitudeMode(int altitudeMode)protected voidsetAnnotationAttributes(AnnotationAttributes attributes)voidsetArmed(boolean armed)abstract voidsetEditMode(java.lang.String editMode)protected voidsetInitialLabels()voidsetLabel(java.lang.String labelName, java.lang.String label)abstract voidsetShape(AbstractShape shape)voidsetShowAnnotation(boolean state)voidsetWorldWindow(WorldWindow wwd)abstract voidupdateAnnotation(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()
-
-