JClass DesktopViews 6.3.0 API
Documentation

com.klg.jclass.page
Class JCPageTable.Cell

java.lang.Object
  |
  +--com.klg.jclass.page.JCPageTable.Cell
Enclosing class:
JCPageTable

public class JCPageTable.Cell
extends Object

The Cell object describes a single cell of a JCPageTable.


Field Summary
protected  Color background
          The color used as a default background for table elements.
protected  com.klg.jclass.page.JCDrawStyle bottomBorder
          The bottom border is drawn at the bottom of the cell.
protected  JCUnit.Measure bottomMargin
          The width of the bottom margin between the border and the frame.
protected  int cellAlignment
          Cell alignment controls the vertical alignment of cells in this cell.
protected  JCUnit.Measure cellHeight
          The height of the cell is based on the size of its contents.
protected  int columnNumber
          The column of the table this cell appears in.
protected  JCPageTable.Column columnParent
          Column to which this cell belongs.
protected  com.klg.jclass.page.JCFrame frame
          The frame that contains the contents of the cell.
protected  boolean isSpanned
          Marker for cells which belong to (are obscured by) a span.
protected  JCUnit.Measure leftMargin
          The width of the left margin between the border and the frame.
protected  com.klg.jclass.page.JCDrawStyle rightBorder
          The right border is drawn at the right of the cell.
protected  JCUnit.Measure rightMargin
          The width of the right margin between the border and the frame.
protected  int rowNumber
          The row of the table this cell appears in.
protected  JCPageTable.Row rowParent
          Row which owns this cell.
protected  int spanColumns
          The number of columns the cell spans to the right.
protected  Point spanOrigin
          The root cell of the span.
protected  int spanRows
          The number of rows the cell spans downward.
protected  com.klg.jclass.page.JCTextStyle textStyle
          The text style used to format the text in the cell.
protected  JCUnit.Measure topMargin
          The width of the top margin between the border and the frame.
protected  JCUnit.Measure width
          The width of the cell is based on the width of its column.
 
Constructor Summary
JCPageTable.Cell()
          Creates an empty cell object.
JCPageTable.Cell(JCPageTable.Row parent, int position)
          Creates a cell object as a child of the given table.
 
Method Summary
 JCUnit.Measure fixHeight()
          Computes the height of the cell based on the height of the cell's frame.
 Color getBackgroundColor()
          Gets the color that will be used to paint the cell's background.
 com.klg.jclass.page.JCDrawStyle getBottomBorderStyle()
          Gets the border style applied to the bottom (row border) of the cell.
