|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.swing.table.AbstractTableModel
org.bsf.remoteIterator.client.tableModel.DefaultRemoteIteratorTableModel
A default implementation of a RemoteIteratorTableModel. You can look at it (or extend it) to build your own TableModel. A smart move is to add a static method that, when called, removes all the RI that are still active when called.
Field Summary | |
private int |
_defaultBlockSize
|
private int |
_delayBetweenRetrieval
|
private int |
_initialBlockSize
|
private BackgroundLoadingThread |
_loadingThread
|
private java.util.Vector |
_rows
Holds the rows returned by the RI. |
Fields inherited from class javax.swing.table.AbstractTableModel |
listenerList |
Constructor Summary | |
DefaultRemoteIteratorTableModel()
Creates a DefaultRemoteIteratorTableModel with a default estimated size of 1000 rows. |
|
DefaultRemoteIteratorTableModel(int p_estimatedSize)
Creates a DefaultRemoteIteratorTableModel with the given int as the size of the underlying List storing the rows. |
|
DefaultRemoteIteratorTableModel(RemoteIteratorClient p_remoteIteratorClient)
Creates a DefaultRemoteIteratorTableModel with a default estimated size of 1000 rows. |
|
DefaultRemoteIteratorTableModel(RemoteIteratorClient p_remoteIteratorClient,
int p_estimatedSize)
Creates a DefaultRemoteIteratorTableModel with the given estimated size of rows. |
Method Summary | |
void |
addRows(java.util.Iterator p_rowIterator)
|
static void |
cleanUp()
Removes all the remaining RI. |
int |
getColumnCount()
|
int |
getDefaultBlockSize()
|
int |
getDelayBetweenRetrieval()
|
int |
getInitialBlockSize()
|
int |
getRowCount()
|
java.lang.Object |
getValueAt(int p_rowIndex,
int p_columnIndex)
|
boolean |
isLoadingData()
|
void |
releaseResources()
Releases the resources (RemoteIterator is first among them but the Threads used (if any) by the implementing model should be released as well. |
void |
setDefaultBlockSize(int p_defaultBlockSize)
|
void |
setDelayBetweenRetrieval(int p_delayBetweenRetrieval)
Sets the delay between each call to the RI (could be used when multiple models are accessing various RI to prevent locks because some model are calling next() all the time...). |
void |
setInitialBlockSize(int p_initialBlockSize)
|
void |
setRemoteIteratorClient(RemoteIteratorClient p_remoteIteratorClient)
Specifies what RemoteIteratorClient is to be used by the implementing TableModel. |
void |
startLoadingData()
Request this model to start loading the data. |
void |
stopLoadingData()
Request this model to stop loading data. |
Methods inherited from class javax.swing.table.AbstractTableModel |
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getColumnClass, getColumnName, getListeners, getTableModelListeners, isCellEditable, removeTableModelListener, setValueAt |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface javax.swing.table.TableModel |
addTableModelListener, getColumnClass, getColumnName, isCellEditable, removeTableModelListener, setValueAt |
Field Detail |
private int _initialBlockSize
private int _defaultBlockSize
private int _delayBetweenRetrieval
private BackgroundLoadingThread _loadingThread
private java.util.Vector _rows
Constructor Detail |
public DefaultRemoteIteratorTableModel()
DefaultRemoteIteratorTableModel( int p_estimatedSize )
public DefaultRemoteIteratorTableModel(RemoteIteratorClient p_remoteIteratorClient)
p_remoteIteratorClient
- The RemoteIteratorClient to use for data loading.DefaultRemoteIteratorTableModel( int p_estimatedSize )
,
RemoteIteratorClient
public DefaultRemoteIteratorTableModel(int p_estimatedSize)
p_estimatedSize
- The size and the increase number to use for the
underlying List storing the* rows. Should be used to prevent on-going
resize of the List. No check is done on this value which, obviously,
should be greater than 0.public DefaultRemoteIteratorTableModel(RemoteIteratorClient p_remoteIteratorClient, int p_estimatedSize)
p_remoteIteratorClient
- The RemoteIteratorClient to use for data loading.p_estimatedSize
- The size and the increase number to use for the
underlying List storing the* rows. Should be used to prevent on-going
resize of the List. No check is done on this value which, obviously,
should be greater than 0.DefaultRemoteIteratorTableModel( int p_estimatedSize )
,
RemoteIteratorClient
Method Detail |
public int getRowCount()
getRowCount
in interface javax.swing.table.TableModel
public int getColumnCount()
getColumnCount
in interface javax.swing.table.TableModel
public java.lang.Object getValueAt(int p_rowIndex, int p_columnIndex)
getValueAt
in interface javax.swing.table.TableModel
public void setRemoteIteratorClient(RemoteIteratorClient p_remoteIteratorClient)
RemoteIteratorTableModel
setRemoteIteratorClient
in interface RemoteIteratorTableModel
p_remoteIteratorClient
- The RemoteIteratorClient to use.public void startLoadingData()
RemoteIteratorTableModel
startLoadingData
in interface RemoteIteratorTableModel
public void stopLoadingData()
RemoteIteratorTableModel
stopLoadingData
in interface RemoteIteratorTableModel
public boolean isLoadingData()
isLoadingData
in interface RemoteIteratorTableModel
public void releaseResources()
RemoteIteratorTableModel
releaseResources
in interface RemoteIteratorTableModel
public int getDefaultBlockSize()
setDefaultBlockSize(int)
,
setInitialBlockSize(int)
public void setDefaultBlockSize(int p_defaultBlockSize)
getDefaultBlockSize()
public int getInitialBlockSize()
setInitialBlockSize(int)
public void setInitialBlockSize(int p_initialBlockSize)
getInitialBlockSize()
public int getDelayBetweenRetrieval()
setDelayBetweenRetrieval(int)
public void setDelayBetweenRetrieval(int p_delayBetweenRetrieval)
p_delayBetweenRetrieval
- in ms.public void addRows(java.util.Iterator p_rowIterator)
p_rowIterator
- should not be null... Used by the background loading
thread to add rows to the model.public static void cleanUp()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |