com.sybase.uep.bobclient.controls.celltable
Class CellImage

java.lang.Object
  extended by net.rim.device.api.ui.Field
      extended by net.rim.device.api.ui.component.BitmapField
          extended by com.sybase.uep.bobclient.controls.ImageControl
              extended by com.sybase.uep.bobclient.controls.celltable.CellImage
All Implemented Interfaces:
Control, IControlXYDraw, net.rim.device.api.ui.DrawStyle

public class CellImage
extends ImageControl
implements IControlXYDraw

Author:
congchen

Field Summary
 
Fields inherited from class com.sybase.uep.bobclient.controls.ImageControl
_controlID, _customEventsHandler, _orientation, DEFAULT_UNDEFINED_IMAGE_MESSAGE
 
Fields inherited from class net.rim.device.api.ui.component.BitmapField
STAMP_MONOCHROME
 
Fields inherited from class net.rim.device.api.ui.Field
ACTION_INVOKE, 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.DrawStyle
BASELINE, BOTTOM, ELLIPSIS, HALIGN_MASK, HCENTER, HDEFAULT, HFULL, LEADING, LEFT, RIGHT, TOP, TRAILING, TRUNCATE_BEGINNING, VALIGN_MASK, VCENTER, VDEFAULT, VFULL
 
Constructor Summary
CellImage()
           
CellImage(long style)
           
 
Method Summary
 void addValueImageMapping(java.lang.String value, java.lang.String imageName)
          Adds a pair of MBO attribute value and the mapping image file
 void draw(net.rim.device.api.ui.Graphics g, int relativeX, int relativeY, boolean isFocus)
          Draws the item that implements the interface
 int getAbsoluteXPos()
          Returns the cell image's absolute X position.
 int getAbsoluteXPosFocus()
          Returns the cell image's absolute X position when focused.
 int getAbsoluteYPos()
          Returns the cell image's absolute Y position.
 int getAbsoluteYPosFocus()
          Returns the cell image's absolute Y position when focused.
 net.rim.device.api.system.EncodedImage getImage()
          Gets the EncodedImage instance
 CellImageConfig getImageConfig()
          Gets the configuration of the cell image
 int getMaxImageHeight()
          Gets the maximum height that the image is allowed to be scaled to
 int getMaxImageWidth()
          Gets the maximum width that the image is allowed to be scaled to
 int getPreferredHeight()
          (non-Javadoc)
 int getPreferredWidth()
          (non-Javadoc)
 int getXPosition(boolean isFocus)
          Gets the X coordinator of the drawing item
 int getYPosition(boolean isFocus)
          Gets the Y coordinator of the drawing item
 void setColSpan(int colSpan)
          (non-Javadoc)
 void setDefaultValueMappingImageName(java.lang.String defaultValueMappingImageName)
          Sets the default value mapping image file name
 void setImage(net.rim.device.api.system.EncodedImage image)
           
 void setImageConfig(CellImageConfig imageConfig)
          Sets configuration to the cell image
 void setImageName(java.lang.String imageName)
          Sets image name
 void setImageType(int imageType)
          Sets image type
 void setMaxImageHeight(int maxImageHeight)
          Sets the maximum height to the image
 void setMaxImageWidth(int maxImageWidth)
          Sets the maximum width to the image
 void setMboAttrId(java.lang.String mboAttributeId)
          Sets MBO attribute id of the image
 void setNewImageName(java.lang.String newImageName)
          Sets the name of image file that indicates 'new' state of a MBO
 void setOrder(int order)
          Sets image order
 void setPendingImageName(java.lang.String pendingImageName)
          Sets the name of image file that indicates 'pending' state of a MBO
 void setPreserveAspectRatio(boolean isPreserveAspectRatio)
          Sets if preserve aspect ratio
 void setRowSpan(int rowSpan)
          (non-Javadoc)
 void setVariable(ControlVariable variable)
          Sets image variable
 void setXPosition(int xPos, boolean isFocus)
          Sets the X coordinator of the drawing item
 void setYPosition(int yPos, boolean isFocus)
          Sets the Y coordinator of the drawing item
 