protected  com.klg.jclass.page.JCDrawStyle getBottomEdgeStyle()
          Gets the bottom border style of this cell position (if there is no bottom border because of a span, this will return null).
 JCUnit.Measure getBottomMargin()
          Gets the effective width of the bottom margin.
 int getCellAlignment()
          Gets the alignment of the cell with respect to its row.
 Object getCellValue()
          Gets the value assigned to this cell.
 JCPageTable.Column getColumn()
          Gets the column parent of the cell in the table.
 int getColumnNumber()
          Gets the column co-ordinate of the cell in the table.
 com.klg.jclass.page.JCFrame getFrame()
          Gets the contents from from this cell.
 com.klg.jclass.page.JCFrame getFrameRaw()
          Gets the frame (if any) which the cell has constructed.
 JCUnit.Measure getHeight()
          Gets the height of the cell (including the height of the cell's frame).
 JCUnit.Measure getLeftMargin()
          Gets the effective width of the left margin.
 com.klg.jclass.page.JCDrawStyle getRightBorderStyle()
          Gets the border style applied to the right (column border) of the cell.
protected  com.klg.jclass.page.JCDrawStyle getRightEdgeStyle()
          Gets the right border style of this cell position (if there is no right border because of a span, this will return null).
 JCUnit.Measure getRightMargin()
          Gets the effective width of the right margin.
 JCPageTable.Row getRow()
          Gets the row parent of the cell in the table.
 int getRowNumber()
          Gets the row co-ordinate of the cell in the table.
 int getSpanColumns()
          Gets the number of columns this cell spans over.
 Point getSpanOrigin()
          Returns the origin (root cell) of the spanning cell.
 int getSpanRows()
          Gets the number of rows this cell spans over.
 com.klg.jclass.page.JCTextStyle getStyle()
          Gets the cell style.
 JCUnit.Measure getTopMargin()
          Gets the effective width of the top margin.
 JCUnit.Measure getWidth()
          Gets the width of the cell.
 boolean isBackgroundColorInherited()
          Determines if the cell's background color attribute is inherited.
 boolean isBottomBorderInherited()
          Determines whether the style being returned for the bottom border is inherited.
 boolean isBottomMarginInherited()
          Determines if the size of the bottom margin is inherited.
 boolean isCellAlignmentInherited()
          Determines if the vertical cell alignment is inherited.
 boolean isCellValueInherited()
          Determines whether the table value for this cell is inherited.
 boolean isLeftMarginInherited()
          Determines whether the size of the left margin is inherited.
 boolean isRightBorderInherited()
          Determines if the style being returned for the right border is inherited.
 boolean isRightMarginInherited()
          Determines whether the size of the right margin is inherited.
 boolean isSpanned()
          Returns an indication whether this cell belongs to a span or not.
 boolean isStyleInherited()
          Determines if the text style used for this cell is inherited.
 boolean isTopMarginInherited()
          Determines if the size of the top margin is inherited.
protected  void paste(com.klg.jclass.page.JCFrame target, JCUnit.Measure x0, JCUnit.Measure y0)
          Adds the contents of this cell (cell frame) to the given frame.
protected  void paste(com.klg.jclass.page.JCFrame target, JCUnit.Measure x0, JCUnit.Measure y0, JCUnit.Margins mask)
          Adds the contents of this cell (cell frame) to the given frame subject to the given mask for clipping the cell.
protected  void paste(com.klg.jclass.page.JCFrame target, JCUnit.Measure x0, JCUnit.Measure y0, JCUnit.Measure space)
          Locates the contents of this cell (cell frame) in the given frame subject to the amount of vertical space available and the cell alignment.
protected  void pasteSpan(com.klg.jclass.page.JCFrame target, int startRow, int startColumn, int endRow, int endColumn, JCUnit.Measure x0, JCUnit.Measure y0)
          Pastes the portion of this spanned cell that lies within the given range of rows and columns of the table.
 void setBackgroundColor(Color color)
          Sets the color specified for painting the cell's background.
 void setBottomBorderStyle(com.klg.jclass.page.JCDrawStyle border)
          Sets the border style for the cell's bottom border.
 void setBottomMargin(JCUnit.Measure width)
          Sets the width of a cell's bottom margin.
 void setCellAlignment(int alignment)
          Sets the alignment of the cell with respect to its row.
 void setCellValue(Object value)
          Sets the value stored at this cell (set in the table data).
 void setHeight(JCUnit.Measure height)
          Sets the cell's height; this may override the dynamic sizing of the cell.
 void setLeftMargin(JCUnit.Measure width)
          Sets the width of a cell's left margin.
 void setRightBorderStyle(com.klg.jclass.page.JCDrawStyle border)
          Sets the border style for the cell's right border.
 void setRightMargin(JCUnit.Measure width)
          Sets the width of a cell's right margin.
 void setSpanOrigin(int row, int column)
          Sets the origin of a span.
 void setSpanOrigin(Point origin)
          Sets the origin of a span.
 void setSpanSize(int rows, int columns)
          Sets the number of rows and columns in the span.
 void setStyle(com.klg.jclass.page.JCTextStyle style)
          Sets the default cell text style.
 void setTopMargin(JCUnit.Measure width)
          Sets the width of a cell's top margin.
 void setWidth(JCUnit.Measure width)
          Sets the cell's width; this needs to be done after spanning.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

background

protected Color background
The color used as a default background for table elements.


bottomBorder

protected com.klg.jclass.page.JCDrawStyle bottomBorder
The bottom border is drawn at the bottom of the cell.


rightBorder

protected com.klg.jclass.page.JCDrawStyle rightBorder
The right border is drawn at the right of the cell.


textStyle

protected com.klg.jclass.page.JCTextStyle textStyle
The text style used to format the text in the cell.


cellAlignment

protected int cellAlignment
Cell alignment controls the vertical alignment of cells in this cell.


bottomMargin

protected JCUnit.Measure bottomMargin
The width of the bottom margin between the border and the frame.


leftMargin

protected JCUnit.Measure leftMargin
The width of the left margin between the border and the frame.


rightMargin

protected JCUnit.Measure rightMargin
The width of the right margin between the border and the frame.


topMargin

protected JCUnit.Measure topMargin
The width of the top margin between the border and the frame.


rowParent

protected JCPageTable.Row rowParent
Row which owns this cell.


columnParent

protected JCPageTable.Column columnParent
Column to which this cell belongs.


frame

protected com.klg.jclass.page.JCFrame frame
The frame that contains the contents of the cell.


cellHeight

protected JCUnit.Measure cellHeight
The height of the cell is based on the size of its contents.


width

protected JCUnit.Measure width
The width of the cell is based on the width of its column.


rowNumber

protected int rowNumber
The row of the table this cell appears in.


columnNumber

protected int columnNumber
The column of the table this cell appears in.


isSpanned

protected boolean isSpanned
Marker for cells which belong to (are obscured by) a span.


spanOrigin

protected Point spanOrigin
The root cell of the span.


spanRows

protected int spanRows
The number of rows the cell spans downward.


spanColumns

protected int spanColumns
The number of columns the cell spans to the right.

Constructor Detail

JCPageTable.Cell

public JCPageTable.Cell()
Creates an empty cell object.


JCPageTable.Cell

public JCPageTable.Cell(JCPageTable.Row parent,
                        int position)
Creates a cell object as a child of the given table.

Parameters:
parent - the parent row for this cell
position - the position of the cell in the table
Method Detail

isBackgroundColorInherited

public boolean isBackgroundColorInherited()
Determines if the cell's background color attribute is inherited.

Returns:
true if the background color is specified at a higher level

getBackgroundColor

public Color getBackgroundColor()
Gets the color that will be used to paint the cell's background.

Returns:
the color which will be painted under the cell

setBackgroundColor

public void setBackgroundColor(Color color)
Sets the color specified for painting the cell's background.

Parameters:
color - the cell's background color

isBottomBorderInherited

public boolean isBottomBorderInherited()
Determines whether the style being returned for the bottom border is inherited.

Returns:
true if the bottom border style is specified at a higher level

getBottomBorderStyle

public com.klg.jclass.page.JCDrawStyle getBottomBorderStyle()
Gets the border style applied to the bottom (row border) of the cell.

Returns:
the draw style used for the bottom border of the cell

setBottomBorderStyle

public void setBottomBorderStyle(com.klg.jclass.page.JCDrawStyle border)
Sets the border style for the cell's bottom border.

Parameters:
border - the draw style that describes the bottom border

isRightBorderInherited

public boolean isRightBorderInherited()
Determines if the style being returned for the right border is inherited.

Returns:
true if the right border style is specified at a higher level

getRightBorderStyle

public com.klg.jclass.page.JCDrawStyle getRightBorderStyle()
Gets the border style applied to the right (column border) of the cell.

Returns:
the draw style used for the right border of the cell

setRightBorderStyle

public void setRightBorderStyle(com.klg.jclass.page.JCDrawStyle border)
Sets the border style for the cell's right border.

Parameters:
border - the draw style that describes the right border

isCellAlignmentInherited

public boolean isCellAlignmentInherited()
Determines if the vertical cell alignment is inherited.

Returns:
true if a higher level specifies the effective cell alignment

getCellAlignment

public int getCellAlignment()
Gets the alignment of the cell with respect to its row.

Returns:
the vertical alignment of the cell in the row space

setCellAlignment

public void setCellAlignment(int alignment)
Sets the alignment of the cell with respect to its row.

Parameters:
alignment - the vertical alignment of the cell in the row space

isStyleInherited

public boolean isStyleInherited()
Determines if the text style used for this cell is inherited.

Returns:
true if this cell gets its alignment from a higher level object

getStyle

public com.klg.jclass.page.JCTextStyle getStyle()
Gets the cell style.

Returns:
the text style used in cell text

setStyle

public void setStyle(com.klg.jclass.page.JCTextStyle style)
Sets the default cell text style.

Parameters:
style - a text style to apply to text printed in this cell

isBottomMarginInherited

public boolean isBottomMarginInherited()
Determines if the size of the bottom margin is inherited.

Returns:
true if a higher-level component specifies the bottom margin

getBottomMargin

public JCUnit.Measure getBottomMargin()
Gets the effective width of the bottom margin.

Returns:
a measure of the width of the bottom margin for this cell

setBottomMargin

public void setBottomMargin(JCUnit.Measure width)
Sets the width of a cell's bottom margin.

Parameters:
width - the size of the bottom margin for this cell

isTopMarginInherited

public boolean isTopMarginInherited()
Determines if the size of the top margin is inherited.

Returns:
true if a higher-level component specifies the top margin

getTopMargin

public JCUnit.Measure getTopMargin()
Gets the effective width of the top margin.

Returns:
a measure of the width of the top margin for this cell

setTopMargin

public void setTopMargin(JCUnit.Measure width)
Sets the width of a cell's top margin.

Parameters:
width - the size of the top margin for this cell

isLeftMarginInherited

public boolean isLeftMarginInherited()
Determines whether the size of the left margin is inherited.

Returns:
true if a higher-level component specifies the left margin

getLeftMargin

public JCUnit.Measure getLeftMargin()
Gets the effective width of the left margin.

Returns:
a measure of the width of the left margin for this cell

setLeftMargin

public void setLeftMargin(JCUnit.Measure width)
Sets the width of a cell's left margin.

Parameters:
width - the size of the left margin for this cell

isRightMarginInherited

public boolean isRightMarginInherited()
Determines whether the size of the right margin is inherited.

Returns:
true if a higher-level component specifies the right margin

getRightMargin

public JCUnit.Measure getRightMargin()
Gets the effective width of the right margin.

Returns:
a measure of the width of the right margin for this cell

setRightMargin

public void setRightMargin(JCUnit.Measure width)
Sets the width of a cell's right margin.

Parameters:
width - the size of the right margin for this cell

isCellValueInherited

public boolean isCellValueInherited()
Determines whether the table value for this cell is inherited.

Returns:
true if a higher-level component specifies the cell's value

getCellValue

public Object getCellValue()
Gets the value assigned to this cell.

Returns:
an object stored in the TableDataModel for use in this cell

setCellValue

public void setCellValue(Object value)
Sets the value stored at this cell (set in the table data).

Parameters:
value - the object stored as the value of this cell

getHeight

public JCUnit.Measure getHeight()
Gets the height of the cell (including the height of the cell's frame).

Returns:
the height of the cell

setHeight

public void setHeight(JCUnit.Measure height)
Sets the cell's height; this may override the dynamic sizing of the cell.

Parameters:
height - the desired height of the cell

getWidth

public JCUnit.Measure getWidth()
Gets the width of the cell.

Returns:
the cell's width

setWidth

public void setWidth(JCUnit.Measure width)
Sets the cell's width; this needs to be done after spanning.
NOTE: Perhaps this shouldn't be part of the public API???

Parameters:
width - the new width of the cell

getFrame

public com.klg.jclass.page.JCFrame getFrame()
Gets the contents from from this cell.

Returns:
the frame into which the cell contents are drawn

getFrameRaw

public com.klg.jclass.page.JCFrame getFrameRaw()
Gets the frame (if any) which the cell has constructed.

Returns:
the frame into which the cell contents are drawn

isSpanned

public boolean isSpanned()
Returns an indication whether this cell belongs to a span or not.

Returns:
true if this cell is part of (subsumed by) a span

getSpanOrigin

public Point getSpanOrigin()
Returns the origin (root cell) of the spanning cell.

Returns:
the co-ordinates of the root cell of the span

setSpanOrigin

public void setSpanOrigin(Point origin)
Sets the origin of a span.

Parameters:
origin - the co-ordinates of the cell which is the root of the span

setSpanOrigin

public void setSpanOrigin(int row,
                          int column)
Sets the origin of a span.

Parameters:
row - the row co-ordinate of the root cell
column - the column co-ordinate of the root cell

getSpanRows

public int getSpanRows()
Gets the number of rows this cell spans over.

Returns:
the number of rows high that this span is

getSpanColumns

public int getSpanColumns()
Gets the number of columns this cell spans over.

Returns:
the number of columns wide that this span is

setSpanSize

public void setSpanSize(int rows,
                        int columns)
Sets the number of rows and columns in the span.

Parameters:
rows - the number of rows high the cell is
columns - the number of columns wide the cell is

getColumn

public JCPageTable.Column getColumn()
Gets the column parent of the cell in the table.

Returns:
the column to which this cell belongs

getColumnNumber

public int getColumnNumber()
Gets the column co-ordinate of the cell in the table.

Returns:
the number of the column to which this cell belongs

getRow

public JCPageTable.Row getRow()
Gets the row parent of the cell in the table.

Returns:
the row to which this cell belongs

getRowNumber

public int getRowNumber()
Gets the row co-ordinate of the cell in the table.

Returns:
the number of the row to which this cell belongs

fixHeight

public JCUnit.Measure fixHeight()
Computes the height of the cell based on the height of the cell's frame.

Returns:
the height of the cell

getBottomEdgeStyle

protected com.klg.jclass.page.JCDrawStyle getBottomEdgeStyle()
Gets the bottom border style of this cell position (if there is no bottom border because of a span, this will return null).

Returns:
the border style of the bottom of this cell position

getRightEdgeStyle

protected com.klg.jclass.page.JCDrawStyle getRightEdgeStyle()
Gets the right border style of this cell position (if there is no right border because of a span, this will return null).

Returns:
the border style of the right of this cell position

paste

protected void paste(com.klg.jclass.page.JCFrame target,
                     JCUnit.Measure x0,
                     JCUnit.Measure y0)
Adds the contents of this cell (cell frame) to the given frame.

Parameters:
target - the frame to draw paste the cell into
x0 - the x-coordinate of the location to paste the cell at
y0 - the y-coordinate of the location to paste the cell at

paste

protected void paste(com.klg.jclass.page.JCFrame target,
                     JCUnit.Measure x0,
                     JCUnit.Measure y0,
                     JCUnit.Margins mask)
Adds the contents of this cell (cell frame) to the given frame subject to the given mask for clipping the cell.

Parameters:
target - the frame to draw paste the cell into
x0 - the x-coordinate of the location to paste the cell at
y0 - the y-coordinate of the location to paste the cell at
mask - the clip mask to apply to displaying the cell

paste

protected void paste(com.klg.jclass.page.JCFrame target,
                     JCUnit.Measure x0,
                     JCUnit.Measure y0,
                     JCUnit.Measure space)
Locates the contents of this cell (cell frame) in the given frame subject to the amount of vertical space available and the cell alignment.

Parameters:
target - the frame to draw paste the cell into
x0 - the x-coordinate of the base location for the cell
y0 - the y-coordinate of the base location for the cell
space - the amount of vertical space available for the cell

pasteSpan

protected void pasteSpan(com.klg.jclass.page.JCFrame target,
                         int startRow,
                         int startColumn,
                         int endRow,
                         int endColumn,
                         JCUnit.Measure x0,
                         JCUnit.Measure y0)
Pastes the portion of this spanned cell that lies within the given range of rows and columns of the table.

Parameters:
target - the frame to draw paste the cell into
startRow - the first row of the table to display the span in
startColumn - the first column of the table to display the span in
endRow - the last row of the table to display the span in
endColumn - the last column of the table to display the span in
x0 - the x-coordinate of the base location for the cell
y0 - the y-coordinate of the base location for the cell

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