JClass DesktopViews 6.3.0 API
Documentation

com.klg.jclass.table
Class JCTableCellInfo

java.lang.Object
  |
  +--com.klg.jclass.table.JCTableCellInfo
All Implemented Interfaces:
JCCellInfo, Serializable, TableCellInfoModel

public class JCTableCellInfo
extends Object
implements TableCellInfoModel, Serializable

JCTableCellInfo is an object passed to CellRenderer and CellEditor objects to supply information about the type of cell being displayed or edited.

See Also:
Serialized Form

Field Summary
protected  Insets border_insets
           
protected  int column
           
protected  Object data
           
protected  Insets margin_insets
           
protected  int row
           
protected  com.klg.jclass.table.CellStyleModel style
           
protected  com.klg.jclass.table.JCTable table
           
 
Fields inherited from interface com.klg.jclass.table.TableCellInfoModel
BLACK_BRIGHTER, BLACK_DARKER, WHITE_BRIGHTER, WHITE_DARKER
 
Fields inherited from interface com.klg.jclass.cell.JCCellInfo
BOTTOM, CENTER, LEFT, RIGHT, SHOW_ALL, SHOW_HORIZONTAL, SHOW_NONE, SHOW_VERTICAL, TOP
 
Constructor Summary
JCTableCellInfo()
           
 
Method Summary
 Color getBackground()
          Returns the background color of the cell being displayed or edited.
 Insets getBorderInsets()
          Returns the Insets object representing the borders for the cell.
 int getBorderStyle()
          Returns the border style for the cell.
 com.klg.jclass.table.CellBorderModel getCellBorder()
          Returns the CellBorderModel for the cell.
 int getCellBorderSides()
          Returns the BorderSides for the cell.
 com.klg.jclass.table.CellStyleModel getCellStyle()
          Returns the CellStyle object that contains the property setting for the cell.
 int getClipHints()
          Determines whether the renderer should draw some indication if the entire contents of the cell cannot be rendered within the given area.
 int getColumn()
          Returns the column for the cell.
 Class getDataType()
          Returns the cell's associated data type.
 Rectangle getDrawingArea()
          Returns the dimensions of the drawing area for the cell being displayed or edited.
 Font getFont()
          Returns the font of the cell being displayed or edited.
 FontMetrics getFontMetrics()
          Returns the FontMetrics object associated with the font used in the cell.
 Color getForeground()
          Returns the foreground color of the cell being displayed or edited.
 int getHorizontalAlignment()
          Returns the horizontal alignment for the cell being displayed or edited.
 Insets getMarginInsets()
          Returns the Insets object representing the margins for the cell.
protected  Color getRepeatColor(int row, int column, int repeat, Color[] list)
          Gets the color of a cell from the repeated background or foreground list.
 int getRow()
          Returns the row for the cell.
 boolean getSelectAll()
          Determines whether the editor should select the contents before editing.
 Color getSelectedBackground()
          Returns the background color of the cell being displayed or edited when the cell is selected.
protected  Color getSelectedColor(int mode)
          SelectedBackgroundMode and SelectedForegroundMode determine how the selected color is obtained for a cell.
 Color getSelectedForeground()
          Returns the foreground color of the cell being displayed or edited when the cell is selected.
 com.klg.jclass.table.JCTable getTable()
          Returns the table object associated with the cell.
 int getVerticalAlignment()
          Returns the vertical alignment for the cell being displayed or edited.
 void initialize(com.klg.jclass.table.JCTable table, Object o, int row, int column)
          Initializes the JCTableCellInfo object with the cell position and data value.
 void initialize(com.klg.jclass.table.JCTable table, Object o, int row, int column, com.klg.jclass.table.CellStyleModel style)
          Initializes the JCTableCellInfo object with the cell position, data value, and CellStyleModel.
 boolean isEditable()
          Determines whether the cell is editable.
 boolean isEnabled()
          Determines whether the cell is enabled.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

table

protected com.klg.jclass.table.JCTable table

row

protected int row

column

protected int column

style

protected com.klg.jclass.table.CellStyleModel style

data

protected Object data

margin_insets

protected Insets margin_insets

border_insets

protected Insets border_insets
Constructor Detail

JCTableCellInfo

public JCTableCellInfo()
Method Detail

initialize

public void initialize(com.klg.jclass.table.JCTable table,
                       Object o,
                       int row,
                       int column)
Initializes the JCTableCellInfo object with the cell position and data value.

Specified by:
initialize in interface TableCellInfoModel
Parameters:
column -
o -
row -
table -

initialize

public void initialize(com.klg.jclass.table.JCTable table,
                       Object o,
                       int row,
                       int column,
                       com.klg.jclass.table.CellStyleModel style)
Initializes the JCTableCellInfo object with the cell position, data value, and CellStyleModel.

Specified by:
initialize in interface TableCellInfoModel
Parameters:
column -
o -
row -
style -
table -

getCellStyle

public com.klg.jclass.table.CellStyleModel getCellStyle()
Returns the CellStyle object that contains the property setting for the cell.

Specified by:
getCellStyle in interface TableCellInfoModel
Returns:
CellStyle object

getBackground

public Color getBackground()
Returns the background color of the cell being displayed or edited.