Methods inherited from class com.sybase.uep.bobclient.controls.ImageControl
drawFocus, getAction, getBitmapImage, getColSpan, getControlID, getCustomEventsDelegate, getHorizontalAlignment, getName, getRowSpan, getValue, getVerticalAlignment, layout, makeContextMenu, navigationClick, navigationMovement, navigationUnclick, onDisplay, onFocus, onUnfocus, paint, refresh, refreshFooter, runAction, setAction, setBackgroundColor, setControlID, setCustomEventsDelegate, setFocusDisplayValue, setFooterField, setImage, setImage, setImage, setLayoutHeight, setLayoutWidth, setScaleAspectFit, setVariableSource, touchEvent
 
Methods inherited from class net.rim.device.api.ui.component.BitmapField
getBitmap, getBitmapHeight, getBitmapWidth, paintBitmap, setBitmap, setSpace
 
Methods inherited from class net.rim.device.api.ui.Field
drawHighlightRegion, fieldChangeNotify, focusAdd, focusChangeNotify, focusRemove, getAccessibleContext, getBackground, getBackground, getBorder, getBorder, getBorder, getChangeListener, getContentHeight, getContentLeft, getContentRect, getContentRect, getContentTop, getContentWidth, getContextMenu, 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, getState, getStyle, getTop, getVisualState, getWidth, invalidate, invalidate, invalidateAll, invokeAction, isDataValid, isDirty, isEditable, isFocus, isFocusable, isMuddy, isPasteable, isSelectable, isSelecting, isSelectionCopyable, isSelectionCutable, isSelectionDeleteable, isSpellCheckable, isStyle, isVisible, keyChar, keyControl, keyDown, keyRepeat, keyStatus, keyUp, makeContextMenu, moveFocus, moveFocus, onExposed, onMenuDismissed, onMenuDismissed, onObscured, onUndisplay, onVisibilityChange, paintBackground, paste, select, selectionCopy, selectionCut, selectionDelete, setBackground, setBackground, setBorder, setBorder, setBorder, setBorder, setBorder, setChangeListener, setCookie, setDirty, setEditable, setExtent, setFocus, setFocusListener, setFont, setFont, setMargin, setMargin, setMuddy, setNonSpellCheckable, setPadding, setPadding, setPosition, setVisualState, trackwheelClick, trackwheelUnclick, updateLayout
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CellImage

public CellImage()

CellImage

public CellImage(long style)
Method Detail

setImage

public void setImage(net.rim.device.api.system.EncodedImage image)
Overrides:
setImage in class net.rim.device.api.ui.component.BitmapField

getImage

public net.rim.device.api.system.EncodedImage getImage()
Gets the EncodedImage instance

Returns:
EncodedImage

getPreferredHeight

public int getPreferredHeight()
Description copied from class: ImageControl
(non-Javadoc)

Specified by:
getPreferredHeight in interface Control
Overrides:
getPreferredHeight in class ImageControl
Returns:
int value of the available layout height
See Also:
Control.getPreferredHeight()

getPreferredWidth

public int getPreferredWidth()
Description copied from class: ImageControl
(non-Javadoc)

Specified by:
getPreferredWidth in interface Control
Overrides:
getPreferredWidth in class ImageControl
Returns:
int value of the available layout width
See Also:
Control.getPreferredWidth()

getMaxImageWidth

public int getMaxImageWidth()
Gets the maximum width that the image is allowed to be scaled to

Returns:
the maximum width

setMaxImageWidth

public void setMaxImageWidth(int maxImageWidth)
Sets the maximum width to the image

Parameters:
maxImageWidth - - maximum width that the image is allowed to be scaled to

getMaxImageHeight

public int getMaxImageHeight()
Gets the maximum height that the image is allowed to be scaled to

Returns:
the maximum height

setMaxImageHeight

public void setMaxImageHeight(int maxImageHeight)
Sets the maximum height to the image

Parameters:
maxImageHeight - - maximum height that the image is allowed to be scaled to

draw

public void draw(net.rim.device.api.ui.Graphics g,
                 int relativeX,
                 int relativeY,
                 boolean isFocus)
Description copied from interface: IControlXYDraw
Draws the item that implements the interface

Specified by:
draw in interface IControlXYDraw
Parameters:
g - - Graphics object
relativeX - - relative X coordinator
relativeY - - relative Y coordinator
isFocus - - true means the control is focused

setXPosition

public void setXPosition(int xPos,
                         boolean isFocus)
