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 class
ExtrudedPolygonEditor.ControlPointMarker
-
Field Summary
Fields Modifier and Type Field Description protected ExtrudedPolygonEditor.ControlPointMarker
activeControlPoint
protected int
activeControlPointIndex
static java.lang.String
CHANGE_HEIGHT_ACTION
protected BasicMarkerAttributes
heightControlAttributes
protected MarkerRenderer
markerRenderer
static java.lang.String
MOVE_POLYGON_ACTION
static java.lang.String
MOVE_VERTEX_ACTION
protected ExtrudedPolygon
polygon
protected BasicMarkerAttributes
vertexControlAttributes
-
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 void
addVertex(java.awt.Point mousePoint)
Add a vertex to the polygon's outer boundary.protected void
assembleControlPoints(DrawContext dc)
protected void
assembleHeightControlPoints()
protected void
assembleMarkerAttributes()
protected void
assembleVertexControlPoints(DrawContext dc)
protected Vec4
computeAnnotationPosition(Position pos)
protected void
doPick(DrawContext dc, java.awt.Point point)
protected void
doRender(DrawContext dc)
protected java.lang.String
formatMeasurements(Position pos)
protected java.lang.String
getDisplayString(Position pos)
java.lang.String
getEditMode()
ExtrudedPolygon
getPolygon()
protected Vec4
intersectPolygonAltitudeAt(Line ray)
Determine the point at which a ray intersects a the globe at the elevation of the polygon.void
mouseClicked(java.awt.event.MouseEvent e)
void
mouseDragged(java.awt.event.MouseEvent e)
void
mouseEntered(java.awt.event.MouseEvent e)
void
mouseExited(java.awt.event.MouseEvent e)
void
mouseMoved(java.awt.event.MouseEvent e)
void
mousePressed(java.awt.event.MouseEvent e)
void
mouseReleased(java.awt.event.MouseEvent e)
protected void
moveControlPoint(ExtrudedPolygonEditor.ControlPointMarker controlPoint, java.awt.Point lastMousePoint, java.awt.Point moveToPoint)
protected void
movePolygon(java.awt.Point previousMousePoint, java.awt.Point mousePoint)
protected void
removeVertex(ExtrudedPolygonEditor.ControlPointMarker vertexToRemove)
Remove a vertex from the polygon.void
setEditMode(java.lang.String editMode)
void
setPolygon(ExtrudedPolygon polygon)
protected void
setPolygonHeight(java.awt.Point previousMousePoint, java.awt.Point mousePoint)
void
setShape(AbstractShape shape)
void
updateAnnotation(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:
setShape
in classAbstractShapeEditor
-
getEditMode
public java.lang.String getEditMode()
- Specified by:
getEditMode
in classAbstractShapeEditor
-
setEditMode
public void setEditMode(java.lang.String editMode)
- Specified by:
setEditMode
in 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:
doRender
in classAbstractLayer
-
doPick
protected void doPick(DrawContext dc, java.awt.Point point)
- Overrides:
doPick
in 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:
updateAnnotation
in classAbstractShapeEditor
-
getDisplayString
protected java.lang.String getDisplayString(Position pos)
-
formatMeasurements
protected java.lang.String formatMeasurements(Position pos)
-
-