public class RangeAndBearingMapItem extends Arrow implements PointMapItem.OnPointChangedListener, MapItem.OnGroupChangedListener, MapEventDispatcher.OnMapEventListener, android.content.SharedPreferences.OnSharedPreferenceChangeListener, Exportable
Arrow.OnTextChangedListener
Shape.OnBasicLineStyleChangedListener, Shape.OnFillColorChangedListener, Shape.OnPointsChangedListener, Shape.OnStrokeColorChangedListener, Shape.OnStrokeWeightChangedListener, Shape.OnStyleChangedListener
MapItem.OnAltitudeModeChangedListener, MapItem.OnClickableChangedListener, MapItem.OnGroupChangedListener, MapItem.OnHeightChangedListener, MapItem.OnMetadataChangedListener, MapItem.OnTypeChangedListener, MapItem.OnVisibleChangedListener, MapItem.OnZOrderChangedListener
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
TAG |
_hitRadius, _hitRadiusSq, _mapView, _point1, _point2, _textColor, _touchPoint, text
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 |
---|
RangeAndBearingMapItem(PointMapItem pt1,
PointMapItem pt2,
MapView mapView,
java.lang.String uid)
Range And Bearing Map Item with the ability to make it persist in the database.
|
RangeAndBearingMapItem(PointMapItem pt1,
PointMapItem pt2,
MapView mapView,
java.lang.String uid,
boolean persist)
Range And Bearing Map Item with the ability to make it persist in the database.
|
RangeAndBearingMapItem(PointMapItem pt1,
PointMapItem pt2,
MapView mapView,
java.lang.String type,
java.lang.String uid,
boolean persist) |
RangeAndBearingMapItem(PointMapItem pt1,
PointMapItem pt2,
MapView mapView,
java.lang.String title,
java.lang.String uid,
int rangeUnits,
Angle bearingUnits,
NorthReference northRef,
int color)
Default persistent Range And Bearing Map Item.
|
RangeAndBearingMapItem(PointMapItem pt1,
PointMapItem pt2,
MapView mapView,
java.lang.String title,
java.lang.String uid,
int rangeUnits,
Angle bearingUnits,
NorthReference northRef,
int color,
boolean persist)
Range And Bearing Map Item with the ability to make it persist in the database.
|
Modifier and Type | Method and Description |
---|---|
void |
addMetaBooleanListener(DropDownReceiver listener) |
void |
allowSlantRangeToggle(boolean state)
Allows for the toggle of the slant range and is not actually the toggle of
the slant range
|
boolean |
containsEndpoint(PointMapItem pmi)
Return true if the given point map item is associated with the range and bearing
arrow
|
static RangeAndBearingMapItem |
createOrUpdateRABLine(java.lang.String uid,
PointMapItem pmi1,
PointMapItem pmi2)
Creates a persistent Range and Bearing map item.
|
static RangeAndBearingMapItem |
createOrUpdateRABLine(java.lang.String uid,
PointMapItem pmi1,
PointMapItem pmi2,
boolean persist)
Create a Range and Bearing map item, with a given uid and a start and end
point.
|
void |
dispose()
Clean up all of the resources associated with this MapItem, for destruction.
|
Angle |
getBearingUnits()
Returns the bearing units for the range and bearing arrow
|
double |
getInclination()
Returns the inclination of the range and bearing arrow.
|
NorthReference |
getNorthReference()
Returns the north reference for the range and bearing arrow
|
java.lang.String |
getPoint1CotType()
Return the type of point currently used as the start point.
|
PointMapItem |
getPoint1Item()
Return the start point for the range and bearing arrow
|
java.lang.String |
getPoint1UID()
Return the uid of point currently used as the start point.
|
java.lang.String |
getPoint2CotType()
Return the type of point currently used as the end point.
|
PointMapItem |
getPoint2Item()
Return the end point for the range and bearing arrow
|
java.lang.String |
getPoint2UID()
Return the uid of point currently used as the end point.
|
static RangeAndBearingMapItem |
getRABLine(java.lang.String uid)
Provided a unique identifier look up a Range and Bearing Map item.
|
int |
getRangeUnits()
Returns the range units for the range and bearing arrow
|
static java.util.List<RangeAndBearingMapItem> |
getUsers(PointMapItem point)
Retrieve users of an endpoint
|
boolean |
isLocked()
Returns true if the range and bearring arrow is length locked.
|
boolean |
isReversed()
Returns true if the arrow has been reversed.
|
boolean |
isSupported(java.lang.Class<?> target)
Check if this instance supports the specified target class type
|
void |
onItemAdded(MapItem item,
MapGroup group) |
void |
onItemRemoved(MapItem item,
MapGroup group) |
void |
onMapItemMapEvent(MapItem item,
MapEvent event) |
void |
onPointChanged(PointMapItem item) |
void |
onSharedPreferenceChanged(android.content.SharedPreferences sp,
java.lang.String key) |
void |
persist(MapEventDispatcher dispatcher,
android.os.Bundle extras,
java.lang.Class<?> clazz)
Dispatches a persist event for the MapItem.
|
void |
removePoint(MapItem endpoint)
Given a point, remove it from the range and bearing arrow.
|
void |
reverse()
Reverse the direction of the arrow.
|
static boolean |
sendAsCot(java.lang.String uid)
Dispatch the R+B Line, identified by it's UID, as CoT
|
void |
setBearingUnits(Angle bearingUnits)
Set this R&B MapItem's bearing units display option
|
void |
setDisplaySlantRange(boolean bSlantRange)
Sets the state of the slant range display to either true or false
|
void |
setMetaBoolean(java.lang.String key,
boolean value)
Inserts a Boolean value into the mapping of this Bundle, replacing
any existing value for the given key.
|
void |
setNorthReference(NorthReference northReference)
Set this R&B MapItem's north reference display option
NorthReference.TRUE = 0 (deg T) NorthReference.MAGNETIC = 1 (deg M) NorthReference.GRID = 2 (deg G) |
void |
setPoint1(GeoPointMetaData point)
Set the tail point of the arrow when not rendered in reverse.
|
void |
setPoint1(PointMapItem pmi)
Sets the map item for the start of the arrow.
|
void |
setPoint2(GeoPointMetaData point)
Set the head point of the arrow when not rendered in reverse.
|
void |
setPoint2(PointMapItem pmi)
Sets the map item for the start of the arrow.
|
void |
setRangeUnits(int rangeUnits)
Set this R&B MapItem's range units display option
|
void |
setTitle(java.lang.String title)
Set the title of this map item (display name)
|
boolean |
toggleLock()
Toggle length lock for the range and bearing arrow
|
void |
toggleSlantRange()
Toggles the current state of the slant range display for the range and bearing arrow.
|
protected GPXExportWrapper |
toGpx() |
java.lang.Object |
toObjectOf(java.lang.Class<?> target,
ExportFilters filters)
Export to the specified target class type
|
protected OGRFeatureExportWrapper |
toOgrGeomtry() |
addOnTextChangedListener, drawCanvas, getBounds, getCenter, getMetaDataPoints, getPoint1, getPoint2, getPoints, getText, getTextColor, preDrawCanvas, removeOnTextChangedListener, setAltitudeMode, setHitRadius, setText, setTextColor, update
addOnBasicLineStyleChangedListener, addOnFillColorChangedListener, addOnPointsChangedListener, addOnStrokeColorChangedListener, addOnStrokeWeightChangedListener, addOnStyleChangedListener, addStyleBits, findTouchPoint, getArea, getBasicLineStyle, getClickPoint, getFillColor, getGeoPointMetaData, getIconColor, getPerimeterOrLength, getStrokeColor, getStrokeStyle, getStrokeWeight, getStyle, getTitle, onBasicLineStyleChanged, onFillColorChanged, onPointsChanged, onStrokeColorChanged, onStrokeStyleChanged, onStrokeWeightChanged, onStyleChanged, removeOnBasicLineStyleChangedListener, removeOnFillColorChangedListener, removeOnPointsChangedListener, removeOnStrokeColorChangedListener, removeOnStrokeWeightChangedListener, removeOnStyleChangedListener, removeStyleBits, setBasicLineStyle, setColor, setColor, setFillAlpha, setFillColor, setStrokeColor, setStrokeStyle, setStrokeWeight, setStyle, setTouchPoint, wrap180
addOnAltitudeModeChangedListener, addOnClickableChangedListener, addOnGroupChangedListener, addOnHeightChangedListener, addOnMetadataChangedListener, addOnMetadataChangedListener, addOnTypeChangedListener, addOnVisibleChangedListener, addOnZOrderChangedListener, computeDistance, copyMetaData, createSerialId, getAltitudeMode, getClickable, getEditable, 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, onMetadataChanged, onRemoved, onTypeChanged, onVisibilityConditions, onVisibleChanged, onZOrderChanged, refresh, removeFromGroup, removeMetaData, removeOnAltitudeModeChangedListener, removeOnClickableChangedListener, removeOnGroupChangedListener, removeOnHeightChangedListener, removeOnMetadataChangedListener, removeOnMetadataChangedListener, removeOnTypeChangedListener, removeOnVisibleChangedListener, removeOnZOrderChangedListener, setClickable, setClickPoint, setEditable, setHashtags, setHeight, setMetaData, setMetaDouble, setMetaIntArray, setMetaInteger, setMetaLong, setMetaMap, setMetaParcelable, setMetaSerializable, setMetaString, setMetaStringArrayList, setMovable, setRadialMenu, setRemarks, setTag, setTouchable, setType, setVisible, setVisible, setZOrder, testOrthoHit, toString
get, getMetaData, getMetaDouble, getMetaIntArray, getMetaInteger, getMetaLong, getMetaMap, getMetaParcelable, getMetaSerializable, getMetaStringArrayList, hasMetaValue, setMetaDataImpl, toggleMetaData
public static final java.lang.String TAG
public RangeAndBearingMapItem(PointMapItem pt1, PointMapItem pt2, MapView mapView, java.lang.String title, java.lang.String uid, int rangeUnits, Angle bearingUnits, NorthReference northRef, int color)
public RangeAndBearingMapItem(PointMapItem pt1, PointMapItem pt2, MapView mapView, java.lang.String title, java.lang.String uid, int rangeUnits, Angle bearingUnits, NorthReference northRef, int color, boolean persist)
pt1
- the start point for the arrowpt2
- the end point for the arrowmapView
- the map viewtitle
- the title or label of the arrowuid
- the unique identifierrangeUnits
- the range units as one of Span.ENGLISH, Span.METRIC, Span.NMbearingUnits
- the bearing unitsnorthRef
- the north referencecolor
- the color of the arrowpersist
- true if it will persist past application restartspublic RangeAndBearingMapItem(PointMapItem pt1, PointMapItem pt2, MapView mapView, java.lang.String uid)
pt1
- the start point for the arrowpt2
- the end point for the arrowmapView
- the map viewuid
- the unique identifierpublic RangeAndBearingMapItem(PointMapItem pt1, PointMapItem pt2, MapView mapView, java.lang.String uid, boolean persist)
pt1
- the start point for the arrowpt2
- the end point for the arrowmapView
- the map viewuid
- the unique identifierpersist
- true if it will persist past application restartspublic RangeAndBearingMapItem(PointMapItem pt1, PointMapItem pt2, MapView mapView, java.lang.String type, java.lang.String uid, boolean persist)
public static RangeAndBearingMapItem getRABLine(java.lang.String uid)
uid
- the uid describing the range and bearing map itempublic static RangeAndBearingMapItem createOrUpdateRABLine(java.lang.String uid, PointMapItem pmi1, PointMapItem pmi2)
uid
- the unique identifier for the range and bearing linepmi1
- the map item to attach to the start of the arrowpmi2
- the map item to attach to the end of the arrow.public static RangeAndBearingMapItem createOrUpdateRABLine(java.lang.String uid, PointMapItem pmi1, PointMapItem pmi2, boolean persist)
uid
- the unique identifier for the range and bearing linepmi1
- the point map item for the start of the arrowpmi2
- the point map item for the end of the arrowpersist
- if the arrow is to persist after a restart.public boolean containsEndpoint(PointMapItem pmi)
pmi
- the point map item to checkpublic static boolean sendAsCot(java.lang.String uid)
uid
- UID of the RangeAndBearingMapItem line to send as CoTpublic void setPoint1(PointMapItem pmi)
public void setPoint2(PointMapItem pmi)
public void setPoint1(GeoPointMetaData point)
Arrow
public void setPoint2(GeoPointMetaData point)
Arrow
public boolean isReversed()
public void reverse()
public void toggleSlantRange()
public boolean toggleLock()
public boolean isLocked()
public void setBearingUnits(Angle bearingUnits)
bearingUnits
- - The constant int associated with the bearing units preference.public void setRangeUnits(int rangeUnits)
rangeUnits
- - The constant int associated with the range units preference.
Can be one of Span.METRIC, Span.ENGLISH, or Span.NMjava.lang.IllegalStateException
- if the range unit is not one of the followingpublic void setNorthReference(NorthReference northReference)
northReference
- - The constant int associated with the north reference preference.public void allowSlantRangeToggle(boolean state)
state
- the state togglable or not.public void setDisplaySlantRange(boolean bSlantRange)
bSlantRange
- true shows the distance as slant range.public double getInclination()
public Angle getBearingUnits()
public int getRangeUnits()
public NorthReference getNorthReference()
public void setTitle(java.lang.String title)
MapItem
public void persist(MapEventDispatcher dispatcher, android.os.Bundle extras, java.lang.Class<?> clazz)
MapItem
By default, the event will be dispatched with the extra, "internal"
, set to
true
. This may be overridden by setting the parameter in
persistExtras
to an alternate value.
persist
in class MapItem
dispatcher
- The event dispatcherextras
- An optional bundle of extras to be sent with the event; may be
null
clazz
- the class that made this persist call
See MapEvent.ITEM_PERSIST
public PointMapItem getPoint1Item()
public PointMapItem getPoint2Item()
public void dispose()
MapItem
public void onItemAdded(MapItem item, MapGroup group)
onItemAdded
in interface MapItem.OnGroupChangedListener
public void onItemRemoved(MapItem item, MapGroup group)
onItemRemoved
in interface MapItem.OnGroupChangedListener
public static java.util.List<RangeAndBearingMapItem> getUsers(PointMapItem point)
point
- The point to check for userspublic void onPointChanged(PointMapItem item)
onPointChanged
in interface PointMapItem.OnPointChangedListener
public void onMapItemMapEvent(MapItem item, MapEvent event)
onMapItemMapEvent
in interface MapEventDispatcher.OnMapEventListener
public void onSharedPreferenceChanged(android.content.SharedPreferences sp, java.lang.String key)
onSharedPreferenceChanged
in interface android.content.SharedPreferences.OnSharedPreferenceChangeListener
public void removePoint(MapItem endpoint)
endpoint
- the point to removepublic java.lang.String getPoint1CotType()
public java.lang.String getPoint2CotType()
public java.lang.String getPoint1UID()
public java.lang.String getPoint2UID()
protected OGRFeatureExportWrapper toOgrGeomtry()
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 void addMetaBooleanListener(DropDownReceiver listener)
public void setMetaBoolean(java.lang.String key, boolean value)
MetaDataHolder
setMetaBoolean
in interface MetaDataHolder
setMetaBoolean
in class MapItem
key
- a String, or nullvalue
- a boolean