com.micello.mapapi
Class MicelloManager

java.lang.Object
  extended by com.micello.mapapi.MicelloManager

public class MicelloManager
extends java.lang.Object

This class holds the Micello classes so the relevant classes have access to each other. The state of the map is held in the MapData object and the MapViewRegion object. Other important classes are also stored here. A copy of the instance of this class should be held across activities these object can be accessed.


Constructor Summary
MicelloManager()
           
 
Method Summary
 void addMapViewListener(MapViewListener mapViewListener)
          This method adds a MapViewListener.
 void blank()
          This method nulls out the mapData
 void clearMapViewListeners()
          This method clears all the MapViewListener.
 void close()
          This method clears the resources used by the map code.
static Context getApplicationContext()
          This method returns the application context set in setApplciationContext.
 DataStore getDataStore()
          This method retrieves an instance of the data store to request data objects.
 ErrorMonitor getErrorMonitor()
          This method retrieves the error monitor.
 java.lang.String getLang()
          This method returns the current langauge.
 MapData getMapData()
          This method retrieves an instance of MapData.
 MapThemeManager getMapThemeManager()
          This method retrieves an instance of the map theme manager.
 TileManager getTileManager()
          This method is intended for internal use only.
 MapViewRegion getViewRegion()
          This method retrieves an instance of the MapViewRegion.
 boolean redrawMap()
          This method will redraw the map if the map view is active.
 void removeMapViewListener(MapViewListener mapViewListener)
          This method removes a MapViewListener.
 void setApplicationContext(Context appContext)
          This method sets the application context for the app.
 void setLang(java.lang.String lang)
          This method sets the language.
 void setMapView(MicelloMapView mapView)
          This method should be called by the map view when it becomes active, to set the current view, and when it becomes inactive, to set the view to null.
 void setRequestKey(java.lang.String key)
          This method sets the request key.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MicelloManager

public MicelloManager()
Method Detail

setApplicationContext

public void setApplicationContext(Context appContext)
This method sets the application context for the app. It is needed internally to grant system level access, such as as for database and file system access.

Parameters:
appContext - The application Context

getApplicationContext

public static Context getApplicationContext()
This method returns the application context set in setApplciationContext.

Returns:
The application context

setRequestKey

public void setRequestKey(java.lang.String key)
This method sets the request key.


getErrorMonitor

public ErrorMonitor getErrorMonitor()
This method retrieves the error monitor. It will print out error messages encountered by the framework if it is given a proper activity context.


getMapData

public MapData getMapData()
This method retrieves an instance of MapData. The MapData object manages the map and annotation data for the map.


getViewRegion

public MapViewRegion getViewRegion()
This method retrieves an instance of the MapViewRegion. The MapViewRegion object manages the viewport to the map.


getTileManager

public TileManager getTileManager()
This method is intended for internal use only.


getMapThemeManager

public MapThemeManager getMapThemeManager()
This method retrieves an instance of the map theme manager. The theme manager manages the style in which the map is rendered.


getDataStore

public DataStore getDataStore()
This method retrieves an instance of the data store to request data objects. The DataStore object access data from the local cache or from the network.


getLang

public java.lang.String getLang()
This method returns the current langauge.


setLang

public void setLang(java.lang.String lang)
This method sets the language. By default, the lanugage of the device is used.


close

public void close()
This method clears the resources used by the map code.


setMapView

public void setMapView(MicelloMapView mapView)
This method should be called by the map view when it becomes active, to set the current view, and when it becomes inactive, to set the view to null. It notifies internal classes as well as any MapViewListeners that have been added.

Parameters:
mapView - The active MicelloMapView object. If the mapView is made inactive The mapView should be set to null.

addMapViewListener

public void addMapViewListener(MapViewListener mapViewListener)
This method adds a MapViewListener. The MapViewListener will be notified whenever a MicelloMapView becomes active or inactive for this MicelloManager.

Parameters:
mapViewListener -

removeMapViewListener

public void removeMapViewListener(MapViewListener mapViewListener)
This method removes a MapViewListener. The MapViewListener will be notified whenever a MicelloMapView becomes active or inactive for this MicelloManager.

Parameters:
mapViewListener -

clearMapViewListeners

public void clearMapViewListeners()
This method clears all the MapViewListener. The MapViewListener will be notified whenever a MicelloMapView becomes active for this MicelloManager.

Parameters:
mapViewListener -

redrawMap

public boolean redrawMap()
This method will redraw the map if the map view is active. Otherwise it takes no action.


blank

public void blank()
This method nulls out the mapData