public class LineBuilder extends AVListImpl
setArmed(boolean)
method with an argument of true. LineBuilder
object by calling its setArmed(boolean)
method with an argument of false. While the line builder is armed, pressing and immediately releasing mouse button one while also pressing the control key (Ctl) removes the last position from the polyline.
Mouse events the line builder acts on while armed are marked as consumed. These events are mouse pressed, released, clicked and dragged. These events are not acted on while the line builder is not armed. The builder can be continuously armed and rearmed to allow intervening maneuvering of the globe while building a polyline. A user can add positions, pause entry, maneuver the view, then continue entering positions.
Arming and disarming the line builder does not change the contents or attributes of the line builder's layer.
The polyline and a layer containing it may be specified when a LineBuilder
is constructed.
This class contains a main
method implementing an example program illustrating use of
LineBuilder
.
Constructor and Description |
---|
LineBuilder(WorldWindow wwd,
RenderableLayer lineLayer,
gov.nasa.worldwind.render.Polyline polyline)
Construct a new line builder using the specified polyline and layer and drawing events from the specified world
window.
|
Modifier and Type | Method and Description |
---|---|
void |
clear()
Removes all positions from the polyline.
|
RenderableLayer |
getLayer()
Returns the layer holding the polyline being created.
|
gov.nasa.worldwind.render.Polyline |
getLine()
Returns the layer currently used to display the polyline.
|
boolean |
isArmed()
Identifies whether the line builder is armed.
|
void |
setArmed(boolean armed)
Arms and disarms the line builder.
|
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
public LineBuilder(WorldWindow wwd, RenderableLayer lineLayer, gov.nasa.worldwind.render.Polyline polyline)
wwd
- the WorldWindow to draw events from.lineLayer
- the layer holding the polyline. May be null, in which case a new layer is created.polyline
- the polyline object to build. May be null, in which case a new polyline is created.public void clear()
public RenderableLayer getLayer()
public gov.nasa.worldwind.render.Polyline getLine()
public boolean isArmed()
public void setArmed(boolean armed)
armed
- true to arm the line builder, false to disarm it.