sos.reports
Class AbstractReport.AbstractTableElement

java.lang.Object
  |
  +--sos.reports.AbstractReport.AbstractElement
        |
        +--sos.reports.AbstractReport.AbstractTableElement
All Implemented Interfaces:
Element, java.io.Serializable, TableElement
Direct Known Subclasses:
AbstractReport.DefaultTableElement
Enclosing class:
AbstractReport

protected abstract class AbstractReport.AbstractTableElement
extends AbstractReport.AbstractElement
implements TableElement, java.io.Serializable

A partial implementation of TableElement.

Subclasses must implement the following methods: getTierCount getCellAt getTierElement If it supports header and footer rows and columns subclasses should reimplement: getFooterTierCount getHeaderTierCount

Since:
1.0

Field Summary
 
Fields inherited from interface sos.reports.TableElement
COLUMN, ROW
 
Constructor Summary
protected AbstractReport.AbstractTableElement()
           
 
Method Summary
protected  void fireCellsAdded(java.util.List cells)
          Notifies its registered listeners that a number of cells have beed added.
protected  void fireCellsChanged(java.util.Set cells)
          Notifies its registered listeners that a number of cells have beed resized.
protected  void fireCellsRemoved(java.util.Set cells)
          Notifies its registered listeners that a number of cells have beed removed.
 void fireContentChanged(int firstRow, int firstColumn, int lastRow, int lastColumn)
          Notifies its registered listeners that some or all of the content in the specified region has changed.
protected  void fireTableStructureChanged()
          Notifies its registered listeners that this table's structure has drastically changed.
protected  void fireTiersAdded(int tierType, int firstTier, int lastTier)
          Notifies its registered listeners that a range of tiers has been added.
protected  void fireTiersRemoved(int tierType, int firstTier, int lastTier)
          Notifies its registered listeners that a range of tiers has been removed.
 javax.swing.text.AttributeSet getAttributes()
          Returns the set of attributes describing this report element.
 java.util.Set getCells()
          Returns all cells belonging to this table element.
 java.util.Set getCellsEntirelyInRegion(int firstRowIndex, int firstColumnIndex, int lastRowIndex, int lastColumnIndex)
          Returns the cells that fall entirely within the specified region.
 java.util.Set getCellsEntirelyInTier(int tierType, int index)
          Returns the set of cells entirely in the specified row or column.
 java.util.Set getCellsInRegion(int firstRowIndex, int firstColumnIndex, int lastRowIndex, int lastColumnIndex)
          Returns the cells that fall within the specified region.
 java.util.Set getCellsInTier(int tierType, int index)
          Returns the set of cells in the specified row or column.
 CellElement getCellStartingAt(int rowIndex, int columnIndex)
          Returns the cell that starts at the specified location.
 int getFooterTierCount(int tierType)
          Returns the number of footer rows or footer columns in this table element.
 int getHeaderTierCount(int tierType)
          Returns the number of header rows or header columns in this table element.
 java.lang.String getName()
          Returns the name of this report element.
 Element getParentElement()
          Returns this element's parent.
 boolean getValueIsAdjusting()
          Returns true if this table element is currently undergoing a series of changes.
 void setParentElement(Element parent)
          Sets this element's parent.
 void setValueIsAdjusting(boolean isAdjusting)
          Sets whether or not this table element is undergoing a series of changes.
 
Methods inherited from class sos.reports.AbstractReport.AbstractElement
fireObjectChanged, getObject, getPrototypeObject, getReport, getStyleName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface sos.reports.TableElement
getCellAt, getTierAt, getTierCount
 
Methods inherited from interface sos.reports.Element
getObject, getPrototypeObject, getReport
 

Constructor Detail

AbstractReport.AbstractTableElement

protected AbstractReport.AbstractTableElement()
Method Detail

getValueIsAdjusting

public boolean getValueIsAdjusting()
Returns true if this table element is currently undergoing a series of changes.

Returns:
true if this table element is currently undergoing a series of changes
See Also:
setValueIsAdjusting(boolean)

setValueIsAdjusting

public void setValueIsAdjusting(boolean isAdjusting)
Sets whether or not this table element is undergoing a series of changes.

Parameters:
isAdjusting - true if this table element is undergoing a series of changes
See Also:
getValueIsAdjusting()

fireTableStructureChanged

protected void fireTableStructureChanged()
Notifies its registered listeners that this table's structure has drastically changed.


fireTiersAdded

protected void fireTiersAdded(int tierType,
                              int firstTier,
                              int lastTier)
Notifies its registered listeners that a range of tiers has been added.

Parameters:
tierType - either ROW or COLUMN
firstTier - index of first new tier
lastTier - index of last new tier (inclusive)

fireTiersRemoved

protected void fireTiersRemoved(int tierType,
                                int firstTier,
                                int lastTier)
Notifies its registered listeners that a range of tiers has been removed.

Parameters:
tierType - either ROW or COLUMN
firstTier - index of first tier removed
lastTier - index of last tier removed (inclusive)

fireCellsAdded

protected void fireCellsAdded(java.util.List cells)
Notifies its registered listeners that a number of cells have beed added.

Parameters:
cells - new cells

fireCellsRemoved

protected void fireCellsRemoved(java.util.Set cells)
Notifies its registered listeners that a number of cells have beed removed.

Parameters:
cells - cells that were removed

fireCellsChanged

protected void fireCellsChanged(java.util.Set cells)
Notifies its registered listeners that a number of cells have beed resized.

Parameters:
cells - modified cells

fireContentChanged

public void fireContentChanged(int firstRow,
                               int firstColumn,
                               int lastRow,
                               int lastColumn)
Notifies its registered listeners that some or all of the content in the specified region has changed.

Parameters:
firstRow - index of first row of region
firstColumn - index of first column of region
lastRow - index of last row of region (inclusive)
lastColumn - index of last column of region (inclusive)

getAttributes

public javax.swing.text.AttributeSet getAttributes()
Description copied from interface: Element
Returns the set of attributes describing this report element.

Specified by:
getAttributes in interface Element
Overrides:
getAttributes in class AbstractReport.AbstractElement
Returns:
the set of attributes describing this report element (may not be null)

getHeaderTierCount

public int getHeaderTierCount(int tierType)
Description copied from interface: TableElement
Returns the number of header rows or header columns in this table element. If the specified direction is ROW, the number of header rows is given; if COLUMN, the number of header columns is given. The returned count may be zero and must be less than the toal number of tiers.

Specified by:
getHeaderTierCount in interface TableElement
Parameters:
tierType - type of tier (either ROW or COLUMN)
Returns:
the number of header rows (if ROW) or header columns (if COLUMN)
See Also:
TableElement.getFooterTierCount(int), TableElement.getTierCount(int)

getFooterTierCount

public int getFooterTierCount(int tierType)
Description copied from interface: TableElement
Returns the number of footer rows or footer columns in this table element. If the specified type is ROW, the number of footer rows is given; if COLUMN, the number of footer columns is given. The returned count may be zero and must be less than the toal number of tiers.

Specified by:
getFooterTierCount in interface TableElement
Parameters:
tierType - type of tier (either ROW or COLUMN)
Returns:
the number of footer rows (if ROW) or header columns (if COLUMN)
See Also:
TableElement.getHeaderTierCount(int), TableElement.getTierCount(int)

getName

public java.lang.String getName()
Description copied from interface: Element
Returns the name of this report element.

Specified by:
getName in interface Element
Returns:
this element's name

getParentElement

public Element getParentElement()
Description copied from interface: Element
Returns this element's parent.

Specified by:
getParentElement in interface Element
Returns:
the parent element of this report element (may be null)

setParentElement

public void setParentElement(Element parent)
Description copied from interface: Element
Sets this element's parent.

Specified by:
setParentElement in interface Element
Parameters:
parent - parent element
See Also:
Element.getParentElement()

getCellStartingAt

public CellElement getCellStartingAt(int rowIndex,
                                     int columnIndex)
Description copied from interface: TableElement
Returns the cell that starts at the specified location.

Specified by:
getCellStartingAt in interface TableElement
Parameters:
rowIndex - row index of cell to fetch
columnIndex - column index of cell to fetch
Returns:
the cell that starts the specified location or null if there is no cell

getCells

public java.util.Set getCells()
Description copied from interface: TableElement
Returns all cells belonging to this table element.

Specified by:
getCells in interface TableElement
Returns:
an unmodifiable set containing this table's cells

getCellsInRegion

public java.util.Set getCellsInRegion(int firstRowIndex,
                                      int firstColumnIndex,
                                      int lastRowIndex,
                                      int lastColumnIndex)
Description copied from interface: TableElement
Returns the cells that fall within the specified region.

Specified by:
getCellsInRegion in interface TableElement
Parameters:
firstRowIndex - index of the first row of the region
firstColumnIndex - index of the first column of the region
lastRowIndex - index of the last row of the region (inclusive)
lastColumnIndex - index of the last column of the region (inclusive)
Returns:
an unmodifiable set of cells in the specified region
See Also:
TableElement.getCellsEntirelyInRegion(int, int, int, int)

getCellsEntirelyInRegion

public java.util.Set getCellsEntirelyInRegion(int firstRowIndex,
                                              int firstColumnIndex,
                                              int lastRowIndex,
                                              int lastColumnIndex)
Description copied from interface: TableElement
Returns the cells that fall entirely within the specified region.

Specified by:
getCellsEntirelyInRegion in interface TableElement
Parameters:
firstRowIndex - index of the first row of the region
firstColumnIndex - index of the first column of the region
lastRowIndex - index of the last row of the region (inclusive)
lastColumnIndex - index of the last column of the region (inclusive)
Returns:
an unmodifiable set of cells entirely within the specified region
See Also:
TableElement.getCellsInRegion(int, int, int, int)

getCellsEntirelyInTier

public java.util.Set getCellsEntirelyInTier(int tierType,
                                            int index)
Description copied from interface: TableElement
Returns the set of cells entirely in the specified row or column.

Specified by:
getCellsEntirelyInTier in interface TableElement
Parameters:
tierType - type of tier (either ROW or COLUMN)
index - index of row or column to fetch
Returns:
an unmodifiable set of cells entirely in the specified row or column
See Also:
TableElement.getCellsInTier(int, int)

getCellsInTier

public java.util.Set getCellsInTier(int tierType,
                                    int index)
Description copied from interface: TableElement
Returns the set of cells in the specified row or column.

Specified by:
getCellsInTier in interface TableElement
Parameters:
tierType - type of tier (either ROW or COLUMN)
index - index of row or column to fetch
Returns:
an unmodifiable set of cells in the specified row or column
See Also:
TableElement.getCellsEntirelyInTier(int, int)


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