de.enough.polish.blackberry.nativeui
Class ItemField

java.lang.Object
  extended by net.rim.device.api.ui.Field
      extended by de.enough.polish.blackberry.nativeui.ItemField
All Implemented Interfaces:
Animatable, NativeItem

public class ItemField
extends net.rim.device.api.ui.Field
implements NativeItem

Paints a J2ME Polish field as it behaves normally instead of using a native BlackBerry representation.

Copyright Enough Software 2010

Author:
Robert Virkus, j2mepolish@enough.de

Field Summary
protected  Item polishItem
           
 
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
ItemField(Item parent)
          Creates a new custom field with a FIELD_LEFT style
ItemField(Item parent, long style)
          Creates a new custom field
 
Method Summary
 void animate(long currentTime, ClippingRegion repaintRegion)
          Animates this element.
 Item getPolishItem()
          Retrieves access to the parent item of this Native item.
protected  void layout(int width, int height)
           
 void notifyValueChanged(Item parent, Object value)
          Notifies the native implementation about a value change.
protected  void paint(net.rim.device.api.ui.Graphics g)
           
 
Methods inherited from class net.rim.device.api.ui.Field
applyTheme, assertHaveEventLock, drawFocus, drawHighlightRegion, fieldChangeNotify, focusAdd, focusChangeNotify, 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, getState, getStyle, getTop, getVisualState, getWidth, invalidate, invalidate, invalidateAll, invokeAction, isDataValid, isDirty, isEditable, isEnabled, isFocus, isFocusable, 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, paintBackground, paste, select, selectionCopy, selectionCut, selectionDelete, setBackground, setBackground, setBorder, setBorder, setBorder, setBorder, setChangeListener, setCommandItemProvider, setCookie, setDirty, setEditable, setEnabled, setExtent, setFocus, setFocusListener, setFont, setMargin, setMargin, setMinimalWidth, setMuddy, setNonSpellCheckable, setPadding, setPadding, setPosition, setVisualState, touchEvent, trackwheelClick, trackwheelRoll, trackwheelUnclick, updateLayout
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

polishItem

protected Item polishItem
Constructor Detail

ItemField

public ItemField(Item parent)
Creates a new custom field with a FIELD_LEFT style

Parameters:
parent - the parent item

ItemField

public ItemField(Item parent,
                 long style)
Creates a new custom field

Parameters:
parent - the parent item
style - the BlackBerry native style
Method Detail

layout

protected void layout(int width,
                      int height)
Specified by:
layout in class net.rim.device.api.ui.Field

paint

protected void paint(net.rim.device.api.ui.Graphics g)
Specified by:
paint in class net.rim.device.api.ui.Field

getPolishItem

public Item getPolishItem()
Description copied from interface: NativeItem
Retrieves access to the parent item of this Native item.

Specified by:
getPolishItem in interface NativeItem
Returns:
the parent item

notifyValueChanged

public void notifyValueChanged(Item parent,
                               Object value)
Description copied from interface: NativeItem
Notifies the native implementation about a value change. Note that this will call back the native item even when the NativeItem itself changes the value of the item.

Specified by:
notifyValueChanged in interface NativeItem
Parameters:
parent - the J2ME Polish parent item.
value - the new value, might be null

animate

public void animate(long currentTime,
                    ClippingRegion repaintRegion)
Description copied from interface: Animatable
Animates this element. Subclasses can override this method to create animations. The default implementation animates the background and the item view if present.

Specified by:
animate in interface Animatable
Parameters:
currentTime - the current time in milliseconds
repaintRegion - the repaint area that needs to be updated when this item is animated
See Also:
Item.addRelativeToContentRegion(ClippingRegion, int, int, int, int)