|
ReportCat 1.1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectli.netcat.print.table.TablePrint
Implementation of a table with the following features:
Field Summary | |
static int |
CONSTRAINT_MIN_CELLS
Specify this flag as a column constraint so that the column is at least as wide as the maximum preferred width of the cells. |
static int |
CONSTRAINT_MIN_FOOTER
Specify this flag as a column constraint so that the column is at least as wide as the preferred width of the footer. |
static int |
CONSTRAINT_MIN_HEADER
Specify this flag as a column constraint so that the column is at least as wide as the preferred width of the header. |
Constructor Summary | |
TablePrint(TableDataModel model)
Constructs and initializes a new TablePrint with the given data model. |
Method Summary | |
DefaultTableCellDrawer |
createDefaultCellDrawer(int horizontalAlignment)
Factory method, that creates a new DefaultTableCellDrawer for the data cells. |
DefaultTableCellDrawer |
createDefaultFooterDrawer(int horizontalAlignment)
Factory method, that creates a new DefaultTableCellDrawer for the footer cells. |
DefaultTableCellDrawer |
createDefaultHeaderDrawer(int horizontalAlignment)
Factory method, that creates a new DefaultTableCellDrawer for the header. |
TableCellDrawer |
getCellDrawer(java.lang.Object type)
Returns the data cell drawer for a given type. |
boolean |
getClipCells()
Specifies, whether the table clips the cells on painting. |
float |
getColumnWeight(int columnIndex)
Returns the weight of a column. |
float[] |
getColumnWeights()
Returns a copy of the current column weights. |
ColumnWidthCalculator |
getColumnWidthCalculator()
Returns the current column width calculator. |
int |
getColumnWidthConstraint(int columnIndex)
Returns the column width costraint for a given column. |
ColumnWidthDistributor |
getColumnWidthDistributor()
Returns the current column width distribution strategy. |
boolean |
getFitWidth()
Specifies, whether the table should consume the whole available width. |
TableCellDrawer |
getFooterDrawer(java.lang.Object type)
Returns the footer cell drawer for a given type. |
TableCellDrawer |
getHeaderDrawer(java.lang.Object type)
Returns the header cell drawer for a given type. |
TableLook |
getLook()
Returns the current look of the table. |
int |
getMinimumColumnWidth(int columnIndex)
Returns the minimum column width for a given column. |
int |
getMinNrOfRows()
Specifies the minimum number of rows that must be present before or after a break. |
TableDataModel |
getModel()
Returns the data model of the table. |
java.awt.Dimension |
getPreferredSize(java.awt.Graphics g)
Returns the preferred size of the Print . |
PrintIterator |
getPrintIterator()
Factory method, that produces a PrintIerator . |
RowHeightCalculator |
getRowHeightCalculator()
Returns the current row height calculator. |
void |
setCellDrawer(java.lang.Object type,
TableCellDrawer drawer)
Sets a custom data cell drawer for a specific type. |
void |
setClipCells(boolean clipCells)
Specifies, whether the table clips the cells on painting. |
void |
setColumnWeight(int columnIndex,
float weight)
Sets the weight of a specific column. |
void |
setColumnWidthCalculator(ColumnWidthCalculator calculator)
Sets a new strategy that calculates the column widths. |
void |
setColumnWidthConstraint(int columnIndex,
int constraint)
Sets the column width constraint for a given column of the table. |
void |
setColumnWidthDistributor(ColumnWidthDistributor distributor)
Sets a new strategy that distributes the available width of the table among the columns. |
void |
setDefaultCellDrawer(TableCellDrawer drawer)
Sets the default data cell drawer that is used, when no custom drawer is found. |
void |
setDefaultFooterDrawer(TableCellDrawer drawer)
Sets the default footer cell drawer that is used, when no custom drawer is found. |
void |
setDefaultHeaderDrawer(TableCellDrawer drawer)
Sets the default header cell drawer that is used, when no custom drawer is found. |
static void |
setDefaultLook(TableLook look)
Sets the default table look. |
void |
setFitWidth(boolean fitWidth)
Specifies, whether the table should consume the whole available width. |
void |
setFooterDrawer(java.lang.Object type,
TableCellDrawer drawer)
Sets a custom footer cell drawer for a specific type. |
void |
setHeaderDrawer(java.lang.Object type,
TableCellDrawer drawer)
Sets a custom header cell drawer for a specific type. |
void |
setLook(TableLook look)
Sets a custom look for the table. |
void |
setMinimumColumnWidth(int columnIndex,
int minimumWidth)
Sets the minimum column width in pixel for a given column. |
void |
setMinNrOfRows(int nr)
Sets the minimum number of rows that must be present before or after a break. |
void |
setModel(TableDataModel model)
Sets the data model of the table. |
void |
setRowHeightCalculator(RowHeightCalculator calculator)
Sets a new strategy that calculates the row heights. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int CONSTRAINT_MIN_HEADER
setColumnWidthConstraint(int, int)
,
Constant Field Valuespublic static final int CONSTRAINT_MIN_CELLS
setColumnWidthConstraint(int, int)
,
Constant Field Valuespublic static final int CONSTRAINT_MIN_FOOTER
setColumnWidthConstraint(int, int)
,
Constant Field ValuesConstructor Detail |
public TablePrint(TableDataModel model)
TablePrint
with the given data model.
model
- The data model, not null
.Method Detail |
public static void setDefaultLook(TableLook look)
look
- A custom table look, not null
.public TableDataModel getModel()
public void setModel(TableDataModel model)
model
- The data model of the table, not null
.public TableLook getLook()
public void setLook(TableLook look)
look
- A custom look, not null.public TableCellDrawer getCellDrawer(java.lang.Object type)
type
- The type of the data cell.
public void setCellDrawer(java.lang.Object type, TableCellDrawer drawer)
type
- The type of the data cell.drawer
- A custom data cell drawer.public void setDefaultCellDrawer(TableCellDrawer drawer)
drawer
- The new default data cell drawer, not null
.public TableCellDrawer getHeaderDrawer(java.lang.Object type)
type
- The type of the header cell.
public void setHeaderDrawer(java.lang.Object type, TableCellDrawer drawer)
type
- The type of the header cell.drawer
- A custom header cell drawer.public void setDefaultHeaderDrawer(TableCellDrawer drawer)
drawer
- The new default header cell drawer, not null
.public TableCellDrawer getFooterDrawer(java.lang.Object type)
type
- The type of the footer cell.
public void setFooterDrawer(java.lang.Object type, TableCellDrawer drawer)
type
- The type of the footer cell.drawer
- A custom footer cell drawer.public void setDefaultFooterDrawer(TableCellDrawer drawer)
drawer
- The new default footer cell drawer, not null
.public float getColumnWeight(int columnIndex)
columnIndex
- The index of the column.public float[] getColumnWeights()
public void setColumnWeight(int columnIndex, float weight)
columnIndex
- The index of the column.weight
- The weight of the column, >= 0.0f.public int getMinimumColumnWidth(int columnIndex)
columnIndex
- The index of the column.
public void setMinimumColumnWidth(int columnIndex, int minimumWidth)
columnIndex
- The index of the column.minimumWidth
- The minimum width of the column.setColumnWidthConstraint(int, int)
public int getColumnWidthConstraint(int columnIndex)
public void setColumnWidthConstraint(int columnIndex, int constraint)
columnIndex
- The index of the column.constraint
- A combination of the flags CONSTRAINT_*.public boolean getFitWidth()
false
.public void setFitWidth(boolean fitWidth)
fitWidth
- Specify true
, if the table should consume the whole available width. The default is false
.public boolean getClipCells()
true
, if the table clips the cells on painting. The default is true
.public void setClipCells(boolean clipCells)
clipCells
- Specify true
, if the table shoud clip the cells on painting. The default is true
.public int getMinNrOfRows()
public void setMinNrOfRows(int nr)
nr
- The minimum number of rows before or after a break. This value must be >= 1.public DefaultTableCellDrawer createDefaultHeaderDrawer(int horizontalAlignment)
DefaultTableCellDrawer
for the header.
horizontalAlignment
- One of LEFT
, CENTER
or RIGHT
.
DefaultTableCellDrawer
.public DefaultTableCellDrawer createDefaultCellDrawer(int horizontalAlignment)
DefaultTableCellDrawer
for the data cells.
horizontalAlignment
- One of LEFT
, CENTER
or RIGHT
.
DefaultTableCellDrawer
.public DefaultTableCellDrawer createDefaultFooterDrawer(int horizontalAlignment)
DefaultTableCellDrawer
for the footer cells.
horizontalAlignment
- One of LEFT
, CENTER
or RIGHT
.
DefaultTableCellDrawer
.public ColumnWidthCalculator getColumnWidthCalculator()
null
.public void setColumnWidthCalculator(ColumnWidthCalculator calculator)
calculator
- An implementation of the ColumnWidthCalculator
, not null
.public ColumnWidthDistributor getColumnWidthDistributor()
null
.public void setColumnWidthDistributor(ColumnWidthDistributor distributor)
distributor
- An implementation of the ColumnWidthDistributor
, not null
.public RowHeightCalculator getRowHeightCalculator()
null
.public void setRowHeightCalculator(RowHeightCalculator calculator)
calculator
- An implementation of the RowHeightCalculator
, not null
.public java.awt.Dimension getPreferredSize(java.awt.Graphics g)
Print
Print
.
getPreferredSize
in interface Print
g
- The relevant Graphics
object. It can be used to calculate the widths of strings.
Print
.public PrintIterator getPrintIterator()
Print
PrintIerator
. The PrintIterator
is used like an enumeration to generate all Print
s.
getPrintIterator
in interface Print
PrintIterator
that is able to iterate over the Print
.
|
ReportCat 1.1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |