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

java.lang.Object
  extended by net.rim.device.api.ui.Field
      extended by net.rim.device.api.ui.ScrollView
          extended by net.rim.device.api.ui.Manager
              extended by net.rim.device.api.lbs.maps.ui.GlassField
                  extended by net.rim.device.api.lbs.maps.ui.RichMapField
All Implemented Interfaces:
AdjustmentListener, FieldChangeListener

public final class RichMapField
extends GlassField
implements FieldChangeListener

Represents a field that is composed of a map (MapField), user input and user feedback fields that are overlayed on top of the map.

Closure Note: This is a Closable object. Once the client application is done with this object, the client application must call close() to correctly release resources.

Device orientation: At this time, this class does not listen for changes in device orientation. The client application must listen for these changes and initiate the layout recalculation that is appropriate to the client's situation. For information on device orientation, refer to Display.

Since:
BlackBerry API 6.0.0

Field Summary
 
Fields inherited from class net.rim.device.api.ui.Manager
BOTTOMMOST, DOWNWARD, HORIZONTAL_SCROLL, HORIZONTAL_SCROLLBAR, HORIZONTAL_SCROLLBAR_MASK, HORIZONTAL_SCROLL_MASK, LEAVE_BLANK_SPACE, LEFTMOST, LEFTWARD, NO_HORIZONTAL_SCROLL, NO_HORIZONTAL_SCROLLBAR, NO_SCROLL_RESET, NO_VERTICAL_SCROLL, NO_VERTICAL_SCROLLBAR, QUANTA_FONT, RIGHTMOST, RIGHTWARD, TOPMOST, UPWARD, VERTICAL_SCROLL, VERTICAL_SCROLLBAR, VERTICAL_SCROLLBAR_MASK, VERTICAL_SCROLL_MASK
 
Fields inherited from class net.rim.device.api.ui.Field
ACTION_INVOKE, AXIS_HORIZONTAL, AXIS_SEQUENTIAL, AXIS_VERTICAL, EDITABLE, EDITABLE_MASK, FIELD_BOTTOM, FIELD_HALIGN_MASK, FIELD_HCENTER, FIELD_LEADING, FIELD_LEFT, FIELD_RIGHT, FIELD_TOP, FIELD_TRAILING, FIELD_VALIGN_MASK, FIELD_VCENTER, FOCUSABLE, FOCUSABLE_MASK, HIGHLIGHT_FOCUS, HIGHLIGHT_SELECT, NON_FOCUSABLE, NON_SPELLCHECKABLE, READONLY, SPELLCHECKABLE, SPELLCHECKABLE_MASK, STATUS_MOVE_FOCUS_HORIZONTALLY, STATUS_MOVE_FOCUS_VERTICALLY, USE_ALL_HEIGHT, USE_ALL_WIDTH, VISUAL_STATE_ACTIVE, VISUAL_STATE_DISABLED, VISUAL_STATE_DISABLED_FOCUS, VISUAL_STATE_FOCUS, VISUAL_STATE_NORMAL
 
Fields inherited from interface net.rim.device.api.ui.FieldChangeListener
PROGRAMMATIC
 
Method Summary
 void add(Field field)
          Adds a field to this manager.
 void add(Field field, int x, int y)
          Adds the supplied field to this Manager at the location (x, y).
 void close()
           
 void fieldChanged(Field field, int actionId)
          Invoked by a field when a property changes.
 MapAction getAction()
          Gets the MapAction object for the base map of this field.
 int getFieldAtLocation(int x, int y)
          Retrieves the index of the field under a specified point.
 MapField getMapField()
          Gets the base map field.
 MapDataModel getModel()
          Gets the base map field's model.
 int getOperationMode()
          Retrieves the current operation mode.
 int getPreferredHeight()
          Retrieves the preferred height (in pixels).
 int getPreferredWidth()
          Retrieves the preferred width (in pixels).
 boolean isFieldVisible(int id)
          Determines if the given field is visible.
 boolean isOperationModeEnabled(int modeToCheck)
          Verifies if a given operation mode is enabled.
