Package gov.nasa.worldwindx.examples
Class ShapeEditingExtension.ShapeEditorExtension
- java.lang.Object
-
- gov.nasa.worldwind.util.ShapeEditor
-
- gov.nasa.worldwindx.examples.ShapeEditingExtension.ShapeEditorExtension
-
- All Implemented Interfaces:
SelectListener
,java.beans.PropertyChangeListener
,java.util.EventListener
- Enclosing class:
- ShapeEditingExtension
public static class ShapeEditingExtension.ShapeEditorExtension extends ShapeEditor
Defines an extension toShapeEditor
that knows how to operate on the custom shape defined above.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class gov.nasa.worldwind.util.ShapeEditor
ShapeEditor.ControlPointMarker
-
-
Field Summary
-
Fields inherited from class gov.nasa.worldwind.util.ShapeEditor
accessoryLayer, active, activeOperation, angleControlPointAttributes, annotation, ANNOTATION, annotationLayer, armed, controlPointLayer, currentEvent, currentHeading, currentSizingMarker, extensionEnabled, HEIGHT, INNER_MAJOR_RADIUS, INNER_MINOR_RADIUS, INNER_RADIUS, LEFT_AZIMUTH, LEFT_WIDTH, LOCATION, locationControlPointAttributes, MOVING, NONE, originalAttributes, originalHighlightAttributes, OUTER_MAJOR_RADIUS, OUTER_MINOR_RADIUS, OUTER_RADIUS, previousPosition, RIGHT_AZIMUTH, RIGHT_WIDTH, ROTATION, shadowLayer, shape, sizeControlPointAttributes, SIZING, trackAdjacencyList, unitsFormat, WIDTH, wwd
-
-
Constructor Summary
Constructors Constructor Description ShapeEditorExtension(WorldWindow wwd, Renderable shape)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected double
doGetControlPointAltitude(LatLon location, Renderable shape)
protected Renderable
doMakeShadowShape()
Creates the shape that's shown in the original position while the original shape is edited.protected void
doReshapeShape(ShapeEditor.ControlPointMarker controlPoint, Position terrainPosition)
Called during editing when a control point is moved.protected int
getShapeAltitudeMode()
Indicates the current shape's altitude mode if the shape has one.protected void
reshapeArrow(ShapeEditor.ControlPointMarker controlPoint, Position terrainPosition)
Edit the arrow according to the control point that is being moved.protected void
updateAnnotation(ShapeEditor.ControlPointMarker controlPoint)
Updates the annotation associated with a specified control point.protected void
updateArrowControlPoints()
Modify the control points to conform to the current state of the shape being edited.protected void
updateControlPoints()
Called during editing and moving to reposition the control points.-
Methods inherited from class gov.nasa.worldwind.util.ShapeEditor
addNearestLocation, adjustShape, adjustTrackShape, appendLocation, computeControlPointDelta, computeEdgeLocation, computeRectangularEdgeLocation, determineTrackAdjacency, disable, dragWholeShape, enable, getAccessoryLayer, getActiveOperation, getAngleControlPointAttributes, getAnnotation, getAnnotationLayer, getControlPointAltitude, getControlPointLayer, getCurrentEvent, getCurrentHeading, getCurrentSizingMarker, getLocationControlPointAttributes, getOriginalAttributes, getOriginalHighlightAttributes, getPreviousPosition, getShadowLayer, getShape, getShapeCenter, getSizeControlPointAttributes, getUnitsFormat, getWwd, isActive, isArmed, isExtensionEnabled, isRadiiValid, makeControlPoint, makeControlPoint, makeControlPointAttributes, makeShadowShape, moveLocation, nearestPointOnSegment, normalizedHeading, propertyChange, removeShadowShape, reshapeCappedCylinder, reshapeCappedEllipticalCylinder, reshapeOrbit, reshapePolygonAirspace, reshapeRoute, reshapeShape, reshapeSphere, reshapeSurfaceCircle, reshapeSurfaceEllipse, reshapeSurfacePolygon, reshapeSurfaceQuad, reshapeSurfaceSquare, reshapeTrack, rotateLocations, selected, setArmed, setExtensionEnabled, setUnitsFormat, updateCappedCylinderControlPoints, updateCappedEllipticalCylinderControlPoints, updateOrbitControlPoints, updateOrientationLine, updatePartialCappedCylinderControlPoints, updatePolygonAirspaceControlPoints, updateRouteControlPoints, updateShapeAnnotation, updateSphereControlPoints, updateSurfaceCircleControlPoints, updateSurfaceEllipseControlPoints, updateSurfacePolygonControlPoints, updateSurfaceQuadControlPoints, updateSurfaceSquareControlPoints, updateTrackControlPoints
-
-
-
-
Constructor Detail
-
ShapeEditorExtension
public ShapeEditorExtension(WorldWindow wwd, Renderable shape)
-
-
Method Detail
-
getShapeAltitudeMode
protected int getShapeAltitudeMode()
Description copied from class:ShapeEditor
Indicates the current shape's altitude mode if the shape has one.- Overrides:
getShapeAltitudeMode
in classShapeEditor
- Returns:
- the shape's altitude mode if it has one, otherwise
WorldWind.ABSOLUTE
.
-
doGetControlPointAltitude
protected double doGetControlPointAltitude(LatLon location, Renderable shape)
- Overrides:
doGetControlPointAltitude
in classShapeEditor
-
doMakeShadowShape
protected Renderable doMakeShadowShape()
Creates the shape that's shown in the original position while the original shape is edited.- Overrides:
doMakeShadowShape
in classShapeEditor
- Returns:
- a copy of the original shape.
-
doReshapeShape
protected void doReshapeShape(ShapeEditor.ControlPointMarker controlPoint, Position terrainPosition)
Called during editing when a control point is moved. (Not when the whole object is moved.)- Overrides:
doReshapeShape
in classShapeEditor
- Parameters:
controlPoint
- the control point selected.terrainPosition
- the terrain position under the cursor.
-
updateControlPoints
protected void updateControlPoints()
Called during editing and moving to reposition the control points. This method should only compute and set the new control point and other affordances. It should not attempt to edit the shape.- Overrides:
updateControlPoints
in classShapeEditor
-
reshapeArrow
protected void reshapeArrow(ShapeEditor.ControlPointMarker controlPoint, Position terrainPosition)
Edit the arrow according to the control point that is being moved. In the case of the custom shape, there is only one control point, and that's for rotation.- Parameters:
controlPoint
- the control point being moved by the user.terrainPosition
- the terrain position under the cursor.
-
updateArrowControlPoints
protected void updateArrowControlPoints()
Modify the control points to conform to the current state of the shape being edited.
-
updateAnnotation
protected void updateAnnotation(ShapeEditor.ControlPointMarker controlPoint)
Description copied from class:ShapeEditor
Updates the annotation associated with a specified control point.- Overrides:
updateAnnotation
in classShapeEditor
- Parameters:
controlPoint
- the control point.
-
-