de.monarchy.guideme.view
Class CombinationView

java.lang.Object
  extended by AbsoluteLayout
      extended by de.monarchy.guideme.view.CombinationView
All Implemented Interfaces:
OrientationChangeListener, PositionChangeListener, RoutingListener

public class CombinationView
extends AbsoluteLayout
implements OrientationChangeListener, PositionChangeListener, RoutingListener

The CombinationView is the linking view of augmention and reality. It combines camera, POI views, direction arrow and map view and is responsible for a correct interaction between them.

Author:
dstuerze

Field Summary
static int CAM_THRESHOLD
          Roll below which the camera is deactivated
static int MAP_THRESHOLD
          Roll above which the map is deactivated
 
Constructor Summary
CombinationView(Activity context)
          Creating a combination view for the given context.
 
Method Summary
 boolean isCamActivated()
          Returns whether the camera view is currently activated.
 boolean isMapActivated()
          Returns whether the map view is currently activated.
 void onStart()
          Callback method for when the view is becoming visible.
 void onStop()
          Callback method for when the view is invisible.
 void removeRoute()
          Callback method for when a route is deleted.
 void routingDone(RoutePoint[] points)
          Callback method indicating a new route has been calculated.
 void setCamActivated(boolean b)
          Activate or deactivate the cam view.
 void setMapActivated(boolean b)
          Activate or deactivate the map view.
 void stateChanged(float[] arg)
          Callback method indicating a change of the device's orientation happend.
 void stateChanged(GeoCoordinate arg0, POI[] arg1)
          Callback method indicating a change of the device's orientation happend.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CAM_THRESHOLD

public static final int CAM_THRESHOLD
Roll below which the camera is deactivated

See Also:
Constant Field Values

MAP_THRESHOLD

public static final int MAP_THRESHOLD
Roll above which the map is deactivated

See Also:
Constant Field Values
Constructor Detail

CombinationView

public CombinationView(Activity context)
Creating a combination view for the given context. The necessary view will be instanciated and ordered.

Parameters:
context - application context
Method Detail

stateChanged

public void stateChanged(float[] arg)
Description copied from interface: OrientationChangeListener
Callback method indicating a change of the device's orientation happend. The orientation will be given in an array with three values as described by Android's SensorEvent.

Specified by:
stateChanged in interface OrientationChangeListener
Parameters:
arg - new orientation

stateChanged

public void stateChanged(GeoCoordinate arg0,
                         POI[] arg1)
Description copied from interface: PositionChangeListener
Callback method indicating a change of the device's orientation happend. With the new position, an array of POIs in a range around this location is submitted.

Specified by:
stateChanged in interface PositionChangeListener
Parameters:
arg0 - new position
arg1 - POIs around that spot

setMapActivated

public void setMapActivated(boolean b)
Activate or deactivate the map view. If the map is deactivated, it will not be shown.

Parameters:
b - new status

isMapActivated

public boolean isMapActivated()
Returns whether the map view is currently activated. This does not check whether the view is visible or invisible because of the current roll of the device.

Returns:
true if the map is activated, false else

setCamActivated

public void setCamActivated(boolean b)
Activate or deactivate the cam view. If the cam is deactivated, it will not be shown.

Parameters:
b - new status

isCamActivated

public boolean isCamActivated()
Returns whether the camera view is currently activated. This does not check whether the view is visible or invisible because of the current roll of the device.

Returns:
true if the cam is activated, false else

onStop

public void onStop()
Callback method for when the view is invisible. It is necessary to release the map view as only one is existing and it might be needed elsewhere.


onStart

public void onStart()
Callback method for when the view is becoming visible. The map view will be added to the layout and its appearance will be adjusted.


removeRoute

public void removeRoute()
Callback method for when a route is deleted. The information is forwarded to the interested views, here map and direction arrow.


routingDone

public void routingDone(RoutePoint[] points)
Description copied from interface: RoutingListener
Callback method indicating a new route has been calculated. If a routing request failed, this method's parameter will be indicating it by being null.

Specified by:
routingDone in interface RoutingListener
Parameters:
points - array with route instructions