|
The Meta-Environment API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.swing.table.AbstractTableModel
javax.swing.table.DefaultTableModel
nl.cwi.sen1.visplugin.table.model.SortableTableModel
public class SortableTableModel
Table model supporting column sortings. This model is able to work directly with RTuples and its data should be set using the setRTupleData() function. The original RElems can then be retrieved for every table row using the getRElemForRow() function.
Field Summary | |
---|---|
private nl.cwi.sen1.relationstores.types.RTuple |
m_data
|
private int[] |
m_indexes
|
private nl.cwi.sen1.relationstores.types.RType |
m_rTupleRType
|
private nl.cwi.sen1.relationstores.types.IdCon |
m_rTupleVariable
|
private TableSorter |
m_sorter
|
private static long |
serialVersionUID
|
Fields inherited from class javax.swing.table.DefaultTableModel |
---|
columnIdentifiers, dataVector |
Fields inherited from class javax.swing.table.AbstractTableModel |
---|
listenerList |
Constructor Summary | |
---|---|
SortableTableModel()
|
Method Summary | |
---|---|
private static java.lang.String[] |
convertColumnTypesToStrings(nl.cwi.sen1.relationstores.types.RTypeColumnTypes columnTypes)
Converts RTypeColumnTypes to an array of Strings |
java.lang.Class |
getColumnClass(int column)
Return the type which is displayed in the given column. |
int[] |
getIndexes()
Returns the index mapping on which the current sort is based. |
nl.cwi.sen1.relationstores.types.RElem |
getRElemForRow(int rowIndex)
Returns an RElem containing the data for a row. |
nl.cwi.sen1.relationstores.types.RType |
getRTupleRType()
Returns the RType of the set RTuple data. |
nl.cwi.sen1.relationstores.types.IdCon |
getRTupleVariable()
Returns the variable of the set RTuple data. |
java.lang.Object |
getValueAt(int row,
int col)
Retrieve the value for a given postion (row,col). |
private static java.lang.Object |
getValueFromRElem(nl.cwi.sen1.relationstores.types.RElem element)
Converts RElem value to an object. |
boolean |
isCellEditable(int rowIndex,
int columnIndex)
Returns |
void |
setRTupleData(nl.cwi.sen1.relationstores.types.RTuple data)
Sets the data of the table model to the data contained in the RTuple. |
void |
setValueAt(java.lang.Object value,
int row,
int col)
Set the value for a given postion (row,col). |
void |
sortByColumn(int column,
boolean isAscent)
Retrieve the value for a given postion (row,col). |
Methods inherited from class javax.swing.table.DefaultTableModel |
---|
addColumn, addColumn, addColumn, addRow, addRow, convertToVector, convertToVector, getColumnCount, getColumnName, getDataVector, getRowCount, insertRow, insertRow, moveRow, newDataAvailable, newRowsAdded, removeRow, rowsRemoved, setColumnCount, setColumnIdentifiers, setColumnIdentifiers, setDataVector, setDataVector, setNumRows, setRowCount |
Methods inherited from class javax.swing.table.AbstractTableModel |
---|
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, removeTableModelListener |
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 int[] m_indexes
private TableSorter m_sorter
private nl.cwi.sen1.relationstores.types.RTuple m_data
private nl.cwi.sen1.relationstores.types.IdCon m_rTupleVariable
private nl.cwi.sen1.relationstores.types.RType m_rTupleRType
Constructor Detail |
---|
public SortableTableModel()
Method Detail |
---|
public java.lang.Object getValueAt(int row, int col)
getValueAt
in interface javax.swing.table.TableModel
getValueAt
in class javax.swing.table.DefaultTableModel
row
- The (row,col) combinationcol
- The (row,col) combinationpublic void setValueAt(java.lang.Object value, int row, int col)
setValueAt
in interface javax.swing.table.TableModel
setValueAt
in class javax.swing.table.DefaultTableModel
value
- The value to set at the (row,col) combinationrow
- The (row,col) combinationcol
- The (row,col) combinationpublic void sortByColumn(int column, boolean isAscent)
column
- the column to base the sort onisAscent
- ascending (true) or or decending (false) orderpublic int[] getIndexes()
public java.lang.Class getColumnClass(int column)
getColumnClass
in interface javax.swing.table.TableModel
getColumnClass
in class javax.swing.table.AbstractTableModel
column
- The column to retrieve the type frompublic void setRTupleData(nl.cwi.sen1.relationstores.types.RTuple data)
data
- The RTuple data to put in the table.public nl.cwi.sen1.relationstores.types.IdCon getRTupleVariable()
public nl.cwi.sen1.relationstores.types.RType getRTupleRType()
public nl.cwi.sen1.relationstores.types.RElem getRElemForRow(int rowIndex)
rowIndex
- Index of the row. If sorting is enabled, the index will
automatically adjusted.
private static java.lang.Object getValueFromRElem(nl.cwi.sen1.relationstores.types.RElem element) throws java.lang.Exception
element
-
java.lang.Exception
- Throws and unknown RElem exception when the element is of
an unknown type.private static java.lang.String[] convertColumnTypesToStrings(nl.cwi.sen1.relationstores.types.RTypeColumnTypes columnTypes)
columnTypes
-
public boolean isCellEditable(int rowIndex, int columnIndex)
isCellEditable
in interface javax.swing.table.TableModel
isCellEditable
in class javax.swing.table.DefaultTableModel
rowIndex
- Row index of the cell, ignored.columnIndex
- Column index of the cell, ignored.
|
The Meta-Environment API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |