net.rim.device.api.amms.control.camera
Class ViewfinderOverlay.VideoControlOverlayField

java.lang.Object
  extended by net.rim.device.api.ui.Field
      extended by net.rim.device.api.amms.control.camera.ViewfinderOverlay.VideoControlOverlayField
All Implemented Interfaces:
ViewfinderOverlay.OverlayCanvas.Positionable
Direct Known Subclasses:
BarcodeScannerOverlayField
Enclosing class:
ViewfinderOverlay

public abstract static class ViewfinderOverlay.VideoControlOverlayField
extends Field
implements ViewfinderOverlay.OverlayCanvas.Positionable

ViewfinderOverlay.VideoControlOverlayField is a Field that matches the dimensions of the video window controlled by a given VideoControl, and overlays it directly. When used in conjunction with ViewfinderOverlay.OverlayCanvas its position is updated automatically with respect to the video window (i.e. perhaps after rotation if the video window is not full screen). Users can implement Field.paint(net.rim.device.api.ui.Graphics) to draw over the video window, which may or may not be a subset of the screen's display.

Since:
BlackBerry API 7.0.0

Field Summary
 
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
ViewfinderOverlay.VideoControlOverlayField(VideoControl videoControl)
          Creates a new instance of VideoControlOverlayField.
 
Method Summary
 int getDisplayHeight()
          Height of the VideoControl.
 int getDisplayWidth()
          Width of the VideoControl.
 int getPreferredHeight()
          Preferred height of this field.
 int getPreferredWidth()
          Preferred width of this field.
 int getXPosition()
          X position of the VideoControl.
 int getYPosition()
          Y position of the VideoControl.
protected  void layout(int width, int height)
          Lays out field contents.
 
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, 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, makeContextMenu, moveFocus, moveFocus, navigationClick, navigationMovement, navigationUnclick, onDisplay, onExposed, onFocus, onMenuDismissed, onMenuDismissed, onObscured, onUndisplay, onUnfocus, onVisibilityChange, paint, 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
 



Constructor Detail

ViewfinderOverlay.VideoControlOverlayField

public ViewfinderOverlay.VideoControlOverlayField(VideoControl videoControl)
Creates a new instance of VideoControlOverlayField.

Parameters:
videoControl - the VideoControl that will control this Field's extent
Throws:
IllegalArgumentException - if videoControl is null.
Since:
BlackBerry API 7.0.0


Method Detail

layout

protected void layout(int width,
                      int height)
Description copied from class: Field
Lays out field contents.

This method is abstract; any class that extends Field must implement this method appropriate to its needs.

This method is invoked after the screen has been created, or when system parameters change (for example, after a system font change). Field.getExtent() will return a valid value after this method is invoked. Implementations of this method must invoke Field.setExtent(int, int) with the size used by the field.

During this call, Field.setExtent(int, int) must be called with parameters such that both width and height are between 0 and the values passed into this function for the Manager to be able to position this Field properly.

Fields may cache system attributes for efficiency (such as the current system font); however, they cannot depend on these attributes remaining unchanged. When one of these attributes changes, a message event is sent to that effect. In these cases, this method refetches and caches these attributes.

Specified by:
layout in class Field
Parameters:
width - The amount of available horizontal space.
height - The amount of available vertical space.
See Also:
Field#sublayout
Since:
BlackBerry API 7.0.0

getPreferredWidth

public int getPreferredWidth()
Preferred width of this field.

Overrides:
getPreferredWidth in class Field
Returns:
Preferred width. Returns ViewfinderOverlay.VideoControlOverlayField.getDisplayWidth() by default.
Since:
BlackBerry API 7.0.0

getDisplayWidth

public int getDisplayWidth()
Width of the VideoControl.

Returns:
Width of the VideoControl.
See Also:
VideoControl.getDisplayWidth()
Since:
BlackBerry API 7.0.0

getPreferredHeight

public int getPreferredHeight()
Preferred height of this field.

Overrides:
getPreferredHeight in class Field
Returns:
Preferred height. Returns ViewfinderOverlay.VideoControlOverlayField.getDisplayHeight() by default.
Since:
BlackBerry API 7.0.0

getDisplayHeight

public int getDisplayHeight()
Height of the VideoControl.

Returns:
Height of the VideoControl.
See Also:
VideoControl.getDisplayHeight()
Since:
BlackBerry API 7.0.0

getXPosition

public int getXPosition()
X position of the VideoControl.

Specified by:
getXPosition in interface ViewfinderOverlay.OverlayCanvas.Positionable
Returns:
X position of the VideoControl.
See Also:
VideoControl.getDisplayX()
Since:
BlackBerry API 7.0.0

getYPosition

public int getYPosition()
Y position of the VideoControl.

Specified by:
getYPosition in interface ViewfinderOverlay.OverlayCanvas.Positionable
Returns:
Y position of the VideoControl.
See Also:
VideoControl.getDisplayY()
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