JClass DesktopViews 6.3.0 API
Documentation

com.klg.jclass.page
Class PageTableCellInfo

java.lang.Object
  |
  +--com.klg.jclass.page.PageTableCellInfo
All Implemented Interfaces:
JCCellInfo, Serializable

public class PageTableCellInfo
extends Object
implements JCCellInfo

Creates a JClass PageLayout-specific implementation of the JCCellInfo interface so we can pass information from a JCPageTable to a JCCellRenderer to draw table cells.

See Also:
Serialized Form

Field Summary
protected  int column
          The column of the cell in the table
protected  Rectangle drawingArea
          The drawing area represented by this cell -- set externally
protected  int row
          The row of the cell in the table
protected  com.klg.jclass.page.JCPageTable table
          The table to which the cell belongs
 
Fields inherited from interface com.klg.jclass.cell.JCCellInfo
BOTTOM, CENTER, LEFT, RIGHT, SHOW_ALL, SHOW_HORIZONTAL, SHOW_NONE, SHOW_VERTICAL, TOP
 
Constructor Summary
PageTableCellInfo(com.klg.jclass.page.JCPageTable table, int row, int column)
          Creates a TableCellInfo object for a given table cell.
 
Method Summary
 Color getBackground()
          Returns the background colour of the cell being displayed.
 Insets getBorderInsets()
          Returns the Insets object representing the borders for the cell.
 int getBorderStyle()
          Returns the border style 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.
 Class getDataType()
          Returns the cell's associated data type.
 Rectangle getDrawingArea()
          Returns the dimensions of the drawing area for the cell being displayed.
 Font getFont()
          Returns the font of the cell being displayed.
 Color getForeground()
          Returns the foreground colour of the cell being displayed.
 int getHorizontalAlignment()
          Returns the horizontal alignment for the cell being displayed.
 Insets getMarginInsets()
          Returns the Insets object representing the margins 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 when the cell is selected.
 Color getSelectedForeground()
          Returns the foreground color of the cell being displayed when the cell is selected.
 int getVerticalAlignment()
          Returns the vertical alignment for the cell being displayed.
 boolean isEditable()
          Determines whether the cell is editable.
 boolean isEnabled()
          Determines whether the cell is enabled.
 void setDrawingArea(Rectangle rect)
           
 
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.page.JCPageTable table
The table to which the cell belongs


row

protected int row
The row of the cell in the table


column

protected int column
The column of the cell in the table


drawingArea

protected Rectangle drawingArea
The drawing area represented by this cell -- set externally

Constructor Detail

PageTableCellInfo

public PageTableCellInfo(com.klg.jclass.page.JCPageTable table,
                         int row,
                         int column)
Creates a TableCellInfo object for a given table cell.

Parameters:
table - The table the cell belongs to
row - The row index of the cell in the table
column - The column index of the cell in the table
Method Detail

getBackground

public Color getBackground()
Returns the background colour of the cell being displayed.

Specified by:
getBackground in interface JCCellInfo
Returns:
The colour to draw in the cell's background

getForeground

public Color getForeground()
Returns the foreground colour of the cell being displayed.

Specified by:
getForeground in interface JCCellInfo
Returns:
The colour to draw the cell's foreground in

getSelectedBackground

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

Specified by:
getSelectedBackground in interface JCCellInfo
Returns:
The colour to draw in the cell's background

getSelectedForeground

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

Specified by:
getSelectedForeground in interface JCCellInfo
Returns:
The color to draw the cell's foreground in

getFont

public Font getFont()
Returns the font of the cell being displayed.

Specified by:
getFont in interface JCCellInfo
Returns:
The font used to draw the cell

getHorizontalAlignment

public int getHorizontalAlignment()
Returns the horizontal alignment for the cell being displayed.

Specified by:
getHorizontalAlignment in interface JCCellInfo
Returns:
The position of the cell contents relative to the column

getVerticalAlignment

public int getVerticalAlignment()
Returns the vertical alignment for the cell being displayed.

Specified by:
getVerticalAlignment in interface JCCellInfo
Returns:
The position of the cell contents relative to the row space

getMarginInsets

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

This method should be applied to editor components but not to renderer components since the renderer has already been mapped inside the area bounded by the margins and borders.

Specified by:
getMarginInsets in interface JCCellInfo
Returns:
Insets object representing the margins for the cell

getBorderInsets

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

This method should be ignored by editor and renderer components since the editor is deliberately made bigger than the renderer by this amount.

Specified by:
getBorderInsets in interface JCCellInfo
Returns:
Insets object representing the borders for the cell

getBorderStyle

public int getBorderStyle()
Returns the border style for the cell. Renderers and Editors should ignore this value.

Specified by:
getBorderStyle in interface JCCellInfo
Returns:
border style for the cell

getDrawingArea

public Rectangle getDrawingArea()
Returns the dimensions of the drawing area for the cell being displayed. 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) of the Rectangle are always (0,0).

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

setDrawingArea

public void setDrawingArea(Rectangle rect)

isEditable

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

Specified by:
isEditable in interface JCCellInfo
Returns:
Always returns false for PageLayout tables

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:
Always returns false for PageLayout tables

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.

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

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