Class ExtrudedPolygonEditor
- java.lang.Object
-
- gov.nasa.worldwind.avlist.AVListImpl
-
- gov.nasa.worldwind.WWObjectImpl
-
- gov.nasa.worldwind.layers.AbstractLayer
-
- gov.nasa.worldwindx.examples.shapebuilder.AbstractShapeEditor
-
- gov.nasa.worldwindx.examples.shapebuilder.ExtrudedPolygonEditor
-
- All Implemented Interfaces:
AVList,Disposable,MessageListener,Layer,Restorable,WWObject,java.awt.event.MouseListener,java.awt.event.MouseMotionListener,java.beans.PropertyChangeListener,java.util.EventListener
public class ExtrudedPolygonEditor extends AbstractShapeEditor
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static classExtrudedPolygonEditor.ControlPointMarker
-
Field Summary
Fields Modifier and Type Field Description protected ExtrudedPolygonEditor.ControlPointMarkeractiveControlPointprotected intactiveControlPointIndexstatic java.lang.StringCHANGE_HEIGHT_ACTIONprotected BasicMarkerAttributesheightControlAttributesprotected MarkerRenderermarkerRendererstatic java.lang.StringMOVE_POLYGON_ACTIONstatic java.lang.StringMOVE_VERTEX_ACTIONprotected ExtrudedPolygonpolygonprotected BasicMarkerAttributesvertexControlAttributes-
Fields inherited from class gov.nasa.worldwindx.examples.shapebuilder.AbstractShapeEditor
aboveGround, ACCUMULATED_LABEL, activeAction, ALTITUDE_LABEL, altitudeMode, ANGLE_LABEL, annotation, annotationAttributes, AREA_LABEL, armed, CENTER_ALTITUDE_LABEL, CENTER_LATITUDE_LABEL, CENTER_LONGITUDE_LABEL, EAST_SKEW_LABEL, editMode, frameTimestamp, HEADING_LABEL, HEIGHT_LABEL, LATITUDE_LABEL, LENGTH_LABEL, LONGITUDE_LABEL, MAJOR_AXIS_LABEL, MINOR_AXIS_LABEL, mousePoint, NORTH_SKEW_LABEL, PERIMETER_LABEL, RADIUS_LABEL, ROLL_LABEL, showAnnotation, TILT_LABEL, unitsFormat, WIDTH_LABEL, wwd
-
-
Constructor Summary
Constructors Constructor Description ExtrudedPolygonEditor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddVertex(java.awt.Point mousePoint)Add a vertex to the polygon's outer boundary.protected voidassembleControlPoints(DrawContext dc)protected voidassembleHeightControlPoints()protected voidassembleMarkerAttributes()protected voidassembleVertexControlPoints(DrawContext dc)protected Vec4computeAnnotationPosition(Position pos)protected voiddoPick(DrawContext dc, java.awt.Point point)protected voiddoRender(DrawContext dc)protected java.lang.StringformatMeasurements(Position pos)protected java.lang.StringgetDisplayString(Position pos)java.lang.StringgetEditMode()ExtrudedPolygongetPolygon()protected Vec4intersectPolygonAltitudeAt(Line ray)Determine the point at which a ray intersects a the globe at the elevation of the polygon.voidmouseClicked(java.awt.event.MouseEvent e)voidmouseDragged(java.awt.event.MouseEvent e)voidmouseEntered(java.awt.event.MouseEvent e)voidmouseExited(java.awt.event.MouseEvent e)voidmouseMoved(java.awt.event.MouseEvent e)voidmousePressed(java.awt.event.MouseEvent e)voidmouseReleased(java.awt.event.MouseEvent e)protected voidmoveControlPoint(ExtrudedPolygonEditor.ControlPointMarker controlPoint, java.awt.Point lastMousePoint, java.awt.Point moveToPoint)protected voidmovePolygon(java.awt.Point previousMousePoint, java.awt.Point mousePoint)protected voidremoveVertex(ExtrudedPolygonEditor.ControlPointMarker vertexToRemove)Remove a vertex from the polygon.voidsetEditMode(java.lang.String editMode)voidsetPolygon(ExtrudedPolygon polygon)protected voidsetPolygonHeight(java.awt.Point previousMousePoint, java.awt.Point mousePoint)voidsetShape(AbstractShape shape)voidupdateAnnotation(Position pos)-
Methods inherited from class gov.nasa.worldwindx.examples.shapebuilder.AbstractShapeEditor
arePositionsRedundant, getAltitudeMode, getAnnotationAttributes, getLabel, getWorldWindow, initializeAnnotation, isAboveGround, isArmed, isShowAnnotation, setAboveGround, setAltitudeMode, setAnnotationAttributes, setArmed, setInitialLabels, setLabel, setShowAnnotation, setWorldWindow
-
Methods inherited from class gov.nasa.worldwind.layers.AbstractLayer
createLayerConfigElements, dispose, doPreRender, 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
-
MOVE_VERTEX_ACTION
public static final java.lang.String MOVE_VERTEX_ACTION
- See Also:
- Constant Field Values
-
CHANGE_HEIGHT_ACTION
public static final java.lang.String CHANGE_HEIGHT_ACTION
- See Also:
- Constant Field Values
-
MOVE_POLYGON_ACTION
public static final java.lang.String MOVE_POLYGON_ACTION
- See Also:
- Constant Field Values
-
polygon
protected ExtrudedPolygon polygon
-
markerRenderer
protected MarkerRenderer markerRenderer
-
vertexControlAttributes
protected BasicMarkerAttributes vertexControlAttributes
-
heightControlAttributes
protected BasicMarkerAttributes heightControlAttributes
-
activeControlPoint
protected ExtrudedPolygonEditor.ControlPointMarker activeControlPoint
-
activeControlPointIndex
protected int activeControlPointIndex
-
-
Method Detail
-
getPolygon
public ExtrudedPolygon getPolygon()
-
setPolygon
public void setPolygon(ExtrudedPolygon polygon)
-
setShape
public void setShape(AbstractShape shape)
- Specified by:
setShapein classAbstractShapeEditor
-
getEditMode
public java.lang.String getEditMode()
- Specified by:
getEditModein classAbstractShapeEditor
-
setEditMode
public void setEditMode(java.lang.String editMode)
- Specified by:
setEditModein classAbstractShapeEditor
-
assembleControlPoints
protected void assembleControlPoints(DrawContext dc)
-
assembleVertexControlPoints
protected void assembleVertexControlPoints(DrawContext dc)
-
assembleHeightControlPoints
protected void assembleHeightControlPoints()
-
doRender
protected void doRender(DrawContext dc)
- Specified by:
doRenderin classAbstractLayer
-
doPick
protected void doPick(DrawContext dc, java.awt.Point point)
- Overrides:
doPickin classAbstractLayer
-
assembleMarkerAttributes
protected void assembleMarkerAttributes()
-
mouseClicked
public void mouseClicked(java.awt.event.MouseEvent e)
-
mouseDragged
public void mouseDragged(java.awt.event.MouseEvent e)
-
mousePressed
public void mousePressed(java.awt.event.MouseEvent e)
-
mouseReleased
public void mouseReleased(java.awt.event.MouseEvent e)
-
movePolygon
protected void movePolygon(java.awt.Point previousMousePoint, java.awt.Point mousePoint)
-
moveControlPoint
protected void moveControlPoint(ExtrudedPolygonEditor.ControlPointMarker controlPoint, java.awt.Point lastMousePoint, java.awt.Point moveToPoint)
-
setPolygonHeight
protected void setPolygonHeight(java.awt.Point previousMousePoint, java.awt.Point mousePoint)
-
addVertex
protected void addVertex(java.awt.Point mousePoint)
Add a vertex to the polygon's outer boundary.- Parameters:
mousePoint- the point at which the mouse was clicked. The new vertex will be placed as near as possible to this point, at the elevation of the polygon.
-
removeVertex
protected void removeVertex(ExtrudedPolygonEditor.ControlPointMarker vertexToRemove)
Remove a vertex from the polygon.- Parameters:
vertexToRemove- the vertex to remove.
-
intersectPolygonAltitudeAt
protected Vec4 intersectPolygonAltitudeAt(Line ray)
Determine the point at which a ray intersects a the globe at the elevation of the polygon.- Parameters:
ray- Ray to intersect with the globe.- Returns:
- The point at which the ray intersects the globe at the elevation of the polygon.
-
mouseEntered
public void mouseEntered(java.awt.event.MouseEvent e)
-
mouseExited
public void mouseExited(java.awt.event.MouseEvent e)
-
mouseMoved
public void mouseMoved(java.awt.event.MouseEvent e)
-
updateAnnotation
public void updateAnnotation(Position pos)
- Specified by:
updateAnnotationin classAbstractShapeEditor
-
getDisplayString
protected java.lang.String getDisplayString(Position pos)
-
formatMeasurements
protected java.lang.String formatMeasurements(Position pos)
-
-