net.rim.device.api.ui.container
Class ComponentCanvas

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.ui.container.AbsoluteFieldManager
                  extended by net.rim.device.api.ui.container.ComponentCanvas
All Implemented Interfaces:
AdjustmentListener
Direct Known Subclasses:
ViewfinderOverlay.OverlayCanvas

public class ComponentCanvas
extends AbsoluteFieldManager

A manager that allows the placement of fields at specific x-y positions.

Fields can be placed anywhere on the screen and can even overlap. This manager has similar functionality to AbsoluteFieldManager.

Unlike AbsoluteFieldManager, this manager is drawn on the screen using the compositing engine. This manager is drawn on top of any standard fields and managers. It can also be used on top of other fields and managers that are drawn using the compositing engine.

A common use case for ComponentCanvas is to arrange a series of buttons to appear on top of a video or camera field. A media field will appear on top of all standard components.

ComponentCanvas does not scroll. To scroll a ComponentCanvas, place it inside a scrollable manager. The extent of a ComponentCanvas will match its virtual extent.

When you create a ComponentCanvas, you must provide a width and a height.

The size of a ComponentCanvas can be changed by calling ComponentCanvas.resize(int, int) or ComponentCanvas.resizeImmediately(int, int). If ComponentCanvas.resize(int, int) is used, the change will be visible after the next layout (often a device rotation).

Warning: This type of manager consumes more memory than AbsoluteFieldManager and should be used only in instances where a standard AbsoluteFieldManager will not work. For performance reasons, an application should try to limit the number of ComponentCanvas managers that it uses at one time to three or fewer.

Since:
BlackBerry API 7.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
 
Constructor Summary
ComponentCanvas(int width, int height)
          Constructs a new ComponentCanvas instance.
 
Method Summary
 void resize(int width, int height)
          Tells this manager to change its size on next layout
 void resizeImmediately(int width, int height)
          Tells this manager to change its size and do an immediate relayout.
protected  void sublayout(int width, int height)
          Implements custom layout features for this manager.
 
Methods inherited from class net.rim.device.api.ui.container.AbsoluteFieldManager
add, getPreferredHeight, getPreferredWidth, insert, nextFocus, setPosChild
 
Methods inherited from class net.rim.device.api.ui.Manager
add, addAll, cursorClick, cursorUnclick, delete, deleteAll, deleteRange, getAccessibleContext, getField, getFieldAtLocation, 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, onFocus, onUnfocus, paint, paintChild, replace, setDirty, setFocus, setHorizontalQuantization, setPositionChild, setScrollingInertial, setVerticalQuantization, setVirtualExtent, subpaint, touchEvent, trackwheelClick, trackwheelUnclick
 
Methods inherited from class net.rim.device.api.ui.ScrollView
configurationChanged, getHorizontalAdjustment, getVerticalAdjustment, getVisibleHeight, getVisibleWidth, onDisplay, onExposed, onUndisplay, 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, onMenuDismissed, onMenuDismissed, onObscured, 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
 



Constructor Detail

ComponentCanvas

public ComponentCanvas(int width,
                       int height)
Constructs a new ComponentCanvas instance.

Parameters:
width - The width of the ComponentCanvas.
height - The height of the ComponentCanvas.
Since:
BlackBerry API 7.0.0


Method Detail

sublayout

protected void sublayout(int width,
                         int height)
Implements custom layout features for this manager.

ComponentCanvas will always lay itself out using its minimal width and height, ignoring the parameters that are passed into this method.

Overrides:
sublayout in class AbsoluteFieldManager
Parameters:
width - This parameter is ignored.
height - This parameter is ignored.
See Also:
Manager.sublayout(int, int)
Since:
BlackBerry API 7.0.0

resize

public void resize(int width,
                   int height)
Tells this manager to change its size on next layout

Parameters:
width - The new width of this manager
height - The new height of this manager
Since:
BlackBerry API 7.0.0

resizeImmediately

public void resizeImmediately(int width,
                              int height)
Tells this manager to change its size and do an immediate relayout. If this method is called outside of input, the event lock must be held.

Parameters:
width - The new width of this manager
height - The new height of this manager
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