DESY ACOP Beans Home

com.cosylab.gui.components.table
Interface TableRowModel

All Known Implementing Classes:
TableRowModelSupport

public interface TableRowModel

TableRowModel is table model which natural organization of data is grouped by rows. This model can not be used directly in JTable, it must be used in collaboration with TableModelRows or similar implementation of TableModel.

Since:
May 3, 2004.
Version:
$Id: TableRowModel.java,v 1.4 2008-04-22 12:28:40 jbobnar Exp $
Author:
Igor Kriznar

Method Summary
 void addTableRowModelListener(TableRowModelListener l)
          Add listener, which receives notification of changes in the model.
 void fireRowUpdate(TableRow row, int valueIndex)
          This method is called from table row, when wants to notify its parent model about value change.
 int getColumnCount()
          Number of columns inside this model.
 java.lang.String getColumnName(int index)
          Returns name of column.
 TableRow getRowAt(int rowIndex)
          Returns a row object at row index.
 int getRowCount()
          Returns number of rows contained in this model.
 int getRowIndex(TableRow row)
          Returns index of a row.
 void removeTableRowModelListener(TableRowModelListener l)
          Removes listener.
 void sortRows(int column, boolean descending)
          Sort rows in ascending or descengin order according to the natural order of cells in specified column.
 

Method Detail

getColumnCount

int getColumnCount()
Number of columns inside this model.

Returns:
number of columns inside this model

getRowCount

int getRowCount()
Returns number of rows contained in this model.

Returns:
number of rows

getRowAt

TableRow getRowAt(int rowIndex)
Returns a row object at row index.

Parameters:
rowIndex - the row index
Returns:
a row at the row index

getRowIndex

int getRowIndex(TableRow row)
Returns index of a row.

Parameters:
row - a row form this model
Returns:
the index ot the row

addTableRowModelListener

void addTableRowModelListener(TableRowModelListener l)
Add listener, which receives notification of changes in the model.

Parameters:
l - a TableRowModelListener listener

removeTableRowModelListener

void removeTableRowModelListener(TableRowModelListener l)
Removes listener.

Parameters:
l - a TableRowModelListener listener

getColumnName

java.lang.String getColumnName(int index)
Returns name of column.

Parameters:
index - the index of the colummn
Returns:
the name of the column under provided index
See Also:
TableModel.getColumnName(int)

fireRowUpdate

void fireRowUpdate(TableRow row,
                   int valueIndex)
This method is called from table row, when wants to notify its parent model about value change.

Parameters:
row - the row which value has changes
valueIndex - the index of the value, if -1 all values has been changed

sortRows

void sortRows(int column,
              boolean descending)
Sort rows in ascending or descengin order according to the natural order of cells in specified column. Natural order is determined by cells, which implements Comparable.

Parameters:
column - the column index, according to which rows are sorted
descending - sorted rows are ordered ascending if false, or descending if true.


Copyright © 2010. All Rights Reserved.