public abstract class CircleCreationTool extends Tool implements MapEventDispatcher.MapEventDispatchListener
Modifier and Type | Field and Description |
---|---|
protected DrawingCircle |
_circle |
protected android.content.Context |
_context |
protected MapGroup |
_mapGroup |
protected DrawingPreferences |
_prefs |
protected Marker |
_tempCenter |
_identifier, _mapListenerCount, _mapView
Constructor and Description |
---|
CircleCreationTool(MapView mapView,
MapGroup mapGroup,
java.lang.String toolIdentifier) |
Modifier and Type | Method and Description |
---|---|
protected abstract void |
addCircle(DrawingCircle circle)
Add the circle to map
|
protected DrawingCircle |
createCircle()
Create a new empty circle to be used by this tool
|
void |
dispose()
Called only by the parent during final cleanup activities.
|
protected int |
getDefaultColor()
Get teh default color for newly created circles with this tool
|
protected java.lang.String |
getDefaultName(java.lang.String prefix)
Helper method to generate a new circle name
|
void |
onMapEvent(MapEvent event) |
boolean |
onToolBegin(android.os.Bundle extras)
Called when this tool has been asked to start (and after the last tool has cleaned up)
|
void |
onToolEnd()
Called when this tool has been asked to end, either directly or by the user selecting a new
tool or possibly a new toolbar.
|
protected void |
placeCenter(MapItem mi,
GeoPointMetaData point) |
protected void |
placeRadius(MapItem mi,
GeoPointMetaData point) |
protected void |
showCenterPrompt()
Show the text prompt for placing the circle center
|
protected void |
showRadiusPrompt()
Show the text prompt for placing the radius marker
|
clearExtraListeners, endTool, findPoint, getActive, getIdentifier, onKey, popAllMapListeners, popMapListeners, pushMapListeners, requestBeginTool, requestEndTool, setActive, shouldEndOnBack
protected final android.content.Context _context
protected final MapGroup _mapGroup
protected final DrawingPreferences _prefs
protected DrawingCircle _circle
protected Marker _tempCenter
public void dispose()
Tool
public boolean onToolBegin(android.os.Bundle extras)
Tool
onToolBegin
in class Tool
extras
- extra params that were passed by the GUIprotected void showCenterPrompt()
protected void showRadiusPrompt()
protected DrawingCircle createCircle()
protected abstract void addCircle(DrawingCircle circle)
circle
- The new circle to be addedprotected int getDefaultColor()
protected java.lang.String getDefaultName(java.lang.String prefix)
prefix
- Circle name prefixpublic void onMapEvent(MapEvent event)
onMapEvent
in interface MapEventDispatcher.MapEventDispatchListener
protected void placeCenter(MapItem mi, GeoPointMetaData point)
protected void placeRadius(MapItem mi, GeoPointMetaData point)