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

java.lang.Object
  extended by com.sybase.uep.bobclient.controls.celltable.Cell
All Implemented Interfaces:
ICell

public class Cell
extends java.lang.Object
implements ICell

Represents a cell of a cell table

Author:
congchen

Constructor Summary
Cell(CellTable celltable, int cellIndex)
          Constructor
Cell(int cellIndex)
          Constructor
 
Method Summary
 void addCellAttribute(IControlXYDraw control, int rowSpan, int colSpan)
          Adds a cell attribute to the cell
 void drawCell(net.rim.device.api.ui.Graphics graphics, int x, int y, int cellIndex, boolean isFocus)
          Draws the cell
 java.util.Vector getCellAttributes()
          Gets all drawing items in the cell
 int getFocusCellHeight()
          Gets height of a focused cell
 int getIndex()
          Gets the index of the cell.
 int getPreferredHeight()
          Gets preferred height of a cell
 int getPreferredWidth()
          Gets preferred width of a cell
 int getUnfocusCellHeight()
          Gets height of a unfocused cell
 void initCell()
          Produces cell attributes
 boolean isFocus()
          Gets the focus status of a cell
 void layout()
          Layouts the cell content
 void resetCell()
          Resets controls in a cell
 void setCellTable(CellTable celltable)
          Sets cell table to this cell.
 void setFocus(boolean isFocus)
          Sets focus status of a cell
 void setFocusCellHeight(int focusCellHeight)
          Sets height for a focused cell
 void setIndex(int index)
          Sets index of a cell
 void setUnfocusCellHeight(int unfocusCellHeight)
          Sets height for a unfocused cell
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Cell

public Cell(int cellIndex)
Constructor

Parameters:
cellIndex - cell index

Cell

public Cell(CellTable celltable,
            int cellIndex)
Constructor

Parameters:
celltable - cell table
cellIndex - cell index
Method Detail

drawCell

public void drawCell(net.rim.device.api.ui.Graphics graphics,
                     int x,
                     int y,
                     int cellIndex,
                     boolean isFocus)
Description copied from interface: ICell
Draws the cell

Specified by:
drawCell in interface ICell
Parameters:
graphics - - Graphics object
x - - X coordinator or the cell
y - - Y coordinator of the cell
cellIndex - - index of the cell that is drawing
isFocus - - true means the cell is focused

initCell

public void initCell()
Produces cell attributes

Specified by:
initCell in interface ICell

resetCell

public void resetCell()
Resets controls in a cell

Specified by:
resetCell in interface ICell
Parameters:
cellIndex - - index of the cell

setFocus

public void setFocus(boolean isFocus)
Description copied from interface: ICell
Sets focus status of a cell

Specified by:
setFocus in interface ICell
Parameters:
isFocus - - true means the cell is focused

isFocus

public boolean isFocus()
Description copied from interface: ICell
Gets the focus status of a cell

Specified by:
isFocus in interface ICell
Returns:
true means the cell is focused

getPreferredWidth

public int getPreferredWidth()
Description copied from interface: ICell
Gets preferred width of a cell

Specified by:
getPreferredWidth in interface ICell
Returns:
preferred width

getPreferredHeight

public int getPreferredHeight()
Description copied from interface: ICell
Gets preferred height of a cell

Specified by:
getPreferredHeight in interface ICell
Returns:
preferred height

getCellAttributes

public java.util.Vector getCellAttributes()
Description copied from interface: ICell
Gets all drawing items in the cell

Specified by:
getCellAttributes in interface ICell
Returns:
vector of cell item

getIndex

public int getIndex()
Description copied from interface: ICell
Gets the index of the cell. The index is used among cells of a cell table to determine the position sequence

Specified by:
getIndex in interface ICell
Returns:
the cell index

setIndex

public void setIndex(int index)
Description copied from interface: ICell
Sets index of a cell

Specified by:
setIndex in interface ICell
Parameters:
index - - used among cells of a cell table to determine the position sequence

layout

public void layout()
Description copied from interface: ICell
Layouts the cell content

Specified by:
layout in interface ICell

getFocusCellHeight

public int getFocusCellHeight()
Description copied from interface: ICell
Gets height of a focused cell

Specified by:
getFocusCellHeight in interface ICell
Returns:
cell height

setFocusCellHeight

public void setFocusCellHeight(int focusCellHeight)
Description copied from interface: ICell
Sets height for a focused cell

Specified by:
setFocusCellHeight in interface ICell
Parameters:
focusCellHeight - - height in pixel

getUnfocusCellHeight

public int getUnfocusCellHeight()
Description copied from interface: ICell
Gets height of a unfocused cell

Specified by:
getUnfocusCellHeight in interface ICell
Returns:
cell height

setUnfocusCellHeight

public void setUnfocusCellHeight(int unfocusCellHeight)
Description copied from interface: ICell
Sets height for a unfocused cell

Specified by:
setUnfocusCellHeight in interface ICell
Parameters:
unfocusCellHeight - - height in pixel

addCellAttribute

public void addCellAttribute(IControlXYDraw control,
                             int rowSpan,
                             int colSpan)
Adds a cell attribute to the cell

Parameters:
control - - cell attribute, eg. CellImage or CellLabel
rowSpan -
colSpan -

setCellTable

public void setCellTable(CellTable celltable)
Sets cell table to this cell.

Parameters:
celltable - the cell table to set