gov.nasa.worldwind.util.measure
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Nested Class Summary | |
|---|---|
class |
MeasureTool.ControlPoint
|
protected class |
MeasureTool.CustomRenderableLayer
|
| Fields inherited from class gov.nasa.worldwind.avlist.AVListImpl |
|---|
changeSupport |
| Constructor Summary | |
|---|---|
MeasureTool(WorldWindow wwd)
Construct a new measure tool drawing events from the specified WorldWindow. |
|
MeasureTool(WorldWindow wwd,
RenderableLayer applicationLayer)
Construct a new measure tool drawing events from the specified WorldWindow and using the given
RenderableLayer. |
|
| Method Summary | |
|---|---|
void |
addControlPoint()
Add a control point to the current measure shape at the cuurrent WorldWindow position. |
protected void |
addControlPoint(Position position,
String key,
Object value)
|
void |
clear()
Removes all positions from the shape, clear attributes. |
protected Position |
computeSurfacePosition(LatLon latLon)
|
protected MeasureTool.CustomRenderableLayer |
createCustomRenderableLayer()
|
void |
dispose()
|
protected String |
formatArea(double value)
|
protected String |
formatLength(double value)
|
AnnotationAttributes |
getAnnotationAttributes()
Get the attributes associated with the tool tip annotation. |
RenderableLayer |
getApplicationLayer()
Returns the applilcation layer passed to the constructor. |
double |
getArea()
|
Position |
getCenterPosition()
|
MeasureToolController |
getController()
Get the MeasureToolController for this measure tool. |
ArrayList<Renderable> |
getControlPoints()
Get the list of control points associated with the current measure shape. |
AnnotationAttributes |
getControlPointsAttributes()
Get the attributes associated with the control points. |
Color |
getFillColor()
|
double |
getHeight()
|
RenderableLayer |
getLayer()
Returns the measure tool layer. |
double |
getLength()
|
Polyline |
getLine()
Returns the polyline currently used to display lines and path. |
Color |
getLineColor()
|
double |
getLineWidth()
|
String |
getMeasureShape()
Get the measure shape type. |
Angle |
getOrientation()
|
String |
getPathType()
|
protected String |
getPathType(List<? extends Position> positions)
|
ArrayList<? extends Position> |
getPositions()
Get the list of positions that define the current measure shape. |
SurfaceShape |
getSurfaceShape()
Returns the surface shape currently used to display polygons. |
double |
getWidth()
|
WorldWindow |
getWwd()
|
boolean |
isArmed()
Identifies whether the measure tool controller is armed. |
boolean |
isFollowTerrain()
|
boolean |
isMeasureShape(Object o)
|
boolean |
isRegularShape()
|
protected boolean |
isRegularShape(String shape)
|
boolean |
isShowAnnotation()
|
boolean |
isShowControlPoints()
|
protected static String |
keyFromPolylinePathType(int type)
|
void |
moveControlPoint(MeasureTool.ControlPoint point)
Update the current measure shape according to a given control point position. |
void |
moveMeasureShape(Angle azimuth,
Angle distance)
Move the current measure shape along a great circle arc at a given azimuth Angle
for a given distance Angle. |
protected static int |
polylinePathTypeFromKey(String type)
|
void |
removeControlPoint()
Remove the last control point from the current measure shape. |
void |
setArmed(boolean state)
Arms and disarms the measure tool controller. |
void |
setController(MeasureToolController controller)
Set the controller object for this measure tool - can be null. |
void |
setFillColor(Color color)
|
void |
setFollowTerrain(boolean followTerrain)
|
void |
setLineColor(Color color)
|
void |
setLineWidth(double width)
|
void |
setMeasureShape(Polyline line)
Set the measure shape to an existing Polyline. |
void |
setMeasureShape(String shape)
Set the measure shape type. |
void |
setMeasureShape(String shape,
Position centerPosition,
double radius)
Set and initialize the measure shape to one of the regular shapes SHAPE_CIRCLE, SHAPE_ELLIPSE,
SHAPE_SQUARE or SHAPE_QUAD. |
void |
setMeasureShape(String shape,
Position centerPosition,
double width,
double height,
Angle orientation)
Set and initialize the measure shape to one of the regular shapes SHAPE_CIRCLE, SHAPE_ELLIPSE,
SHAPE_SQUARE or SHAPE_QUAD. |
void |
setMeasureShape(SurfaceShape surfaceShape)
Set the measure shape to an existing SurfaceShape. |
void |
setPathType(String type)
|
void |
setPositions(ArrayList<? extends Position> newPositions)
Set the measure shape to an arbitrary list of positions using setPositions(java.util.ArrayList). |
void |
setShowAnnotation(boolean state)
|
void |
setShowControlPoints(boolean state)
|
void |
updateAnnotation(Position pos)
Move or disable the tool tip annotation. |
protected void |
updateMeasureShape()
|
protected void |
updatePositionsFromShape()
|
protected void |
updateShapeControlPoints()
|
protected void |
updateShapeProperties(String control,
Position newPosition)
|
| Methods inherited from class gov.nasa.worldwind.avlist.AVListImpl |
|---|
addPropertyChangeListener, addPropertyChangeListener, clearList, copy, firePropertyChange, firePropertyChange, getDoubleValue, getDoubleValue, getEntries, getIntegerValue, getIntegerValue, getLongValue, getLongValue, getStringValue, getStringValue, getStringValue, getValue, getValues, hasKey, removeKey, removePropertyChangeListener, removePropertyChangeListener, setValue, setValues |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected ScreenAnnotation annotation
protected AnnotationAttributes annotationAttributes
protected RenderableLayer applicationLayer
protected MeasureToolController controller
protected ArrayList<Renderable> controlPoints
protected AnnotationAttributes controlPointsAttributes
protected MeasureTool.CustomRenderableLayer controlPointsLayer
public static final String EVENT_ARMED
public static final String EVENT_METRIC_CHANGED
public static final String EVENT_POSITION_ADD
public static final String EVENT_POSITION_REMOVE
public static final String EVENT_POSITION_REPLACE
public static final String EVENT_RUBBERBAND_START
public static final String EVENT_RUBBERBAND_STOP
protected Color fillColor
protected boolean followTerrain
protected MeasureTool.CustomRenderableLayer layer
protected Polyline line
protected Color lineColor
protected double lineWidth
protected String measureShape
protected String pathType
protected ArrayList<Position> positions
public static final String SHAPE_CIRCLE
public static final String SHAPE_ELLIPSE
public static final String SHAPE_LINE
public static final String SHAPE_PATH
public static final String SHAPE_POLYGON
public static final String SHAPE_QUAD
public static final String SHAPE_SQUARE
protected Position shapeCenterPosition
protected int shapeIntervals
protected MeasureTool.CustomRenderableLayer shapeLayer
protected Angle shapeOrientation
protected Rectangle2D.Double shapeRectangle
protected boolean showAnnotation
protected boolean showControlPoints
protected SurfaceShape surfaceShape
protected final WorldWindow wwd
| Constructor Detail |
|---|
public MeasureTool(WorldWindow wwd)
WorldWindow.
wwd - the WorldWindow to draw events from.public MeasureTool(WorldWindow wwd, RenderableLayer applicationLayer)
WorldWindow and using the given
RenderableLayer.
wwd - the WorldWindow to draw events from.applicationLayer - the RenderableLayer to use - can be null.| Method Detail |
|---|
public void addControlPoint()
protected void addControlPoint(Position position, String key, Object value)
public void clear()
protected Position computeSurfacePosition(LatLon latLon)
protected MeasureTool.CustomRenderableLayer createCustomRenderableLayer()
public void dispose()
dispose in interface Disposableprotected String formatArea(double value)
protected String formatLength(double value)
public AnnotationAttributes getAnnotationAttributes()
public RenderableLayer getApplicationLayer()
public double getArea()
public Position getCenterPosition()
public MeasureToolController getController()
MeasureToolController for this measure tool.
MeasureToolController for this measure tool.public ArrayList<Renderable> getControlPoints()
public AnnotationAttributes getControlPointsAttributes()
public Color getFillColor()
public double getHeight()
public RenderableLayer getLayer()
public double getLength()
public Polyline getLine()
public Color getLineColor()
public double getLineWidth()
public String getMeasureShape()
SHAPE_LINE, SHAPE_PATH, SHAPE_POLYGON,
SHAPE_CIRCLE, SHAPE_ELLIPSE, SHAPE_SQUARE or SHAPE_QUAD.
public Angle getOrientation()
public String getPathType()
protected String getPathType(List<? extends Position> positions)
public ArrayList<? extends Position> getPositions()
public SurfaceShape getSurfaceShape()
public double getWidth()
public WorldWindow getWwd()
public boolean isArmed()
public boolean isFollowTerrain()
public boolean isMeasureShape(Object o)
public boolean isRegularShape()
protected boolean isRegularShape(String shape)
public boolean isShowAnnotation()
public boolean isShowControlPoints()
protected static String keyFromPolylinePathType(int type)
public void moveControlPoint(MeasureTool.ControlPoint point)
point - one of the shape control points.public void moveMeasureShape(Angle azimuth, Angle distance)
Angle
for a given distance Angle.
azimuth - the azimuth Angle.distance - the distance Angle.protected static int polylinePathTypeFromKey(String type)
public void removeControlPoint()
public void setArmed(boolean state)
state - true to arm the controller, false to disarm it.public void setController(MeasureToolController controller)
controller - the controller object for this measure tool.public void setFillColor(Color color)
public void setFollowTerrain(boolean followTerrain)
public void setLineColor(Color color)
public void setLineWidth(double width)
public void setMeasureShape(Polyline line)
Polyline.
line - a Polyline instance.public void setMeasureShape(String shape)
SHAPE_LINE, SHAPE_PATH, SHAPE_POLYGON,
SHAPE_CIRCLE, SHAPE_ELLIPSE, SHAPE_SQUARE or SHAPE_QUAD. This will reset
the measure tool and clear the current measure shape.
shape - the measure shape type.public void setMeasureShape(String shape, Position centerPosition, double radius)
SHAPE_CIRCLE, SHAPE_ELLIPSE,
SHAPE_SQUARE or SHAPE_QUAD.
shape - the shape type.centerPosition - ther shape center position.radius - the shape radius of half width/height.public void setMeasureShape(String shape, Position centerPosition, double width, double height, Angle orientation)
SHAPE_CIRCLE, SHAPE_ELLIPSE,
SHAPE_SQUARE or SHAPE_QUAD.
shape - the shape type.centerPosition - ther shape center position.width - the shape width.height - the shape height.orientation - the shape orientation or azimuth angle - clockwise from north.public void setMeasureShape(SurfaceShape surfaceShape)
SurfaceShape. Can be one of SurfacePolygon,
SurfaceQuad, SurfaceSquare, SurfaceEllipse or SurfaceCircle.
surfaceShape - a SurfaceShape instance.public void setPathType(String type)
public void setPositions(ArrayList<? extends Position> newPositions)
setPositions(java.util.ArrayList).
If the provided list contains two positions, the measure shape will be set to SHAPE_LINE. If more
then two positions are provided, the measure shape will be set to SHAPE_PATH if the last position
differs from the first (open path), or SHAPE_POLYGON if the path is closed.
newPositions - the shape position list.public void setShowAnnotation(boolean state)
public void setShowControlPoints(boolean state)
public void updateAnnotation(Position pos)
pos - the new position for the tool tip annotation. If null the annotation id turned off.protected void updateMeasureShape()
protected void updatePositionsFromShape()
protected void updateShapeControlPoints()
protected void updateShapeProperties(String control, Position newPosition)
|
NASA World Wind | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||