|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.swing.table.AbstractTableModel
org.crosswire.common.swing.RowTableModel
public class RowTableModel
The RowTableModel defines the "model" behaviour for a RowTable.
Distribution Licence: JSword is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. The License is available on the internet here, or by writing to: Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA The copyright to this program is held by it's authors. |
Licence
,
Serialized FormField Summary | |
---|---|
private int[] |
indexes
Field indexes provides a look-aside for the sorted view of the table to the row list. |
private int[] |
keys
Field keys provides the primary or composite key of the table. |
private List |
list
Field list contains the objects that can be worked upon |
private RowColumns |
rowColumnModel
Field columnModel provides the definition of the structure of the table |
private static long |
serialVersionUID
Serialization ID |
private int |
sortColumn
Field sortColumn indicates the column that was last sorted upon. |
Fields inherited from class javax.swing.table.AbstractTableModel |
---|
listenerList |
Constructor Summary | |
---|---|
RowTableModel(List newList,
RowColumns aRowColumnModel)
Builds a RowTable model for the provided (non-null) row list, using the provided row column definition. |
Method Summary | |
---|---|
void |
addRow(Object obj)
Method addRow adds a row to the table. |
private void |
allocate()
Method allocate |
void |
clear()
|
int |
compare(int i,
int j,
int column)
Method compare |
private int |
compareKeys(int i,
int j,
int column)
Method compareKeys |
private Object |
getCellValue(int rowIndex,
int columnIndex)
Method getCellValue Translates from a row index to a row object and asks it for the appropriate cell value |
Class |
getColumnClass(int columnIndex)
Method getColumnClass returns the class of the column |
int |
getColumnCount()
Method getColumnCount returns the number of columns in the table |
String |
getColumnName(int columnIndex)
Method getColumnName returns the header name for the column |
String |
getHeaderToolTip(int columnIndex)
Method getHeaderToolTip returns the tooltip for the header of the column |
Object |
getRow(int rowIndex)
Method getRow retrieves a row from the table |
int |
getRow(Object obj)
Method getRow finds the visible row index for a given row |
int |
getRowCount()
Method getRowCount returns the number of rows in the list. |
Object |
getValueAt(int row,
int column)
Method getValueAt returns the contents of a cell. |
void |
removeRow(Object obj)
Method removeRow removes a row from the model and causes the display to update itself appropriately |
void |
reset()
|
void |
sort(int modelIndex)
Method sort |
private void |
swap(int i,
int j)
Method swap |
void |
updateRow(Object obj)
Method updateRow causes the display to update itself appropriately. |
Methods inherited from class javax.swing.table.AbstractTableModel |
---|
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, isCellEditable, removeTableModelListener, setValueAt |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final long serialVersionUID
private List list
private RowColumns rowColumnModel
private int[] indexes
private int[] keys
private int sortColumn
Constructor Detail |
---|
public RowTableModel(List newList, RowColumns aRowColumnModel)
newList
- ListMethod Detail |
---|
public int getRowCount()
TableModel.getRowCount()
public int getColumnCount()
TableModel.getColumnCount()
public Object getValueAt(int row, int column)
row
- intcolumn
- int
TableModel.getValueAt(int, int)
private Object getCellValue(int rowIndex, int columnIndex)
rowIndex
- intcolumnIndex
- int
public Class getColumnClass(int columnIndex)
getColumnClass
in interface TableModel
getColumnClass
in class AbstractTableModel
columnIndex
- int
TableModel.getColumnClass(int)
public String getHeaderToolTip(int columnIndex)
columnIndex
- int
public String getColumnName(int columnIndex)
getColumnName
in interface TableModel
getColumnName
in class AbstractTableModel
columnIndex
- int
TableModel.getColumnName(int)
public void addRow(Object obj)
obj
- the row to addpublic Object getRow(int rowIndex)
rowIndex
- int
public int getRow(Object obj)
obj
- the row
public void removeRow(Object obj)
obj
- the row to removepublic void updateRow(Object obj)
obj
- the rowpublic void reset()
public void clear()
public void sort(int modelIndex)
modelIndex
- intprivate void swap(int i, int j)
i
- intj
- intprivate int compareKeys(int i, int j, int column)
i
- intj
- intcolumn
- int
public int compare(int i, int j, int column)
i
- intj
- intcolumn
- int
private void allocate()
|
Copyright ? 2003-2004 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |