|
||||||||||
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
com.compomics.util.gui.tablemodels.SelfUpdatingTableModel
public abstract class SelfUpdatingTableModel
These table models include a self updating function. Due to instability of the JTable with this model, it comprises a simple row sorter. Use it at your own risks and feel free to debug.
Field Summary |
---|
Fields inherited from class javax.swing.table.DefaultTableModel |
---|
columnIdentifiers, dataVector |
Fields inherited from class javax.swing.table.AbstractTableModel |
---|
listenerList |
Constructor Summary | |
---|---|
SelfUpdatingTableModel()
|
Method Summary | |
---|---|
static void |
addSortListener(JTable jTable,
ProgressDialogX progressDialog)
Convenience method adding a row sorter listener to the given JTable. |
protected abstract void |
catchException(Exception e)
This method is called whenever an exception is encountered in a separate thread. |
protected void |
dataMissingAtRow(int row)
Calling this method indicates that data is missing at the given row. |
int |
getRowNumber(int viewIndex)
Returns the row number of the given view index. |
int |
getViewIndex(int row)
Returns the view index of the given row. |
void |
initiateSorter()
Initiates the sorter to the current order of the table. |
boolean |
isSelfUpdating()
Indicates whether the table is in self update mode. |
protected abstract void |
loadDataForColumn(int column,
WaitingHandler waitingHandler)
Loads the data for a column. |
protected abstract int |
loadDataForRows(ArrayList<Integer> indexes,
boolean interrupted)
Loads the data needed for objects at rows of the given view indexes. |
boolean |
needsUpdate(int column,
String waitingContent)
Indicates whether the given column needs an update, i.e. |
void |
setSelfUpdating(boolean selfUpdating)
Sets whether the table is in self update mode. |
void |
sort(int column,
ProgressDialogX progressDialog)
Sorts the table according to a given column using the built in sorter. |
Methods inherited from class javax.swing.table.DefaultTableModel |
---|
addColumn, addColumn, addColumn, addRow, addRow, convertToVector, convertToVector, getColumnCount, getColumnName, getDataVector, getRowCount, getValueAt, insertRow, insertRow, isCellEditable, moveRow, newDataAvailable, newRowsAdded, removeRow, rowsRemoved, setColumnCount, setColumnIdentifiers, setColumnIdentifiers, setDataVector, setDataVector, setNumRows, setRowCount, setValueAt |
Methods inherited from class javax.swing.table.AbstractTableModel |
---|
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getColumnClass, getListeners, getTableModelListeners, removeTableModelListener |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SelfUpdatingTableModel()
Method Detail |
---|
protected abstract int loadDataForRows(ArrayList<Integer> indexes, boolean interrupted)
indexes
- the view indexes to load as a list. Shall not be empty or
null.interrupted
- a boolean indicating whether the loading shall be
stopped
protected abstract void loadDataForColumn(int column, WaitingHandler waitingHandler)
column
- the column numberwaitingHandler
- a waiting handler used to display progress to the
user or interrupt the processprotected abstract void catchException(Exception e)
e
- the exception encounteredprotected void dataMissingAtRow(int row) throws InterruptedException
row
- the row number (not the view index)
InterruptedException
public boolean isSelfUpdating()
public void setSelfUpdating(boolean selfUpdating)
selfUpdating
- if false the table will not automatically updatepublic boolean needsUpdate(int column, String waitingContent)
column
- index of the column of interestwaitingContent
- the waiting content of this table
public void initiateSorter()
public int getViewIndex(int row)
row
- the row of interest
public int getRowNumber(int viewIndex)
viewIndex
- view index row of interest
public void sort(int column, ProgressDialogX progressDialog)
column
- the column of interestprogressDialog
- a progress dialog used to display the progress and
interrupt the processpublic static void addSortListener(JTable jTable, ProgressDialogX progressDialog)
jTable
- progressDialog
- progress dialog used to display progress or cancel
while sorting. Can be null.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |