sos.reports
Class TableFormats

java.lang.Object
  |
  +--sos.reports.TableFormats

public class TableFormats
extends java.lang.Object

A factory class for creating various table formats.

Since:
1.0
See Also:
TableFormat, DefaultTableFormat

Field Summary
static TableFormat EMPTY_TABLE_FORMAT
          An empty table format.
 
Method Summary
static TableFormat createColumnOrientedTableFormat(javax.swing.text.AttributeSet[] headerAttributes, javax.swing.text.AttributeSet[] bodyAttributes, javax.swing.text.AttributeSet[] footerAttributes)
          Creates a table format with the specified attributes for header columns, body columns, and footer columns.
static TableFormat createCompositeTableFormat(TableFormat tableFormat1, TableFormat tableFormat2)
          Creates a table format that is the composition of two table tyles, giving precendence to the first one.
static TableFormat createRowOrientedTableFormat(javax.swing.text.AttributeSet[] headerAttributes, javax.swing.text.AttributeSet[] bodyAttributes, javax.swing.text.AttributeSet[] footerAttributes)
          Creates a table format with the specified attributes for header rows, body rows, and footer rows.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EMPTY_TABLE_FORMAT

public static final TableFormat EMPTY_TABLE_FORMAT
An empty table format.

Method Detail

createColumnOrientedTableFormat

public static TableFormat createColumnOrientedTableFormat(javax.swing.text.AttributeSet[] headerAttributes,
                                                          javax.swing.text.AttributeSet[] bodyAttributes,
                                                          javax.swing.text.AttributeSet[] footerAttributes)
Creates a table format with the specified attributes for header columns, body columns, and footer columns.

The table format assigns the first header column headerAttributes[0], the second header column headerAttributes[1], etc. If there are more header columns than elements in headerAttributes, the table format cycles around and repeats with headerAttributes[0]. If headerAttributes is null, all header columns get empty attribute sets. Similarly, a null element of headerAttributes is treated as an empty attribute set.

The same procedure applies to the body and footer columns.

Parameters:
headerAttributes - array of attribute sets to apply to header columns in a cyclic fashion
bodyAttributes - array of attribute sets to apply to body columns in a cyclic fashion
footerAttributes - array of attribute sets to apply to footer columns in a cyclic fashion
Returns:
a table format that assigns columns the appropriate attribute set
See Also:
createRowOrientedTableFormat(javax.swing.text.AttributeSet[], javax.swing.text.AttributeSet[], javax.swing.text.AttributeSet[])

createCompositeTableFormat

public static TableFormat createCompositeTableFormat(TableFormat tableFormat1,
                                                     TableFormat tableFormat2)
Creates a table format that is the composition of two table tyles, giving precendence to the first one. An attribute is defined in the returned table format if it is defined in either tableFormat1 or tableFormat2. An attribute's value is the value defined in tableFormat1, if it is defined; otherwise, it is the value defined in tableFormat2.

Parameters:
tableFormat1 - the first table format (higher precedence)
tableFormat2 - the second table format
Returns:
a table format that delegates first to tableFormat1 and second to tableFormat2
Throws:
java.lang.NullPointerException - if tableFormat1 or tableFormat2 is null

createRowOrientedTableFormat

public static TableFormat createRowOrientedTableFormat(javax.swing.text.AttributeSet[] headerAttributes,
                                                       javax.swing.text.AttributeSet[] bodyAttributes,
                                                       javax.swing.text.AttributeSet[] footerAttributes)
Creates a table format with the specified attributes for header rows, body rows, and footer rows.

The table format assigns the first header row headerAttributes[0], the second header row headerAttributes[1], etc. If there are more header rows than elements in headerAttributes, the table format cycles around and repeats with headerAttributes[0]. If headerAttributes is null, all header rows get empty attribute sets. Similarly, a null element of headerAttributes is treated as an empty attribute set.

The same procedure applies to the body and footer rows.

Parameters:
headerAttributes - array of attribute sets to apply to header rows in a cyclic fashion
bodyAttributes - array of attribute sets to apply to body rows in a cyclic fashion
footerAttributes - array of attribute sets to apply to footer rows in a cyclic fashion
Returns:
a table format that assigns rows the appropriate attribute set
See Also:
createColumnOrientedTableFormat(javax.swing.text.AttributeSet[], javax.swing.text.AttributeSet[], javax.swing.text.AttributeSet[])


Copyright 2003, 2004 Side of Software (SOS). All rights reserved.