Class 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 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
      • 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
      • 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
      • mousePoint

        protected java.awt.Point mousePoint
      • 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
    • Constructor Detail

      • AbstractShapeEditor

        public AbstractShapeEditor()
    • Method Detail

      • 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)
      • 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()
      • arePositionsRedundant

        protected boolean arePositionsRedundant​(Position posA,
                                                Position posB)