protected  void sublayout(int width, int height)
          Implements custom layout features for this manager
 
Methods inherited from class net.rim.device.api.ui.Manager
addAll, cursorClick, cursorMovement, cursorUnclick, delete, deleteAll, deleteRange, getAccessibleContext, getField, getFieldCount, getFieldWithFocus, getFieldWithFocusIndex, getFocusRect, getHorizontalScroll, getLeafFieldWithFocus, getPreferredHeightOfChild, getPreferredWidthOfChild, getVerticalScroll, getVirtualHeight, getVirtualWidth, insert, insertAll, invalidate, invalidate, invalidateFieldRange, invokeAction, isDataValid, isDirty, isDownArrowShown, isFocusable, isMuddy, isSelecting, isUpArrowShown, isValidLayout, keyChar, keyControl, keyDown, keyRepeat, keyStatus, keyUp, layout, layoutChild, makeMenu, moveFocus, moveFocus, navigationClick, navigationMovement, navigationUnclick, nextFocus, nextFocus, onFocus, onUnfocus, paint, paintChild, replace, setDirty, setFocus, setHorizontalQuantization, setPositionChild, setScrollingInertial, setVerticalQuantization, setVirtualExtent, shouldCursorScroll, subpaint, touchEvent, trackwheelClick, trackwheelUnclick
 
Methods inherited from class net.rim.device.api.ui.ScrollView
configurationChanged, getHorizontalAdjustment, getVerticalAdjustment, getVisibleHeight, getVisibleWidth, onExposed, setCurrentLocation, setExtent, setHorizontalAdjustment, setHorizontalScroll, setHorizontalScroll, setScrollListener, setVerticalAdjustment, setVerticalScroll, setVerticalScroll, valueChanged, waitForScrolling
 
Methods inherited from class net.rim.device.api.ui.Field
drawFocus, drawHighlightRegion, fieldChangeNotify, focusAdd, focusRemove, getBackground, getBackground, getBorder, getBorder, getBorder, getChangeListener, getCommandItemProvider, getContentHeight, getContentLeft, getContentRect, getContentRect, getContentTop, getContentWidth, getContextMenu, getCookie, getExtent, getExtent, getFieldStyle, getFocusListener, getFont, getHeight, getIndex, getLeft, getManager, getMargin, getMarginBottom, getMarginLeft, getMarginRight, getMarginTop, getOriginal, getPadding, getPaddingBottom, getPaddingLeft, getPaddingRight, getPaddingTop, getScreen, getStyle, getTextFillColor, getTextStrokeColor, getTop, getVisualState, getWidth, invalidateAll, isEditable, isEnabled, isFocus, isLeftToRight, isPasteable, isScrollCopyable, isSelectable, isSelectionCopyable, isSelectionCutable, isSelectionDeleteable, isSpellCheckable, isStyle, isVisible, makeContextMenu, onDisplay, onMenuDismissed, onMenuDismissed, onObscured, onUndisplay, onVisibilityChange, paste, select, selectionCopy, selectionCut, selectionDelete, setBackground, setBackground, setBorder, setBorder, setBorder, setBorder, setChangeListener, setCommandItemProvider, setCookie, setEditable, setEnabled, setFocus, setFocusListener, setFont, setFont, setMargin, setMargin, setMuddy, setNonSpellCheckable, setPadding, setPadding, setPosition, setVisualState, updateLayout
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 



Method Detail

fieldChanged

public void fieldChanged(Field field,
                         int actionId)
Description copied from interface: FieldChangeListener
Invoked by a field when a property changes.

Specified by:
fieldChanged in interface FieldChangeListener
Parameters:
field - The field that changed.
actionId - Information specifying the origin of the change. The context value is used to provide detailed information about how the field was changed. For example, see ChoiceField.CONTEXT_CHANGE_OPTION for the context information in ChoiceField. Please check individual fields for more details. context is FieldChangeListener.PROGRAMMATIC if the field was changed programmatically, that is, not by user interaction.
See Also:
FieldChangeListener.fieldChanged(Field,int)
Since:
BlackBerry API 6.0.0

getPreferredHeight

public int getPreferredHeight()
Description copied from class: GlassField
Retrieves the preferred height (in pixels).

This method returns the height required to lay out the managerís contents. The contents height is decided by baseManager's height

Overrides:
getPreferredHeight in class GlassField
Returns:
height (in pixels) preferred by the manager.
See Also:
Field.getPreferredHeight()
Since:
BlackBerry API 6.0.0

getPreferredWidth

public int getPreferredWidth()
Description copied from class: GlassField
Retrieves the preferred width (in pixels).

This method returns the width required to lay out the managerís contents. The contents width is decided by baseManager's width

Overrides:
getPreferredWidth in class GlassField
Returns:
width (in pixels) preferred by the manager.
See Also:
Field.getPreferredWidth()
Since:
BlackBerry API 6.0.0

sublayout

protected void sublayout(int width,
                         int height)
Description copied from class: GlassField
Implements custom layout features for this manager

Overrides:
sublayout in class GlassField
Parameters:
width - Width available for this manager
height - Height available for this manager
See Also:
Manager.sublayout(int, int)
Since:
BlackBerry API 6.0.0

close

public void close()
           throws Exception
Throws:
Exception
See Also:
Closable.close()
Since:
BlackBerry API 6.0.0

add

public void add(Field field)
Description copied from class: Manager
Adds a field to this manager.

Invoke this method to add a new field at the end of this manager's list of controlled fields.

Notice that only one manager is allowed to control any single field, and a field can never manage itself.

Overrides:
add in class Manager
Parameters:
field - The field to add.
See Also:
Manager.add(Field)
Since:
BlackBerry API 6.0.0

add

public void add(Field field,
                int x,
                int y)
Adds the supplied field to this Manager at the location (x, y).

Parameters:
field - The field to add.
x - The horizontal location to place the field, relative to the origins of this Manager.
y - The vertical location to place the field, relative to the origins of this Manager.
Since:
BlackBerry API 6.0.0

getFieldAtLocation

public int getFieldAtLocation(int x,
                              int y)
Description copied from class: Manager
Retrieves the index of the field under a specified point.

Given a point in coordinates local to this manager's extent, this method returns the index of the controlled field under that point (or -1 if no field found under the specified point).

This method constrains its search to the extent of this manager: if you provide a coordinate outside this manager's extent, this method uses values along the edges of the extent as required.

By default, this method performs a linear search hit, testing each controlled field in turn. If you implement a manager, you can override this method to optimize its functionality.

Overrides:
getFieldAtLocation in class GlassField
Parameters:
x - The distance from the left edge of the manager's extent.
y - The distance from the top edge of the manager's extent.
Returns:
The index of the field, or -1 if no field was found.
Since:
BlackBerry API 6.0.0

getMapField

public MapField getMapField()
Gets the base map field.

Returns:
The base map field.
Since:
BlackBerry API 6.0.0

getAction

public MapAction getAction()
Gets the MapAction object for the base map of this field.

Returns:
The action object of the base map.
Since:
BlackBerry API 6.0.0

isOperationModeEnabled

public boolean isOperationModeEnabled(int modeToCheck)
Verifies if a given operation mode is enabled.

Parameters:
modeToCheck - The mode to verify. Operation modes are defined in the MapConstants class and start with MODE_.
Returns:
true if the mode is enabled, false otherwise.
Since:
BlackBerry API 6.0.0

getModel

public MapDataModel getModel()
Gets the base map field's model.

Returns:
The model for the base map field.
Since:
BlackBerry API 6.0.0

isFieldVisible

public boolean isFieldVisible(int id)
Determines if the given field is visible.

Parameters:
id - The ID of the field.
Returns:
true if the field is visible, false otherwise (including if the field does not exist).
Since:
BlackBerry API 6.0.0

getOperationMode

public int getOperationMode()
Retrieves the current operation mode. Operation modes are defined in the MapConstants class and start with MODE_.

Returns:
The current operation mode.
Since:
BlackBerry API 6.0.0





Copyright 1999-2011 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Java is a trademark of Oracle America Inc. in the US and other countries.
Legal