Specified by:
getBackground in interface JCCellInfo
Returns:
background color

getForeground

public Color getForeground()
Returns the foreground color of the cell being displayed or edited. Container sets the foreground color on the graphics object it passes to CellRenderer.draw().

Specified by:
getForeground in interface JCCellInfo
Returns:
foreground color

getSelectedBackground

public Color getSelectedBackground()
Returns the background color of the cell being displayed or edited when the cell is selected.

Specified by:
getSelectedBackground in interface JCCellInfo
Returns:
background color

getSelectedForeground

public Color getSelectedForeground()
Returns the foreground color of the cell being displayed or edited when the cell is selected.

Specified by:
getSelectedForeground in interface JCCellInfo
Returns:
foreground color

getSelectedColor

protected Color getSelectedColor(int mode)
SelectedBackgroundMode and SelectedForegroundMode determine how the selected color is obtained for a cell.

Parameters:
mode -
Returns:

getFont

public Font getFont()
Returns the font of the cell being displayed or edited. Container sets the font on the graphics object it passes to CellRenderer.draw().

Specified by:
getFont in interface JCCellInfo
Returns:
font of the cell being displayed or edited

getFontMetrics

public FontMetrics getFontMetrics()
Returns the FontMetrics object associated with the font used in the cell.

Returns:
FontMetrics object

getHorizontalAlignment

public int getHorizontalAlignment()
Returns the horizontal alignment for the cell being displayed or edited. Valid return values are LEFT, CENTER, and RIGHT.

Specified by:
getHorizontalAlignment in interface JCCellInfo
Returns:
horizontal alignment; one of LEFT, CENTER, or RIGHT

getVerticalAlignment

public int getVerticalAlignment()
Returns the vertical alignment for the cell being displayed or edited. Valid return values are TOP, CENTER, and BOTTOM.

Specified by:
getVerticalAlignment in interface JCCellInfo
Returns:
vertical alignment; one of TOP, CENTER, or BOTTOM

getMarginInsets

public Insets getMarginInsets()
Returns the Insets object representing the margins for the cell.

Specified by:
getMarginInsets in interface JCCellInfo
Returns:
Insets object

getBorderInsets

public Insets getBorderInsets()
Returns the Insets object representing the borders for the cell.

Specified by:
getBorderInsets in interface JCCellInfo
Returns:
Insets object

getBorderStyle

public int getBorderStyle()
Returns the border style for the cell. The return result from this method is meaningless for Table because of it's Border model. Other products that use the Cell package may use this value.

Specified by:
getBorderStyle in interface JCCellInfo
Returns:
border style

getDrawingArea

public Rectangle getDrawingArea()
Returns the dimensions of the drawing area for the cell being displayed or edited. When the renderer's draw method is called, the gc is translated to the upper left-hand corner of the drawing area for the cell. As a result, the (x,y) coordinates of the Rectangle are always (0,0).

Specified by:
getDrawingArea in interface JCCellInfo
Returns:
size of the drawing area

isEditable

public boolean isEditable()
Determines whether the cell is editable.

Specified by:
isEditable in interface JCCellInfo
Returns:

isEnabled

public boolean isEnabled()
Determines whether the cell is enabled.

Specified by:
isEnabled in interface JCCellInfo
Returns:

getSelectAll

public boolean getSelectAll()
Determines whether the editor should select the contents before editing.

Specified by:
getSelectAll in interface JCCellInfo
Returns:

getClipHints

public int getClipHints()
Determines whether the renderer should draw some indication if the entire contents of the cell cannot be rendered within the given area.

Specified by:
getClipHints in interface JCCellInfo
Returns:

getDataType

public Class getDataType()
Returns the cell's associated data type. Three steps are taken to obtain the data type. First, if the CellStyleModel for the cell has a data type, which is returned. Second, the getColumnClass(int column) method is called to obtain the Class for the column. Finally, if the data type is still null, the Class of the cell value is returned.

Specified by:
getDataType in interface JCCellInfo
Returns:
cell's associated data type

getTable

public com.klg.jclass.table.JCTable getTable()
Returns the table object associated with the cell.

Specified by:
getTable in interface TableCellInfoModel
Returns:
table object associated with the cell

getRow

public int getRow()
Returns the row for the cell.

Specified by:
getRow in interface TableCellInfoModel
Returns:
row for the cell

getColumn

public int getColumn()
Returns the column for the cell.

Specified by:
getColumn in interface TableCellInfoModel
Returns:
column for the cell

getCellBorder

public com.klg.jclass.table.CellBorderModel getCellBorder()
Returns the CellBorderModel for the cell.

Specified by:
getCellBorder in interface TableCellInfoModel
Returns:
CellBorderModel for the cell

getCellBorderSides

public int getCellBorderSides()
Returns the BorderSides for the cell.

Specified by:
getCellBorderSides in interface TableCellInfoModel
Returns:
BorderSides for the cell

getRepeatColor

protected Color getRepeatColor(int row,
                               int column,
                               int repeat,
                               Color[] list)
Gets the color of a cell from the repeated background or foreground list.

Parameters:
column -
list -
repeat -
row -
Returns:

Copyright © 2004 Quest Software Inc..
All rights reserved.