net.rim.device.api.lbs.compass
Class CompassField

java.lang.Object
  extended by net.rim.device.api.ui.Field
      extended by net.rim.device.api.opengles.GLField
          extended by net.rim.device.api.lbs.compass.CompassField
All Implemented Interfaces:
AnimationListener, AccelerometerListener, MagnetometerListener

public class CompassField
extends GLField
implements AnimationListener, MagnetometerListener, AccelerometerListener

Represents a compass overlay field.

This field provides a graphical representation of a compass that can be added to an application to provide directional context (for example, in a mapping application, the compass displays where North is in relation to the user's current location). The CompassField can be instantiated and added to a field manager like other UI components that are used in the BlackBerry Java SDK.

To add a compass overlay to your application, you must perform the following:

Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 7.0.0

Field Summary
 
Fields inherited from class net.rim.device.api.opengles.GLField
DISABLE_SURFACE_SYNC_HINT, ERROR_CHOOSE_CONFIG, ERROR_COPY_BUFFERS, ERROR_CREATE_CONTEXT, ERROR_CREATE_SURFACE, ERROR_GET_DISPLAY, ERROR_INIT_DISPLAY, ERROR_MAKE_CURRENT, ERROR_NO_CONFIGS, ERROR_SWAP_BUFFERS, ERROR_WAIT_CLIENT, ERROR_WAIT_NATIVE, MIXED_MODE_RENDERING, TRANSPARENT, VERSION_1_1, VERSION_2_0
 
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
 
Constructor Summary
Category: Signed CompassField()
          Constructs a CompassField instance.
 
Method Summary
Category: Signed  void close()
          Closes the field and releases any resources for this field.
Category: Signed  void onData(AccelerometerData accData)
          Notifies listener with new accelerometer data.
Category: Signed protected  void onUndisplay()
          Invoked when the screen this field is attached to is popped off the display stack.
 
Methods inherited from class net.rim.device.api.opengles.GLField
errorOccurred, getCurrentFrameRate, getPreferredColorBufferSize, getPreferredDepthBufferSize, getTargetFrameRate, initialize, onDisplay, onExposed, onObscured, onVisibilityChange, paint, render, setTargetFrameRate, sizeChanged, update
 
Methods inherited from class net.rim.device.api.ui.Field
cursorClick, cursorUnclick, drawFocus, drawHighlightRegion, fieldChangeNotify, focusAdd, focusRemove, getAccessibleContext, getBackground, getBackground, getBorder, getBorder, getBorder, getChangeListener, getCommandItemProvider, getContentHeight, getContentLeft, getContentRect, getContentRect, getContentTop, getContentWidth, getContextMenu, getCookie, getExtent, getExtent, getFieldStyle, getFocusListener, getFocusRect, getFont, getHeight, getIndex, getLeafFieldWithFocus, getLeft, getManager, getMargin, getMarginBottom, getMarginLeft, getMarginRight, getMarginTop, getOriginal, getPadding, getPaddingBottom, getPaddingLeft, getPaddingRight, getPaddingTop, getPreferredHeight, getPreferredWidth, getScreen, getStyle, getTextFillColor, getTextStrokeColor, getTop, getVisualState, getWidth, invalidate, invalidate, invalidateAll, invokeAction, isDataValid, isDirty, isEditable, isEnabled, isFocus, isFocusable, isLeftToRight, isMuddy, isPasteable, isScrollCopyable, isSelectable, isSelecting, isSelectionCopyable, isSelectionCutable, isSelectionDeleteable, isSpellCheckable, isStyle, isVisible, keyChar, keyControl, keyDown, keyRepeat, keyStatus, keyUp, layout, makeContextMenu, moveFocus, moveFocus, navigationClick, navigationMovement, navigationUnclick, onFocus, onMenuDismissed, onMenuDismissed, onUnfocus, paste, select, selectionCopy, selectionCut, selectionDelete, setBackground, setBackground, setBorder, setBorder, setBorder, setBorder, setChangeListener, setCommandItemProvider, setCookie, setDirty, setEditable, setEnabled, setExtent, setFocus, setFocusListener, setFont, setFont, setMargin, setMargin, setMuddy, setNonSpellCheckable, setPadding, setPadding, setPosition, setVisualState, touchEvent, trackwheelClick, trackwheelUnclick, updateLayout
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.rim.device.api.animation.AnimationListener
animationBegin, animationEnd
 
Methods inherited from interface net.rim.device.api.system.MagnetometerListener
onData
 



Constructor Detail

CompassField

public CompassField()
Constructs a CompassField instance.

Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 7.0.0


Method Detail

close

public void close()
Closes the field and releases any resources for this field.

Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 7.0.0

onData

public void onData(AccelerometerData accData)
Notifies listener with new accelerometer data. The event object will contain only information the application subsribed for during channel registration. The listener notification is performed in the application event dispatch thread.

Specified by:
onData in interface AccelerometerListener
Parameters:
accData - accelerometer data containing subscribed information
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 7.0.0

onUndisplay

protected void onUndisplay()
Description copied from class: Field
Invoked when the screen this field is attached to is popped off the display stack.

The complementing callback is Field.onDisplay().

Overrides:
onUndisplay in class GLField
See Also:
Field.onUndisplay()
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 7.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