net.rim.device.api.lbs.maps.ui
Class MapAction

java.lang.Object
  extended by net.rim.device.api.lbs.maps.ui.MapAction

public class MapAction
extends Object

Defines if and how actions are performed on the parent map field.

Note: for the setCentre* methods, if the new centre is outside of the world boundaries for the latitude, then the coordinate is clipped to the maximum value. If the longitude coordinate exceeds the world boundaries, then the coordinate is wrapped to an equivalent point within the world boundaries.

Since:
BlackBerry API 6.0.0

Field Summary
static int ACTION_CENTRE_CHANGE
          Action event that indicates the centre coordinates changed.
static int ACTION_FOCUSED_CHANGE
          Action event that indicates the focused mappable item changed.
static int ACTION_NAVIGATE_CHANGE
          Action event that indicates the navigated mappable changed.
static int ACTION_OPERATION_MODE_CHANGE
          Action event that indicates the operational mode changed.
static int ACTION_SELECTED_MAPPABLE_CHANGE
          Action event that indicates the selected mappable changed.
static int ACTION_ZOOM_CHANGE
          Action event that indicates the zoom level changed.
 
Method Summary
 void disableOperationMode(int modeToDisable)
          Disables an operation mode from the current composite mode, leaving the other active modes enabled.
 void enableOperationMode(int modeToEnable)
          Enables an operation mode on top of the mode that is currently active.
 void navigateNext()
          Navigates to the next mappable item.
 void navigatePrev()
          Navigates to the previous mappable item.
 void setCentre(MapPoint newCentre)
          Sets the centre of the map to the specified point.
 void setCentreAndZoom(MapPoint centre, int zoom)
          Sets the centre point and zoom level of the map, and then updates the map.
 void setCentreLatLon(double lat, double lon)
          Sets the centre of the map to the specified latitude and longitude coordinates.
 void setFocusMappable(Mappable target)
          Sets the provided item as the currently focused mappable.
 void setSelectionPoint(MapPoint target)
          Sets the current selection point.
 void setZoom(int zoom)
          Sets the zoom level of the map field.
 void zoomIn()
          Zooms in by one zoom level.
 void zoomOut()
          Zooms out by one zoom level.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 



Field Detail

ACTION_ZOOM_CHANGE

public static final int ACTION_ZOOM_CHANGE
Action event that indicates the zoom level changed.

See Also:
Constant Field Values
Since:
BlackBerry API 6.0.0

ACTION_CENTRE_CHANGE

public static final int ACTION_CENTRE_CHANGE
Action event that indicates the centre coordinates changed.

See Also:
Constant Field Values
Since:
BlackBerry API 6.0.0

ACTION_FOCUSED_CHANGE

public static final int ACTION_FOCUSED_CHANGE
Action event that indicates the focused mappable item changed.

See Also:
Constant Field Values
Since:
BlackBerry API 6.0.0

ACTION_OPERATION_MODE_CHANGE

public static final int ACTION_OPERATION_MODE_CHANGE
Action event that indicates the operational mode changed.

See Also:
Constant Field Values
Since:
BlackBerry API 6.0.0

ACTION_NAVIGATE_CHANGE

public static final int ACTION_NAVIGATE_CHANGE
Action event that indicates the navigated mappable changed.

See Also:
Constant Field Values
Since:
BlackBerry API 6.0.0

ACTION_SELECTED_MAPPABLE_CHANGE

public static final int ACTION_SELECTED_MAPPABLE_CHANGE
Action event that indicates the selected mappable changed.

See Also:
Constant Field Values
Since:
BlackBerry API 6.0.0


Method Detail

setZoom

public final void setZoom(int zoom)
Sets the zoom level of the map field.

Parameters:
zoom - The new zoom level.
Since:
BlackBerry API 6.0.0

zoomIn

public void zoomIn()
Zooms in by one zoom level. If the current zoom level is already at the minimum, the zoom level does not change.

Since:
BlackBerry API 6.0.0

zoomOut

public void zoomOut()
Zooms out by one zoom level. If the current zoom level is already at the maximum, the zoom level does not change.

Since:
BlackBerry API 6.0.0

setCentreAndZoom

public final void setCentreAndZoom(MapPoint centre,
                                   int zoom)
Sets the centre point and zoom level of the map, and then updates the map.

Parameters:
centre - The new centre of the screen.
zoom - The new zoom level.
Since:
BlackBerry API 6.0.0

setCentre

public final void setCentre(MapPoint newCentre)
Sets the centre of the map to the specified point.

Parameters:
newCentre - The new centre point.
Since:
BlackBerry API 6.0.0

setCentreLatLon

public final void setCentreLatLon(double lat,
                                  double lon)
Sets the centre of the map to the specified latitude and longitude coordinates.

Parameters:
lat - The latitude of the location (in degrees).
lon - The longitude of the location (in degrees).
Since:
BlackBerry API 6.0.0

enableOperationMode

public final void enableOperationMode(int modeToEnable)
Enables an operation mode on top of the mode that is currently active. This allows for composite modes, such as MODE_SELECTION and MODE_ZOOM to be active concurrently.

Note: No validation is performed to ensure that mutually exclusive modes (such as MODE_ZOOM and MODE_PAN) are not enabled at the same time.

It is the responsibility of the caller to ensure mode consistency. When mutually exclusive modes are enabled, the behavior is undefined.

Parameters:
modeToEnable - The operation mode to enable.
Since:
BlackBerry API 6.0.0

disableOperationMode

public final void disableOperationMode(int modeToDisable)
Disables an operation mode from the current composite mode, leaving the other active modes enabled.

Parameters:
modeToDisable - The mode to be disabled.
Since:
BlackBerry API 6.0.0

setSelectionPoint

public final void setSelectionPoint(MapPoint target)
Sets the current selection point. The selection point is different from the current focused mappable item because the selection point is only applicable in the selection mode, and it does not modify the current focused mappable item.

Parameters:
target - The point that is selected.
Since:
BlackBerry API 6.0.0

setFocusMappable

public final void setFocusMappable(Mappable target)
Sets the provided item as the currently focused mappable.

Parameters:
target - The item to be focused on.
Since:
BlackBerry API 6.0.0

navigateNext

public final void navigateNext()
Navigates to the next mappable item.

Since:
BlackBerry API 6.0.0

navigatePrev

public final void navigatePrev()
Navigates to the previous mappable item.

Since:
BlackBerry API 6.0.0





Copyright 1999-2010 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Copyright 1993-2003 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A. All Rights Reserved.
Copyright 2002-2003 Nokia Corporation All Rights Reserved.
Java is a trademark of Sun Microsystems, Inc.