|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--dyntable.DefaultCellAttribute
$Id: DefaultCellAttribute.java,v 1.0 2005/09/25 jDynTable@gmx.de $
The DefaultCellAttribute implements different interfaces
and is used in AttributiveCellTableModel class to create the TableModel.
This class provides many methods for the adaption of different
table cell attributes (e. g. fonts) and also implements the combine / split
feature.
CAUTION: variable values like rowSize etc. must be synchronized to Table data
Field Summary |
---|
Fields inherited from interface dyntable.CellSpan |
---|
COLUMN, ROW |
Constructor Summary | |
---|---|
DefaultCellAttribute()
Construchts a new DefaultCellAttribute. |
|
DefaultCellAttribute(int numRows,
int numColumns)
Construchts a new DefaultCellAttribute with numRows rows and numColumns columns. |
Method Summary | |
---|---|
void |
addColumn()
Adds column to table. |
void |
addRow()
Adds column to table. |
void |
combine(int[] rows,
int[] columns)
Combines cells |
java.awt.Color |
getBackground(int row,
int column)
|
java.awt.Font |
getFont(int row,
int column)
Returns font object characterizing font in the cell row/column |
java.awt.Color |
getForeground(int row,
int column)
|
java.awt.Dimension |
getSize()
Getter method |
int[] |
getSpan(int row,
int column)
Returns cell span at position row/column. |
void |
insertRow(int row)
Adds column to table at a certain position. |
boolean |
isEditable(int row,
int column)
Returns editability of a cell |
boolean |
isVisible(int row,
int column)
A cell may be not visible if its neighbor cell is combined with it |
void |
setBackground(java.awt.Color color,
int[] rows,
int[] columns)
|
void |
setBackground(java.awt.Color color,
int row,
int column)
|
void |
setFont(java.awt.Font font,
int[] rows,
int[] columns)
Sets new font in the cell area defined by row/column |
void |
setFont(java.awt.Font font,
int row,
int column)
Sets new font in the cell row/column |
void |
setForeground(java.awt.Color color,
int[] rows,
int[] columns)
|
void |
setForeground(java.awt.Color color,
int row,
int column)
|
void |
setNotEditable(int row,
int column)
Set cell uneditable. |
void |
setSize(java.awt.Dimension size)
Setter method |
void |
setSpan(int[] span,
int row,
int column)
Sets cell span at position row/column |
void |
split(int row,
int column)
The opposite of combine. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public DefaultCellAttribute()
public DefaultCellAttribute(int numRows, int numColumns)
Method Detail |
public int[] getSpan(int row, int column)
CellSpan
getSpan
in interface CellSpan
row
- integer with Rowcolumn
- integer with Column
public void setSpan(int[] span, int row, int column)
CellSpan
setSpan
in interface CellSpan
row
- integer with Rowcolumn
- integer with Columnspan
- span of the cellpublic boolean isVisible(int row, int column)
CellSpan
isVisible
in interface CellSpan
row
- integer with Rowcolumn
- integer with Column
public void combine(int[] rows, int[] columns)
CellAttribute
combine
in interface CellAttribute
rows
- Array of integers with Rows that are to be combinedcolumns
- Array of integers with Columns that are to be combinedpublic void split(int row, int column)
CellAttribute
split
in interface CellAttribute
row
- integer with Rowcolumn
- integer with Columnpublic java.awt.Color getForeground(int row, int column)
getForeground
in interface ColoredCell
public void setForeground(java.awt.Color color, int row, int column)
setForeground
in interface ColoredCell
public void setForeground(java.awt.Color color, int[] rows, int[] columns)
setForeground
in interface ColoredCell
public java.awt.Color getBackground(int row, int column)
getBackground
in interface ColoredCell
public void setBackground(java.awt.Color color, int row, int column)
setBackground
in interface ColoredCell
public void setBackground(java.awt.Color color, int[] rows, int[] columns)
setBackground
in interface ColoredCell
public void setNotEditable(int row, int column)
CellAttribute
setNotEditable
in interface CellAttribute
row
- integer with Rowcolumn
- integer with Columnpublic boolean isEditable(int row, int column)
CellAttribute
isEditable
in interface CellAttribute
row
- integer with Rowcolumn
- integer with Column
public java.awt.Font getFont(int row, int column)
CellFont
getFont
in interface CellFont
row
- integer with Rowcolumn
- integer with Column
public void setFont(java.awt.Font font, int row, int column)
CellFont
setFont
in interface CellFont
font
- new font for the cellrow
- integer with Rowcolumn
- integer with Columnpublic void setFont(java.awt.Font font, int[] rows, int[] columns)
CellFont
setFont
in interface CellFont
font
- new font for the cellsrows
- Array of integers with Rowscolumns
- Array of integers with Columnspublic void addColumn()
CellAttribute
addColumn
in interface CellAttribute
public void addRow()
CellAttribute
addRow
in interface CellAttribute
public void insertRow(int row)
CellAttribute
insertRow
in interface CellAttribute
row
- Row where new row is to be inserted at.public java.awt.Dimension getSize()
CellAttribute
getSize
in interface CellAttribute
public void setSize(java.awt.Dimension size)
CellAttribute
setSize
in interface CellAttribute
size
- new Dimension of the table (column size & row size)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |