public abstract class Shape extends MapItem implements Capturable
Ellipse
Modifier and Type | Class and Description |
---|---|
static interface |
Shape.OnBasicLineStyleChangedListener |
static interface |
Shape.OnFillColorChangedListener
Shape fillColor property listener
|
static interface |
Shape.OnPointsChangedListener
Points property listener
|
static interface |
Shape.OnStrokeColorChangedListener
Shape strokeColor property listener
|
static interface |
Shape.OnStrokeWeightChangedListener
Shape strokeWeight property listener
|
static interface |
Shape.OnStyleChangedListener
Shape style property listener
|
MapItem.OnAltitudeModeChangedListener, MapItem.OnClickableChangedListener, MapItem.OnGroupChangedListener, MapItem.OnHeightChangedListener, MapItem.OnMetadataChangedListener, MapItem.OnTypeChangedListener, MapItem.OnVisibleChangedListener, MapItem.OnZOrderChangedListener
Modifier and Type | Field and Description |
---|---|
static int |
BASIC_LINE_STYLE_DASHED |
static int |
BASIC_LINE_STYLE_DOTTED |
static int |
BASIC_LINE_STYLE_OUTLINED |
static int |
BASIC_LINE_STYLE_SOLID
Basic line styles.
|
static int |
STYLE_FILLED_MASK |
static int |
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
Modifier | Constructor and Description |
---|---|
protected |
Shape(long serialId,
MetaDataHolder metadata,
java.lang.String uid) |
protected |
Shape(java.lang.String uid) |
Modifier and Type | Method and Description |
---|---|
void |
addOnBasicLineStyleChangedListener(Shape.OnBasicLineStyleChangedListener listener)
Listen for when the style is changed for the basic line style.
|
void |
addOnFillColorChangedListener(Shape.OnFillColorChangedListener listener)
Add a fillColor property listener
|
void |
addOnPointsChangedListener(Shape.OnPointsChangedListener listener)
Add a point changed property listener
|
void |
addOnStrokeColorChangedListener(Shape.OnStrokeColorChangedListener listener)
Add a strokeColor property listener
|
void |
addOnStrokeWeightChangedListener(Shape.OnStrokeWeightChangedListener listener)
Add a strokeWeight property listener
|
void |
addOnStyleChangedListener(Shape.OnStyleChangedListener listener)
Add a style property listener
|
void |
addStyleBits(int styleBits) |
void |
drawCanvas(CapturePP cap,
android.os.Bundle data)
Draw the item to the canvas
|
GeoPoint |
findTouchPoint()
Deprecated.
|
double |
getArea()
Returns the Area of the shape in meters
|
int |
getBasicLineStyle()
Returns the current state of the Basic Line Style.
|
abstract GeoBounds |
getBounds(MutableGeoBounds bounds)
The bounds of the shape
|
GeoPointMetaData |
getCenter()
Provides the center point for the Shape, or null if an error has occurred.
|
GeoPoint |
getClickPoint()
Look for the last touched point on this item
|
int |
getFillColor()
Get the fillColor property value
|
GeoPointMetaData |
getGeoPointMetaData()
Get point metadata for this shape, usually at the center point
|
int |
getIconColor()
Get the color this shape should use for its icon
Usually this is the stroke color or the "iconColor" meta int
|
abstract GeoPointMetaData[] |
getMetaDataPoints()
The array of points that make up the shape with the corresponding metadata.
|
double |
getPerimeterOrLength()
Returns the perimeter of a shape if closed otherwise will return the length of
of the open shape from start to end.
|
abstract GeoPoint[] |
getPoints()
The array of points without any metadata
|
int |
getStrokeColor()
Get the strokeColor property value
|
int |
getStrokeStyle()
Get the line style for this shape
For now acts a redirect for
getBasicLineStyle() for the sake
of having a more intuitive API |
double |
getStrokeWeight()
Get the strokeWeight property value
|
int |
getStyle()
Get the style property value
|
java.lang.String |
getTitle()
Get the title of this map item (display name)
|
protected void |
onBasicLineStyleChanged() |
protected void |
onFillColorChanged()
Invoked when the fillColor property changes
|
protected void |
onPointsChanged() |
protected void |
onStrokeColorChanged()
Invoked when the strokeColor property changes
|
protected void |
onStrokeStyleChanged()
The line/stroke style for this shape has been changed
|
protected void |
onStrokeWeightChanged()
Invoked when the strokeWeight property changes
|
protected void |
onStyleChanged()
Invoked when the style property changes
|
android.os.Bundle |
preDrawCanvas(CapturePP capture)
Save forwarded points to meta data holder
These will be used later in drawCanvas
|
void |
removeOnBasicLineStyleChangedListener(Shape.OnBasicLineStyleChangedListener listener)
Remove the listener for the basic line style change
|
void |
removeOnFillColorChangedListener(Shape.OnFillColorChangedListener listener)
Remove a fillColor property listener
|
void |
removeOnPointsChangedListener(Shape.OnPointsChangedListener listener)
Remove a point changed property listener
|
void |
removeOnStrokeColorChangedListener(Shape.OnStrokeColorChangedListener listener)
Remove a strokeColor property listener
|
void |
removeOnStrokeWeightChangedListener(Shape.OnStrokeWeightChangedListener listener)
Remove a strokeWeight property listener
|
void |
removeOnStyleChangedListener(Shape.OnStyleChangedListener listener)
Remove a style property listener
|
void |
removeStyleBits(int styleBits) |
void |
setBasicLineStyle(int basicLineStyle)
Change the basic line style for the shape from either SOLID, DASHED or DOTTED
|
void |
setColor(int color) |
void |
setColor(int color,
boolean includeAlpha)
Sets both the stroke and fill color while maintaining fill alpha
|
void |
setFillAlpha(int alpha)
Set the alpha value for the fill color
|
void |
setFillColor(int fillColor)
Set the fillColor property value
|
void |
setStrokeColor(int strokeColor)
Set the strokeColor property value
|
void |
setStrokeStyle(int lineStyle)
Get the line style for this shape
For now acts a redirect for
setBasicLineStyle(int) for the sake
of having a more intuitive API |
void |
setStrokeWeight(double strokeWeight)
Set the stroke weight of this shape's lines
Minimum = 1.0, maximum = 6.0
|
void |
setStyle(int style)
Set the style property value
|
void |
setTitle(java.lang.String title)
Set the title of this map item (display name)
|
void |
setTouchPoint(GeoPoint point)
Deprecated.
|
boolean |
wrap180()
Whether to wrap shapes that span more than 180 degrees over the IDL
instead of over the prime meridian
|
addOnAltitudeModeChangedListener, addOnClickableChangedListener, addOnGroupChangedListener, addOnHeightChangedListener, addOnMetadataChangedListener, addOnMetadataChangedListener, addOnTypeChangedListener, addOnVisibleChangedListener, addOnZOrderChangedListener, computeDistance, copyMetaData, createSerialId, dispose, 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, persist, refresh, removeFromGroup, removeMetaData, removeOnAltitudeModeChangedListener, removeOnClickableChangedListener, removeOnGroupChangedListener, removeOnHeightChangedListener, removeOnMetadataChangedListener, removeOnMetadataChangedListener, removeOnTypeChangedListener, removeOnVisibleChangedListener, removeOnZOrderChangedListener, setAltitudeMode, setClickable, setClickPoint, setEditable, setHashtags, setHeight, setMetaBoolean, 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 int STYLE_FILLED_MASK
public static final int STYLE_STROKE_MASK
public static final int BASIC_LINE_STYLE_SOLID
public static final int BASIC_LINE_STYLE_DASHED
public static final int BASIC_LINE_STYLE_DOTTED
public static final int BASIC_LINE_STYLE_OUTLINED
protected Shape(java.lang.String uid)
protected Shape(long serialId, MetaDataHolder metadata, java.lang.String uid)
public void addOnStyleChangedListener(Shape.OnStyleChangedListener listener)
listener
- the listenerpublic void removeOnStyleChangedListener(Shape.OnStyleChangedListener listener)
listener
- the listenerpublic void addOnStrokeColorChangedListener(Shape.OnStrokeColorChangedListener listener)
listener
- the listenerpublic void removeOnStrokeColorChangedListener(Shape.OnStrokeColorChangedListener listener)
listener
- the listenerpublic void addOnFillColorChangedListener(Shape.OnFillColorChangedListener listener)
listener
- the listenerpublic void removeOnFillColorChangedListener(Shape.OnFillColorChangedListener listener)
listener
- the listenerpublic void addOnStrokeWeightChangedListener(Shape.OnStrokeWeightChangedListener listener)
listener
- the listenerpublic void removeOnStrokeWeightChangedListener(Shape.OnStrokeWeightChangedListener listener)
listener
- the listenerpublic void addOnPointsChangedListener(Shape.OnPointsChangedListener listener)
listener
- the listenerpublic void removeOnPointsChangedListener(Shape.OnPointsChangedListener listener)
listener
- the listenerpublic java.lang.String getTitle()
MapItem
getTitle
in interface URIContent
getTitle
in class MapItem
public void setTitle(java.lang.String title)
MapItem
public int getStyle()
public void setStyle(int style)
style
- a bitfield of any STYLE_*_MASK flags from Shape or specific subclasspublic void addStyleBits(int styleBits)
public void removeStyleBits(int styleBits)
public int getStrokeColor()
Color
public void setStrokeColor(int strokeColor)
strokeColor
- An argb packed Color
public int getFillColor()
Color
public void setFillColor(int fillColor)
fillColor
- An argb packed Color
public void setFillAlpha(int alpha)
alpha
- Color alpha (0 to 255)public void setColor(int color, boolean includeAlpha)
color
- An argb packed Color
includeAlpha
- Include the color alpha in the fill colorpublic void setColor(int color)
public void setStrokeWeight(double strokeWeight)
strokeWeight
- a stroke line widthpublic double getStrokeWeight()
public final void setStrokeStyle(int lineStyle)
setBasicLineStyle(int)
for the sake
of having a more intuitive APIpublic final int getStrokeStyle()
getBasicLineStyle()
for the sake
of having a more intuitive APIpublic int getIconColor()
getIconColor
in interface URIContent
getIconColor
in class MapItem
protected void onStyleChanged()
protected void onStrokeColorChanged()
protected void onFillColorChanged()
protected void onStrokeWeightChanged()
public void setBasicLineStyle(int basicLineStyle)
basicLineStyle
- one of Shape.SOLID, Shape.DASHED or Shape.DOTTEDpublic int getBasicLineStyle()
public void addOnBasicLineStyleChangedListener(Shape.OnBasicLineStyleChangedListener listener)
listener
- the listener to be called when the basic style is changed.public void removeOnBasicLineStyleChangedListener(Shape.OnBasicLineStyleChangedListener listener)
listener
- the listener to be removed.protected void onBasicLineStyleChanged()
protected void onStrokeStyleChanged()
protected void onPointsChanged()
public GeoPointMetaData getCenter()
public GeoPointMetaData getGeoPointMetaData()
public GeoPoint getClickPoint()
MapItem
getClickPoint
in class MapItem
@Deprecated public GeoPoint findTouchPoint()
getClickPoint()
@Deprecated public void setTouchPoint(GeoPoint point)
MapItem.setClickPoint(GeoPoint)
public boolean wrap180()
public android.os.Bundle preDrawCanvas(CapturePP capture)
Capturable
preDrawCanvas
in interface Capturable
capture
- Capture instance (use forward() to convert)public void drawCanvas(CapturePP cap, android.os.Bundle data)
Capturable
drawCanvas
in interface Capturable
cap
- Canvas to draw to (use getCanvas())data
- Point data saved in preDrawCanvaspublic abstract GeoPoint[] getPoints()
public double getArea()
public double getPerimeterOrLength()
public abstract GeoPointMetaData[] getMetaDataPoints()
public abstract GeoBounds getBounds(MutableGeoBounds bounds)
bounds
- a preallocated bounds object