public abstract class

MapEditor

extends Object
java.lang.Object
   ↳ com.sap.cloud.mobile.fiori.maps.edit.MapEditor<T>

Class Overview

Map implementation independent class used to edit a map.

Summary

Nested Classes
class MapEditor.AddEditAction  
enum MapEditor.AnnotationType  
class MapEditor.DeleteEditAction  
interface MapEditor.EditAction  
interface MapEditor.EditActionCallback  
enum MapEditor.EditType  
class MapEditor.EditorState Captures the current state of the editor for undo and redo. 
class MapEditor.MoveEditAction  
class MapEditor.ReorderEditAction  
class MapEditor.SelectEditAction  
Fields
protected boolean mMapSetupForEditing
Public Constructors
MapEditor()
Public Methods
abstract void clearCurrentEdit()
MapEditor.EditActionCallback getEditActionCallback()
MapEditorViewModel getViewModel()
void setEditActionCallback(MapEditor.EditActionCallback editActionCallback)
void setMapActionProvider(MapActionProvider mapActionProvider)
void setPointSearchAgent(SearchAgent searchAgent)
Set the search agent used to locate points by giving an address.
void setViewModel(MapEditorViewModel mapEditorViewModel)
void setupMapForEditing()
Setup map listeners used for editing.
Protected Methods
abstract void addLocation(FioriAddress fioriAddress)
abstract void addPoint(T position)
abstract void changeEditType(MapEditor.AnnotationType newAnnotationType)
abstract AnnotationMarker createAnnotationMarker(T position)
void delete(int position)
void doLocationAction()
The action to be performed when the location button is tapped.
void editActionPerformed()
AnnotationMarker getActiveAnnotationMarker(AnnotationMarker annotationMarker)
PointAdapter getAdapter()
MapEditor.EditorState getEditorState()
abstract int getLineSegmentForPoint(List<T> points, T point)
Check if a point is on an existing line of a polyline or polygon, and return the segment if it is, or -1 otherwise.
SearchAgent getPointSearchAgent()
Get the search agent used to locate points for a given address.
abstract List<T> getPoints()
Bitmap getSelectedPointBitmap(Context context)
Bitmap getUnselectedPointBitmap(Context context)
abstract void hideMarker(AnnotationMarker annotationMarker)
abstract void loadAddress(AnnotationMarker marker, Runnable addressLoadedRunnable)
abstract void moveMarkerEdit(T startPosition, T endPosition, AnnotationMarker movedMarker)
void reorder(int oldPosition, int newPosition)
void restoreEditorState(MapEditor.EditorState editorState)
Annotation saveEdit()
abstract void selectMarker(AnnotationMarker marker)
Mark a given point as selected, with undo/redo history.
void setAdapter(PointAdapter pointAdapter)
abstract void showExtents()
abstract void showSelectedMarker()
Adjusts the position of the map to show the currently selected point when necessary.
void syncMarkerSelection()
abstract void teardownMapFromEditing()
Remove all map listeners used for editing.
abstract FioriPoint toFioriPoint(T platformPointType)
Convert platform specific point type (for example LatLng for Google) to FioriPoint.
abstract void updateMap()
abstract void updateMarkerIcon(AnnotationMarker marker, boolean selected)
[Expand]
Inherited Methods
From class java.lang.Object

Fields

protected boolean mMapSetupForEditing

Public Constructors

public MapEditor ()

Public Methods

public abstract void clearCurrentEdit ()

public MapEditor.EditActionCallback getEditActionCallback ()

public MapEditorViewModel getViewModel ()

public void setEditActionCallback (MapEditor.EditActionCallback editActionCallback)

public void setMapActionProvider (MapActionProvider mapActionProvider)

public void setPointSearchAgent (SearchAgent searchAgent)

Set the search agent used to locate points by giving an address.

Parameters
searchAgent the search agent used to locate points by giving an address.

public void setViewModel (MapEditorViewModel mapEditorViewModel)

public void setupMapForEditing ()

Setup map listeners used for editing.

Protected Methods

protected abstract void addLocation (FioriAddress fioriAddress)

protected abstract void addPoint (T position)

protected abstract void changeEditType (MapEditor.AnnotationType newAnnotationType)

protected abstract AnnotationMarker createAnnotationMarker (T position)

protected void delete (int position)

protected void doLocationAction ()

The action to be performed when the location button is tapped.

See Also

protected void editActionPerformed ()

protected AnnotationMarker getActiveAnnotationMarker (AnnotationMarker annotationMarker)

protected PointAdapter getAdapter ()

protected MapEditor.EditorState getEditorState ()

protected abstract int getLineSegmentForPoint (List<T> points, T point)

Check if a point is on an existing line of a polyline or polygon, and return the segment if it is, or -1 otherwise.

Parameters
points list of points making up the polyline or polygon.
point the point to check.
Returns
  • the line segment the point is on or -1 if not on any line.

protected SearchAgent getPointSearchAgent ()

Get the search agent used to locate points for a given address.

Returns
  • the search agent used to locate points for a given address.

protected abstract List<T> getPoints ()

protected Bitmap getSelectedPointBitmap (Context context)

protected Bitmap getUnselectedPointBitmap (Context context)

protected abstract void hideMarker (AnnotationMarker annotationMarker)

protected abstract void loadAddress (AnnotationMarker marker, Runnable addressLoadedRunnable)

protected abstract void moveMarkerEdit (T startPosition, T endPosition, AnnotationMarker movedMarker)

protected void reorder (int oldPosition, int newPosition)

protected void restoreEditorState (MapEditor.EditorState editorState)

protected Annotation saveEdit ()

protected abstract void selectMarker (AnnotationMarker marker)

Mark a given point as selected, with undo/redo history.

Parameters
marker the point to select.

protected void setAdapter (PointAdapter pointAdapter)

protected abstract void showExtents ()

protected abstract void showSelectedMarker ()

Adjusts the position of the map to show the currently selected point when necessary.

protected void syncMarkerSelection ()

protected abstract void teardownMapFromEditing ()

Remove all map listeners used for editing.

protected abstract FioriPoint toFioriPoint (T platformPointType)

Convert platform specific point type (for example LatLng for Google) to FioriPoint.

Parameters
platformPointType platform specific point
Returns
  • a FioriPoint equivalent to platform specific point.

protected abstract void updateMap ()

protected abstract void updateMarkerIcon (AnnotationMarker marker, boolean selected)