public class EditablePolyline extends Polyline implements AnchoredMapItem, Exportable, MapItem.OnZOrderChangedListener, MapItem.OnGroupChangedListener
Modifier and Type | Class and Description |
---|---|
static interface |
EditablePolyline.ActionProviderInterface
Outside tools or classes that extend EditablePolyline or interact intimately with it may
choose to provide an implementation of this interface if they need to implement their own
EditActions, potentially overriding the default behaviors of the built in ones.
|
class |
EditablePolyline.ExchangePointAction |
class |
EditablePolyline.InsertPointAction |
class |
EditablePolyline.MovePointAction
******** UNDO Actions ***************
|
static interface |
EditablePolyline.OnEditableChangedListener
Editable state listener
|
class |
EditablePolyline.RemoveMarkerAction
Removes a marker, does *not* delete the underlying point though.
|
class |
EditablePolyline.RemovePointAction |
Polyline.OnAltitudeModeChangedListener, Polyline.OnHeightStyleChangedListener, Polyline.OnLabelsChangedListener, Polyline.OnLabelTextSizeChanged
Shape.OnBasicLineStyleChangedListener, Shape.OnFillColorChangedListener, Shape.OnPointsChangedListener, Shape.OnStrokeColorChangedListener, Shape.OnStrokeWeightChangedListener, Shape.OnStyleChangedListener
MapItem.OnClickableChangedListener, MapItem.OnGroupChangedListener, MapItem.OnHeightChangedListener, MapItem.OnMetadataChangedListener, MapItem.OnTypeChangedListener, MapItem.OnVisibleChangedListener, MapItem.OnZOrderChangedListener
Modifier and Type | Field and Description |
---|---|
protected EditablePolyline.ActionProviderInterface |
_actionProvider |
protected Marker |
_shapeMarker |
protected android.content.Context |
context |
protected java.util.Map<java.lang.String,PointMapItem> |
controlPoints |
protected java.util.SortedMap<java.lang.Integer,PointMapItem> |
indexToMarker |
protected java.util.SortedMap<java.lang.Integer,PointMapItem> |
indexToMarker2 |
protected MapView |
mapView |
protected java.util.Map<PointMapItem,java.lang.Integer> |
markerToIndex |
static java.lang.String |
TAG |
_points, DEFAULT_MAX_LABEL_RENDER_RESOLUTION, DEFAULT_MAX_LINE_RENDER_RESOLUTION, DEFAULT_MIN_LABEL_RENDER_RESOLUTION, DEFAULT_MIN_LINE_RENDER_RESOLUTION, HEIGHT_EXTRUDE_CENTER_ALT, HEIGHT_EXTRUDE_DEFAULT, HEIGHT_EXTRUDE_MAX_ALT, HEIGHT_EXTRUDE_MIN_ALT, HEIGHT_EXTRUDE_PER_POINT, HEIGHT_STYLE_NONE, HEIGHT_STYLE_OUTLINE, HEIGHT_STYLE_OUTLINE_SIMPLE, HEIGHT_STYLE_POLYGON, HEIGHT_STYLE_TOP_ONLY, minimumBoundingBox, PARTITION_SIZE, STYLE_CLOSED_MASK, STYLE_OUTLINE_HALO_MASK, STYLE_OUTLINE_STROKE_MASK
BASIC_LINE_STYLE_DASHED, BASIC_LINE_STYLE_DOTTED, BASIC_LINE_STYLE_OUTLINED, BASIC_LINE_STYLE_SOLID, STYLE_FILLED_MASK, STYLE_STROKE_MASK
CLICKABLE_DEFAULT, EDITABLE_DEFAULT, EMPTY_TYPE, HIT_RATIO_DEFAULT, MOVABLE_DEFAULT, VISIBLE_DEFAULT, ZORDER_DEFAULT, ZORDER_HITTEST_COMPARATOR, ZORDER_RENDER_COMPARATOR
metadata
Constructor and Description |
---|
EditablePolyline(MapView mapView,
long serialId,
MetaDataHolder metadata,
java.lang.String uid) |
EditablePolyline(MapView mapView,
java.lang.String uid) |
Modifier and Type | Method and Description |
---|---|
protected void |
addListeners(PointMapItem item) |
boolean |
addMarker(int pointIndex,
PointMapItem item)
Adds a marker to an existing route at a specific index.
|
boolean |
addMarker(PointMapItem item)
Adds a marker to an existing route at the end.
|
boolean |
addMarkers(int pointIndex,
PointMapItem[] items)
Bulk insert of waypoints.
|
void |
addOnEditableChangedListener(EditablePolyline.OnEditableChangedListener listener)
Add a points property listener
|
boolean |
addPoint(GeoPointMetaData point) |
boolean |
addPoint(int index,
GeoPointMetaData point) |
protected boolean |
addPointNoSync(int index,
GeoPointMetaData point) |
void |
clear() |
protected void |
clearPoints() |
protected void |
clearPointsImpl(boolean notifyPointsChanged) |
void |
clearWithoutNotify()
Used in very specific cases where this operation will be chained
with other operations that will ultimately call notify.
|
protected Folder |
createKmlGeometry(Folder folder,
Placemark outerPlacemark,
ExtendedData edata,
java.lang.String styleId,
java.util.List<Feature> folderFeatures) |
protected Placemark |
createOuterPlacemark(java.lang.String styleId) |
void |
delete(MapGroup childItemGroup) |
protected int |
determineIfFilled() |
void |
drawCanvas(CapturePP cap,
android.os.Bundle data)
Draw the item to the canvas
|
EditablePolyline.ActionProviderInterface |
getActionProvider()
Gets the current ActionProvider implementation if a non-default one has been specified.
|
PointMapItem |
getAnchorItem()
Get the anchor marker for this item
|
GeoPointMetaData |
getAvgAltitude() |
GeoPointMetaData |
getCenter()
Provides the center point for the Shape, or null if an error has occurred.
|
int |
getColor() |
protected java.lang.String |
getCornerMenu()
Provides a shape menu to be used when the shape corner is touched.
|
boolean |
getEditable() |
boolean |
getFilled() |
int |
getIndexOfMarker(PointMapItem point)
Returns the index of a way point
For control points, see
#getIndexOfPoint(PointMapItem) |
int |
getIndexOfPoint(GeoPointMetaData point)
Given a point on a Polyline, return the index of the point or -1 if the point is not found.
|
protected java.lang.String |
getLineMenu()
Provides a shape menu to be used when the shape line is touched.
|
int |
getLineStyle() |
Marker |
getMarker() |
PointMapItem |
getMarker(int index)
Given an index on the EditablePolyline, return the PointMapItem at that position or null if no
PointMapItem exists.
|
GeoPointMetaData |
getMaxAltitude() |
GeoPointMetaData |
getMinAltitude() |
int |
getNumPoints()
Returns the number of points for a given polyline.
|
GeoPointMetaData |
getPoint(int index)
For a given index, return the point.
|
PointMapItem |
getPointMapItem(int index)
Given an index on the EditablePolyline, return the PointMapItem at that position, regardless
of whether it is a way point or a control point.
|
PointMapItem[] |
getPointMapItemArray() |
java.util.List<PointMapItem> |
getPointMapItems()
Gets a defensive copy of all of the PointMapItems contained in the line.
|
Marker |
getShapeMarker() |
protected java.lang.String |
getShapeMenu()
Provides a shape menu to be used when the shape is touched.
|
java.lang.String |
getTitle()
Returns the title of the editable polyline.
|
static java.lang.String |
getUIDKey()
This should be considered read only for 99% of use cases, in order to allow common
functionality to work instead of needing to reimplement things like fine position of points
on an editable polyline for every subclass.
|
Undoable |
getUndoable() |
boolean |
hasMarker(PointMapItem item)
True if the point is in this route
|
void |
hideLabels(boolean state) |
boolean |
isBulkOperation() |
boolean |
isClosed() |
boolean |
isSupported(java.lang.Class<?> target)
Check if this instance supports the specified target class type
|
protected java.util.List<Data> |
kmlDataList() |
protected java.lang.String |
kmlFolderName() |
void |
moveClosedSet(GeoPointMetaData oldPoint,
GeoPointMetaData newPoint)
Move a closed EditablePolyline from the previous center point to a new point
|
void |
onItemAdded(MapItem item,
MapGroup newParent) |
void |
onItemRemoved(MapItem item,
MapGroup oldParent) |
protected void |
onPointsChanged() |
protected void |
onVisibleChanged()
Invokes when the visible property changes
|
void |
onZOrderChanged(MapItem item) |
android.os.Bundle |
preDrawCanvas(CapturePP capture)
Save forwarded points to meta data holder
These will be used later in drawCanvas
|
protected void |
removeListeners(PointMapItem item) |
boolean |
removeMarker(int index) |
protected boolean |
removeMarker(int index,
boolean notExchangingPoints,
boolean partOfRemovePoint)
Removes a waypoint from the route requested.
|
boolean |
removeMarker(PointMapItem item) |
protected boolean |
removeMarker(PointMapItem item,
boolean notExchangingPoints)
Removes a waypoint from the route requested.
|
protected PointMapItem |
removeMarkerNoSync(int index) |
void |
removeOnEditableChangedListener(EditablePolyline.OnEditableChangedListener listener)
Remove a points property listener
|
void |
removePoint(int index) |
void |
resetAlpha()
Changes route's transparency back to it's normal value
|
void |
reverse()
Reverse the entire polyline - mostly used in the case of turning an infil into an exfil.
|
void |
setAbsoluteKMLElev(boolean forceAltitude)
Deprecated.
|
void |
setAlpha(int alpha)
Temporarily change the transparency of the route's color.
|
protected void |
setBulkOperation(boolean bulk) |
void |
setClickable(boolean state)
Toggle the touchability of a route.
|
protected void |
setClosed(boolean closed) |
void |
setColor(int color) |
void |
setEditable(boolean editable)
Styles this route to indicate that it's the currently editable route, and also makes it's
invisible handles visible so they can be interacted with.
|
void |
setFillColor(int color)
Set the fillColor property value
|
void |
setFilled(boolean filled) |
void |
setLineStyle(int style)
STYLE_SOLID = 0, STYLE_DOTTED = 1, STYLE_DASHED = 2 and STYLE_OUTLINED = 3
|
void |
setLocked(boolean locked) |
void |
setMarker(int pointIndex,
PointMapItem item) |
protected void |
setMarkerNoSync(int pointIndex,
PointMapItem item) |
boolean |
setPoint(int index,
GeoPointMetaData point) |
boolean |
setPoint(int index,
GeoPointMetaData point,
boolean skipIfEquals)
Set a point in this polyline
|
boolean |
setPoints(java.util.List<GeoPointMetaData> points,
android.util.SparseArray<PointMapItem> markers)
Bulk operation for setting both the points and markers for a line
with as little overhead as possible
|
protected void |
setShapeMarker(Marker marker)
A Marker used to invoke the set's menu.
|
void |
setStrokeColor(int strokeColor)
Set the strokeColor property value
|
void |
setStrokeWeight(double weight)
Set the stroke weight of this shape's lines
Minimum = 1.0, maximum = 6.0
|
void |
setTitle(java.lang.String title)
Set the title of this map item (display name)
|
void |
setUndoable(Undoable undo) |
void |
setZOrder(double zOrder)
Set the ascending order of the MapItem.
|
boolean |
shouldDisplayVertices(double mapScale) |
protected GeoPoint |
testLinesHit(MapView view,
int startIdx,
int endIdx,
Vector2D touch)
Deprecated.
|
protected GeoPoint |
testLinesHit(MapView view,
int startIdx,
int endIdx,
Vector2D touch,
GeoPoint gp)
Deprecated.
Implementation moved to
AbstractGLMapItem2.hitTest(MapRenderer3, HitTestQueryParameters) |
protected int |
testPointsHit(MapView view,
int startIdx,
int endIdx,
android.graphics.RectF hitRect,
GeoBounds hitBox)
Deprecated.
Implementation moved to
AbstractGLMapItem2.hitTest(MapRenderer3, HitTestQueryParameters) |
protected CotEvent |
toCot()
Produce a CoT message that represents the Route
|
protected GPXExportWrapper |
toGpx() |
protected Folder |
toKml() |
protected KMZFolder |
toKmz() |
java.lang.Object |
toObjectOf(java.lang.Class<?> target,
ExportFilters filters)
Export to the specified target class type
|
addHeightStyle, addOnHeightStyleChangedListener, addOnLabelsChangedListener, addOnLabelTextSizeChangedListener, getBounds, getHeightExtrudeMode, getHeightStyle, getLabels, getLabelTextSize, getLabelTypeface, getLineLabel, getMetaDataPoints, getPerimeterOrLength, getPoints, getPoints, getPoints, getRelativeBounds, getTotalDistance, onHeightStyleChanged, onLabelsChanged, onLabelTextSizeChanged, onMetadataChanged, removeHeightStyle, removeOnHeightStyleChangedListener, removeOnLabelsChangedListener, removeOnLabelTextSizeChangedListner, setHeightExtrudeMode, setHeightStyle, setLabels, setLabelTextSize, setLabelTextSize, setLabelTextTypeface, setLineLabel, setMaxLabelRenderResolution, setMaxRenderResolution, setMinLabelRenderResolution, setMinRenderResolution, setPoints, setPoints, setPoints, setPoints
addOnBasicLineStyleChangedListener, addOnFillColorChangedListener, addOnPointsChangedListener, addOnStrokeColorChangedListener, addOnStrokeWeightChangedListener, addOnStyleChangedListener, addStyleBits, findTouchPoint, getArea, getBasicLineStyle, getClickPoint, getFillColor, getGeoPointMetaData, getIconColor, getStrokeColor, getStrokeStyle, getStrokeWeight, getStyle, onBasicLineStyleChanged, onFillColorChanged, onStrokeColorChanged, onStrokeStyleChanged, onStrokeWeightChanged, onStyleChanged, removeOnBasicLineStyleChangedListener, removeOnFillColorChangedListener, removeOnPointsChangedListener, removeOnStrokeColorChangedListener, removeOnStrokeWeightChangedListener, removeOnStyleChangedListener, removeStyleBits, setBasicLineStyle, setColor, setFillAlpha, setStrokeStyle, setStyle, setTouchPoint, wrap180
addOnAltitudeModeChangedListener, addOnClickableChangedListener, addOnGroupChangedListener, addOnHeightChangedListener, addOnMetadataChangedListener, addOnMetadataChangedListener, addOnTypeChangedListener, addOnVisibleChangedListener, addOnZOrderChangedListener, computeDistance, copyMetaData, createSerialId, dispose, getAltitudeMode, getClickable, getGroup, getHashtags, getHeight, getHitRadius, getIconDrawable, getMetaBoolean, getMetaString, getMovable, getRadialMenuPath, getRemarks, getRemarksKey, getSerialId, getTag, getType, getUID, getUniqueMapItemName, getURI, getVisible, getVisible, getZOrder, isTouchable, notifyMetadataChanged, onAdded, onAltitudeModeChanged, onClickableChanged, onGroupChanged, onHeightChanged, onRemoved, onTypeChanged, onVisibilityConditions, onZOrderChanged, persist, refresh, removeFromGroup, removeMetaData, removeOnAltitudeModeChangedListener, removeOnClickableChangedListener, removeOnGroupChangedListener, removeOnHeightChangedListener, removeOnMetadataChangedListener, removeOnMetadataChangedListener, removeOnTypeChangedListener, removeOnVisibleChangedListener, removeOnZOrderChangedListener, setAltitudeMode, setClickPoint, setHashtags, setHeight, setMetaBoolean, setMetaData, setMetaDouble, setMetaIntArray, setMetaInteger, setMetaLong, setMetaMap, setMetaParcelable, setMetaSerializable, setMetaString, setMetaStringArrayList, setMovable, setRadialMenu, setRemarks, setTag, setTouchable, setType, setVisible, setVisible, testOrthoHit, toString
get, getMetaData, getMetaDouble, getMetaIntArray, getMetaInteger, getMetaLong, getMetaMap, getMetaParcelable, getMetaSerializable, getMetaStringArrayList, hasMetaValue, setMetaDataImpl, toggleMetaData
public static final java.lang.String TAG
protected Marker _shapeMarker
protected final MapView mapView
protected final android.content.Context context
protected final java.util.Map<java.lang.String,PointMapItem> controlPoints
protected final java.util.Map<PointMapItem,java.lang.Integer> markerToIndex
protected final java.util.SortedMap<java.lang.Integer,PointMapItem> indexToMarker
protected final java.util.SortedMap<java.lang.Integer,PointMapItem> indexToMarker2
protected EditablePolyline.ActionProviderInterface _actionProvider
public EditablePolyline(MapView mapView, java.lang.String uid)
public EditablePolyline(MapView mapView, long serialId, MetaDataHolder metadata, java.lang.String uid)
public void onItemAdded(MapItem item, MapGroup newParent)
onItemAdded
in interface MapItem.OnGroupChangedListener
public void onItemRemoved(MapItem item, MapGroup oldParent)
onItemRemoved
in interface MapItem.OnGroupChangedListener
public void onZOrderChanged(MapItem item)
onZOrderChanged
in interface MapItem.OnZOrderChangedListener
public void delete(MapGroup childItemGroup)
protected void setShapeMarker(Marker marker)
marker
- the marker used for the shapes menupublic Marker getShapeMarker()
public void setClickable(boolean state)
setClickable
in class MapItem
public void hideLabels(boolean state)
public void setLocked(boolean locked)
@Deprecated protected final int testPointsHit(MapView view, int startIdx, int endIdx, android.graphics.RectF hitRect, GeoBounds hitBox)
AbstractGLMapItem2.hitTest(MapRenderer3, HitTestQueryParameters)
@Deprecated protected final GeoPoint testLinesHit(MapView view, int startIdx, int endIdx, Vector2D touch)
testLinesHit(MapView, int, int, Vector2D, GeoPoint)
@Deprecated protected final GeoPoint testLinesHit(MapView view, int startIdx, int endIdx, Vector2D touch, GeoPoint gp)
AbstractGLMapItem2.hitTest(MapRenderer3, HitTestQueryParameters)
protected java.lang.String getShapeMenu()
protected java.lang.String getLineMenu()
protected java.lang.String getCornerMenu()
public final Marker getMarker()
public void setUndoable(Undoable undo)
public Undoable getUndoable()
public boolean isClosed()
protected void setClosed(boolean closed)
protected void setBulkOperation(boolean bulk)
public boolean isBulkOperation()
public void moveClosedSet(GeoPointMetaData oldPoint, GeoPointMetaData newPoint)
oldPoint
- the old point to act as the center pointnewPoint
- the new point to act as the center point, important to shift the entire polygon by a specific amount.public int getNumPoints()
public GeoPointMetaData getPoint(int index)
index
- the indexpublic int getIndexOfPoint(GeoPointMetaData point)
point
- the point to findpublic PointMapItem getMarker(int index)
public PointMapItem getPointMapItem(int index)
index
- Positionpublic java.util.List<PointMapItem> getPointMapItems()
public PointMapItem[] getPointMapItemArray()
public int getIndexOfMarker(PointMapItem point)
#getIndexOfPoint(PointMapItem)
point
- Way pointpublic int getColor()
public void setStrokeColor(int strokeColor)
Shape
setStrokeColor
in class Shape
strokeColor
- An argb packed Color
public void setStrokeWeight(double weight)
Shape
setStrokeWeight
in class Shape
weight
- a stroke line widthpublic void setLineStyle(int style)
public int getLineStyle()
public void setFilled(boolean filled)
public EditablePolyline.ActionProviderInterface getActionProvider()
public boolean getFilled()
public PointMapItem getAnchorItem()
AnchoredMapItem
getAnchorItem
in interface AnchoredMapItem
public GeoPointMetaData getCenter()
Shape
public GeoPointMetaData getAvgAltitude()
public GeoPointMetaData getMaxAltitude()
public GeoPointMetaData getMinAltitude()
public void setFillColor(int color)
Shape
setFillColor
in class Shape
color
- An argb packed Color
protected void onVisibleChanged()
MapItem
onVisibleChanged
in class MapItem
protected void onPointsChanged()
onPointsChanged
in class Polyline
public void reverse()
public boolean hasMarker(PointMapItem item)
item
- the map item to check against.public void setAlpha(int alpha)
alpha
- New alpha valuepublic void resetAlpha()
public boolean getEditable()
getEditable
in class MapItem
public void setEditable(boolean editable)
setEditable
in class MapItem
editable
- Whether editable styling should be enabled or disabled.public boolean shouldDisplayVertices(double mapScale)
@Deprecated public void setAbsoluteKMLElev(boolean forceAltitude)
forceAltitude
- true if we are going to force the polyline to be at altitudepublic void setZOrder(double zOrder)
MapItem
public boolean removeMarker(PointMapItem item)
protected boolean removeMarker(PointMapItem item, boolean notExchangingPoints)
item
- the waypoint to be removednotExchangingPoints
- False if we're about to add a point to replace the one we're now
removing. Turns off behavior which will be made obsolete once the insertion
occurs.public boolean removeMarker(int index)
protected final boolean removeMarker(int index, boolean notExchangingPoints, boolean partOfRemovePoint)
index
- index of item to deletenotExchangingPoints
- False if we're about to add a point to replace the one we're now
removing. Turns off behavior which will be made obsolete once the insertion
occurs.protected PointMapItem removeMarkerNoSync(int index)
public void removePoint(int index)
public boolean addMarker(PointMapItem item)
item
- the point map item to add.public boolean addMarker(int pointIndex, PointMapItem item)
pointIndex
- the position to add the marker after.item
- the point map item to add.public boolean addMarkers(int pointIndex, PointMapItem[] items)
pointIndex
- the position to add the marker after.items
- the array of point map items to add.public void setMarker(int pointIndex, PointMapItem item)
protected void setMarkerNoSync(int pointIndex, PointMapItem item)
public boolean addPoint(GeoPointMetaData point)
public boolean addPoint(int index, GeoPointMetaData point)
protected boolean addPointNoSync(int index, GeoPointMetaData point)
public boolean setPoint(int index, GeoPointMetaData point, boolean skipIfEquals)
index
- Point indexpoint
- Point locationskipIfEquals
- True to skip operation if the point hasn't changedpublic boolean setPoint(int index, GeoPointMetaData point)
protected void removeListeners(PointMapItem item)
protected void addListeners(PointMapItem item)
protected void clearPoints()
public void clear()
public void clearWithoutNotify()
protected void clearPointsImpl(boolean notifyPointsChanged)
public static java.lang.String getUIDKey()
public java.lang.String getTitle()
getTitle
in interface URIContent
getTitle
in class Shape
public void setTitle(java.lang.String title)
MapItem
public void addOnEditableChangedListener(EditablePolyline.OnEditableChangedListener listener)
listener
- the listenerpublic void removeOnEditableChangedListener(EditablePolyline.OnEditableChangedListener listener)
listener
- the listenerprotected CotEvent toCot()
protected Folder toKml()
protected Placemark createOuterPlacemark(java.lang.String styleId)
protected int determineIfFilled()
protected java.lang.String kmlFolderName()
protected java.util.List<Data> kmlDataList()
protected Folder createKmlGeometry(Folder folder, Placemark outerPlacemark, ExtendedData edata, java.lang.String styleId, java.util.List<Feature> folderFeatures)
protected KMZFolder toKmz()
protected GPXExportWrapper toGpx()
public boolean isSupported(java.lang.Class<?> target)
Exportable
isSupported
in interface Exportable
target
- the target classpublic java.lang.Object toObjectOf(java.lang.Class<?> target, ExportFilters filters)
Exportable
toObjectOf
in interface Exportable
target
- the target classfilters
- Allows ExportMarshal
instances to filter e.g. based
on geographic region or other criteriapublic android.os.Bundle preDrawCanvas(CapturePP capture)
Capturable
preDrawCanvas
in interface Capturable
preDrawCanvas
in class Polyline
capture
- Capture instance (use forward() to convert)public void drawCanvas(CapturePP cap, android.os.Bundle data)
Capturable
drawCanvas
in interface Capturable
drawCanvas
in class Polyline
cap
- Canvas to draw to (use getCanvas())data
- Point data saved in preDrawCanvaspublic boolean setPoints(java.util.List<GeoPointMetaData> points, android.util.SparseArray<PointMapItem> markers)
points
- Complete list of pointsmarkers
- Sparse array (int map) of markers