Description copied from interface: IControlXYDraw
Sets the X coordinator of the drawing item

Specified by:
setXPosition in interface IControlXYDraw
Parameters:
xPos - - X coordinator
isFocus - - true means xPos is the position when the control is focused

getXPosition

public int getXPosition(boolean isFocus)
Description copied from interface: IControlXYDraw
Gets the X coordinator of the drawing item

Specified by:
getXPosition in interface IControlXYDraw
Parameters:
isFocus - - true means the method returns the position when the control is focused
Returns:
the X coordinator

setYPosition

public void setYPosition(int yPos,
                         boolean isFocus)
Description copied from interface: IControlXYDraw
Sets the Y coordinator of the drawing item

Specified by:
setYPosition in interface IControlXYDraw
Parameters:
yPos - - Y coordinator
isFocus - - true means yPos is the position when the control is focused

getYPosition

public int getYPosition(boolean isFocus)
Description copied from interface: IControlXYDraw
Gets the Y coordinator of the drawing item

Specified by:
getYPosition in interface IControlXYDraw
Parameters:
isFocus - - true means the method returns the position when the control is focused
Returns:
the Y coordinator

getImageConfig

public CellImageConfig getImageConfig()
Gets the configuration of the cell image

Returns:
CellImageConfig

setImageConfig

public void setImageConfig(CellImageConfig imageConfig)
Sets configuration to the cell image

Parameters:
imageConfig -

setRowSpan

public void setRowSpan(int rowSpan)
Description copied from class: ImageControl
(non-Javadoc)

Specified by:
setRowSpan in interface Control
Overrides:
setRowSpan in class ImageControl
Parameters:
rowSpan - int value of the row span
See Also:
Control.setRowSpan(int rowspan)

setColSpan

public void setColSpan(int colSpan)
Description copied from class: ImageControl
(non-Javadoc)

Specified by:
setColSpan in interface Control
Overrides:
setColSpan in class ImageControl
Parameters:
colSpan - int value of the column span
See Also:
Control.setColSpan(int colspan)

setImageName

public void setImageName(java.lang.String imageName)
Sets image name

Parameters:
imageName -

setVariable

public void setVariable(ControlVariable variable)
Sets image variable

Parameters:
variable -

setMboAttrId

public void setMboAttrId(java.lang.String mboAttributeId)
Sets MBO attribute id of the image

Parameters:
mboAttributeId -

setImageType

public void setImageType(int imageType)
Sets image type

Parameters:
imageType - - value comes from ICellAttributeTypeConstants

setOrder

public void setOrder(int order)
Sets image order

Parameters:
order - - used among cell attributes to determine display position

setPreserveAspectRatio

public void setPreserveAspectRatio(boolean isPreserveAspectRatio)
Sets if preserve aspect ratio

Parameters:
isPreserveAspectRatio - - true means keep the original width and height ratio when scaling image

setPendingImageName

public void setPendingImageName(java.lang.String pendingImageName)
Sets the name of image file that indicates 'pending' state of a MBO

Parameters:
pendingImageName - - image file name

setNewImageName

public void setNewImageName(java.lang.String newImageName)
Sets the name of image file that indicates 'new' state of a MBO

Parameters:
newImageName - - image file name

setDefaultValueMappingImageName

public void setDefaultValueMappingImageName(java.lang.String defaultValueMappingImageName)
Sets the default value mapping image file name

Parameters:
defaultValueMappingImageName - - image file name with file extension

addValueImageMapping

public void addValueImageMapping(java.lang.String value,
                                 java.lang.String imageName)
Adds a pair of MBO attribute value and the mapping image file

Parameters:
value - - MBO attribute value
imageName - - image file name with file extension

getAbsoluteXPos

public int getAbsoluteXPos()
Returns the cell image's absolute X position.

Returns:
the cell image's absolute X position.

getAbsoluteYPos

public int getAbsoluteYPos()
Returns the cell image's absolute Y position.

Returns:
the cell image's absolute Y position.

getAbsoluteXPosFocus

public int getAbsoluteXPosFocus()
Returns the cell image's absolute X position when focused.

Returns:
the cell image's absolute X position when focused.

getAbsoluteYPosFocus

public int getAbsoluteYPosFocus()
Returns the cell image's absolute Y position when focused.

Returns:
the cell image's absolute Y position when focused.