public class WWOMeasureTool extends AVListImpl implements Disposable, MouseListener, MouseMotionListener, SelectListener, PositionListener, RenderingListener
Modifier and Type | Class and Description |
---|---|
static interface |
WWOMeasureTool.ControlPoint |
static interface |
WWOMeasureTool.ControlPointList |
static interface |
WWOMeasureTool.MeasureDisplay |
Constructor and Description |
---|
WWOMeasureTool(WorldWindow wwd,
Renderable shape,
String lineType,
RenderableLayer controlPointsLayer) |
Modifier and Type | Method and Description |
---|---|
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 |
addSelectListener(SelectListener listener) |
protected void |
autoDisarm() |
protected void |
callSelectListeners(SelectEvent event) |
void |
clear() |
protected Position |
computeSurfacePosition(LatLon latLon) |
protected WWOMeasureTool.ControlPoint |
createControlPoint(Position position) |
protected WWOMeasureTool.ControlPointList |
createControlPoints() |
protected WWOMeasureTool.MeasureDisplay |
createMeasureDisplay() |
void |
dispose()
Disposes of any internal resources allocated by the object.
|
protected void |
doMoved() |
protected void |
doSelected(SelectEvent event) |
protected void |
dragSelected(SelectEvent event) |
double |
getArea() |
Position |
getCenterPosition() |
protected WWOMeasureTool.ControlPointList |
getControlPoints() |
double |
getFreeHandMinSpacing() |
double |
getHeight() |
String |
getLabel(String labelName) |
double |
getLength() |
String |
getMeasureShapeType() |
Angle |
getOrientation() |
ArrayList<? extends Position> |
getPositions() |
Renderable |
getShape() |
Rectangle2D.Double |
getShapeRectangle() |
UnitsFormat |
getUnitsFormat() |
double |
getWidth() |
WorldWindow |
getWwd() |
protected void |
highlight(Object o) |
protected boolean |
isActive() |
boolean |
isArmed() |
boolean |
isFreeHand() |
protected boolean |
isMoving() |
protected boolean |
isRegularShape() |
boolean |
isShowAnnotation() |
boolean |
isShowControlPoints() |
boolean |
isUseRubberBand() |
void |
mouseClicked(MouseEvent mouseEvent) |
void |
mouseDragged(MouseEvent mouseEvent) |
void |
mouseEntered(MouseEvent e) |
void |
mouseExited(MouseEvent e) |
void |
mouseMoved(MouseEvent mouseEvent) |
void |
mousePressed(MouseEvent mouseEvent) |
void |
mouseReleased(MouseEvent mouseEvent) |
void |
moveControlPoint(WWOMeasureTool.ControlPoint point)
Update the current measure shape according to a given control point position.
|
void |
moved(PositionEvent event) |
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 void |
moveToPosition(Position oldPosition,
Position newPosition) |
void |
removeControlPoint()
Remove the last control point from the current measure shape.
|
void |
selected(SelectEvent event) |
protected void |
setActive(boolean state) |
void |
setArmed(boolean armed)
Arms and disarms the measure tool controller.
|
void |
setFreeHand(boolean state) |
void |
setFreeHandMinSpacing(double distance) |
void |
setLabel(String labelName,
String label) |
protected void |
setMeasureShape(gov.nasa.worldwind.render.Polyline line,
String shapeType) |
protected void |
setMeasureShape(SurfaceShape newShape) |
protected void |
setMoving(boolean state) |
void |
setShowAnnotation(boolean state) |
void |
setShowControlPoints(boolean state) |
void |
setUnitsFormat(UnitsFormat unitsFormat) |
void |
setUseRubberBand(boolean state) |
void |
stageChanged(RenderingEvent event) |
protected void |
updateMeasureShape() |
protected void |
updatePositionsFromShape() |
protected void |
updateShapeControlPoints() |
protected void |
updateShapeProperties(String control,
Position newPosition) |
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
protected boolean active
protected boolean armed
protected WWOMeasureTool.ControlPointList controlPoints
protected RenderableLayer controlPointsLayer
protected BasicDragger dragger
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 EventListenerList eventListeners
protected boolean freeHand
protected double freeHandMinSpacing
protected WWOMeasureTool.ControlPoint lastPickedObject
protected WWOMeasureTool.MeasureDisplay measureDisplay
protected String measureShapeType
protected boolean moving
protected WWOMeasureTool.ControlPoint movingTarget
protected boolean regularShape
protected WWOMeasureTool.ControlPoint rubberBandTarget
protected Renderable shape
protected Position shapeCenterPosition
protected int shapeIntervals
protected Angle shapeOrientation
protected Rectangle2D.Double shapeRectangle
protected boolean showAnnotation
protected boolean showControlPoints
protected UnitsFormat unitsFormat
protected boolean useRubberBand
protected final WorldWindow wwd
public WWOMeasureTool(WorldWindow wwd, Renderable shape, String lineType, RenderableLayer controlPointsLayer)
public void addControlPoint()
public void addSelectListener(SelectListener listener)
protected void autoDisarm()
protected void callSelectListeners(SelectEvent event)
public void clear()
protected WWOMeasureTool.ControlPoint createControlPoint(Position position)
protected WWOMeasureTool.ControlPointList createControlPoints()
protected WWOMeasureTool.MeasureDisplay createMeasureDisplay()
public void dispose()
Disposable
dispose
in interface Disposable
protected void doMoved()
protected void doSelected(SelectEvent event)
protected void dragSelected(SelectEvent event)
public double getArea()
public Position getCenterPosition()
protected WWOMeasureTool.ControlPointList getControlPoints()
public double getFreeHandMinSpacing()
public double getHeight()
public double getLength()
public String getMeasureShapeType()
public Angle getOrientation()
public Renderable getShape()
public Rectangle2D.Double getShapeRectangle()
public UnitsFormat getUnitsFormat()
public double getWidth()
public WorldWindow getWwd()
protected void highlight(Object o)
protected boolean isActive()
public boolean isArmed()
public boolean isFreeHand()
protected boolean isMoving()
protected boolean isRegularShape()
public boolean isShowAnnotation()
public boolean isShowControlPoints()
public boolean isUseRubberBand()
public void mouseClicked(MouseEvent mouseEvent)
mouseClicked
in interface MouseListener
public void mouseDragged(MouseEvent mouseEvent)
mouseDragged
in interface MouseMotionListener
public void mouseEntered(MouseEvent e)
mouseEntered
in interface MouseListener
public void mouseExited(MouseEvent e)
mouseExited
in interface MouseListener
public void mouseMoved(MouseEvent mouseEvent)
mouseMoved
in interface MouseMotionListener
public void mousePressed(MouseEvent mouseEvent)
mousePressed
in interface MouseListener
public void mouseReleased(MouseEvent mouseEvent)
mouseReleased
in interface MouseListener
public void moveControlPoint(WWOMeasureTool.ControlPoint point)
point
- one of the shape control points.public void moved(PositionEvent event)
moved
in interface PositionListener
public void moveMeasureShape(Angle azimuth, Angle distance)
Angle
for a given
distance Angle
.azimuth
- the azimuth Angle
.distance
- the distance Angle
.public void removeControlPoint()
public void selected(SelectEvent event)
selected
in interface SelectListener
protected void setActive(boolean state)
public void setArmed(boolean armed)
armed
- true to arm the controller, false to disarm it.public void setFreeHand(boolean state)
public void setFreeHandMinSpacing(double distance)
protected void setMeasureShape(gov.nasa.worldwind.render.Polyline line, String shapeType)
protected void setMeasureShape(SurfaceShape newShape)
protected void setMoving(boolean state)
public void setShowAnnotation(boolean state)
public void setShowControlPoints(boolean state)
public void setUnitsFormat(UnitsFormat unitsFormat)
public void setUseRubberBand(boolean state)
public void stageChanged(RenderingEvent event)
stageChanged
in interface RenderingListener
protected void updateMeasureShape()
protected void updatePositionsFromShape()
protected void updateShapeControlPoints()