ru.goodidea.df.dictionary.datasource
Class DistributedTableModel

java.lang.Object
  extended by ru.goodidea.df.dictionary.datasource.DistributedTableModel
All Implemented Interfaces:
javax.swing.table.TableModel

public class DistributedTableModel
extends java.lang.Object
implements javax.swing.table.TableModel


Constructor Summary
DistributedTableModel(IDistributedTableDataSource tableDataSource)
          Constructor for CachingTableModel.
DistributedTableModel(IDistributedTableDataSource tableDataSource, int chunkSize, int maximumCacheSize)
          Constructor for CachingTableModel.
 
Method Summary
 void addTableModelListener(javax.swing.event.TableModelListener l)
           
 void fireTableDataChanged()
           
 void fireTableRowsDeleted(int from, int to)
           
 void fireTableRowsInserted(int from, int to)
           
 void fireTableRowsUpdated(int from, int to)
           
 java.lang.Class getColumnClass(int columnIndex)
           
 int getColumnCount()
           
 java.lang.String getColumnName(int columnIndex)
           
 EntityModel getEntity()
           
 Entity getEntity(int row)
           
 int getNearest(java.lang.Object search, int column)
           
 java.awt.Container getPanel(int row, ActionType mode, PanelBuilder pb, ComponentBuildable cb)
           
 int getRowCount()
           
 int[] getSelectedColumns()
          Returns an array corresponding to the column indexes that are currently selected.
 int[] getSelectedRows()
          Returns an array corresponding to the row indexes that are currently selected.
 javax.swing.JTable getTable()
           
 java.lang.Object getValueAt(int rowIndex, int columnIndex)
           
 int indexOf(Key key)
           
 boolean isCellEditable(int rowIndex, int columnIndex)
           
 boolean isExpectedContext(java.lang.String entityName)
           
 boolean isWasRemoteInsert()
           
 void removeTableModelListener(javax.swing.event.TableModelListener l)
           
 void reread()
           
 void reread(javax.swing.event.TableModelEvent event)
           
 void resetFilter()
           
 int scanKey(Key key)
           
 void setFilter(java.lang.String filter)
           
 void setSelectedRowsAndColumns(int[] selectedRows, int[] selectedColumns)
          Sets the rows and columns that are selected by calling setSelectedRowsAndColumns on the DistributedTableDataSource.
 void setTable(javax.swing.JTable table)
           
 void setValueAt(java.lang.Object aValue, int rowIndex, int columnIndex)
           
 void sortByColumn(int column, boolean ascent)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DistributedTableModel

public DistributedTableModel(IDistributedTableDataSource tableDataSource)
                      throws java.lang.Exception
Constructor for CachingTableModel.

Parameters:
tableDataSource - The object from which data should be retrieved.
Throws:
java.lang.Exception

DistributedTableModel

public DistributedTableModel(IDistributedTableDataSource tableDataSource,
                             int chunkSize,
                             int maximumCacheSize)
                      throws java.lang.Exception
Constructor for CachingTableModel.

Parameters:
tableDataSource - The object from which data should be retrieved.
chunkSize - The number of rows that should be retrieved from the DistributedTableDataSource at one time
maximumCacheSize - The number of rows that the DistributedTableModel should hold before overwriting data that's not required.
Throws:
java.lang.Exception
Method Detail

getPanel

public java.awt.Container getPanel(int row,
                                   ActionType mode,
                                   PanelBuilder pb,
                                   ComponentBuildable cb)
See Also:
TableModel.getRowCount()

getRowCount

public int getRowCount()
Specified by:
getRowCount in interface javax.swing.table.TableModel

getColumnCount

public int getColumnCount()
Specified by:
getColumnCount in interface javax.swing.table.TableModel
See Also:
TableModel.getColumnCount()

getColumnName

public java.lang.String getColumnName(int columnIndex)
Specified by:
getColumnName in interface javax.swing.table.TableModel
See Also:
TableModel.getColumnName(int)

getColumnClass

public java.lang.Class getColumnClass(int columnIndex)
Specified by:
getColumnClass in interface javax.swing.table.TableModel
See Also:
TableModel.getColumnClass(int)

getValueAt

public java.lang.Object getValueAt(int rowIndex,
                                   int columnIndex)
Specified by:
getValueAt in interface javax.swing.table.TableModel
See Also:
TableModel.getValueAt(int, int)

isCellEditable

public boolean isCellEditable(int rowIndex,
                              int columnIndex)
Specified by:
isCellEditable in interface javax.swing.table.TableModel
See Also:
TableModel.isCellEditable(int, int)

setValueAt

public void setValueAt(java.lang.Object aValue,
                       int rowIndex,
                       int columnIndex)
Specified by:
setValueAt in interface javax.swing.table.TableModel
See Also:
TableModel.setValueAt(Object, int, int)

addTableModelListener

public void addTableModelListener(javax.swing.event.TableModelListener l)
Specified by:
addTableModelListener in interface javax.swing.table.TableModel
See Also:
TableModel.addTableModelListener(TableModelListener)

getEntity

public Entity getEntity(int row)

removeTableModelListener

public void removeTableModelListener(javax.swing.event.TableModelListener l)
Specified by:
removeTableModelListener in interface javax.swing.table.TableModel
See Also:
TableModel.removeTableModelListener(TableModelListener)

fireTableRowsInserted

public void fireTableRowsInserted(int from,
                                  int to)

fireTableRowsDeleted

public void fireTableRowsDeleted(int from,
                                 int to)

fireTableRowsUpdated

public void fireTableRowsUpdated(int from,
                                 int to)

fireTableDataChanged

public void fireTableDataChanged()

setSelectedRowsAndColumns

public void setSelectedRowsAndColumns(int[] selectedRows,
                                      int[] selectedColumns)
                               throws java.lang.Exception
Sets the rows and columns that are selected by calling setSelectedRowsAndColumns on the DistributedTableDataSource.

Parameters:
selectedRows - An array of the selected row indexes.
selectedColumns - An array of the selected column indexes.
Throws:
java.lang.Exception

getSelectedRows

public int[] getSelectedRows()
                      throws java.lang.Exception
Returns an array corresponding to the row indexes that are currently selected.

Throws:
java.lang.Exception

indexOf

public int indexOf(Key key)

scanKey

public int scanKey(Key key)

getSelectedColumns

public int[] getSelectedColumns()
                         throws java.lang.Exception
Returns an array corresponding to the column indexes that are currently selected.

Throws:
java.lang.Exception

getEntity

public EntityModel getEntity()

reread

public void reread()

reread

public void reread(javax.swing.event.TableModelEvent event)

isExpectedContext

public boolean isExpectedContext(java.lang.String entityName)

getTable

public javax.swing.JTable getTable()

setTable

public void setTable(javax.swing.JTable table)

setFilter

public void setFilter(java.lang.String filter)

resetFilter

public void resetFilter()

getNearest

public int getNearest(java.lang.Object search,
                      int column)

sortByColumn

public void sortByColumn(int column,
                         boolean ascent)

isWasRemoteInsert

public boolean isWasRemoteInsert()


Copyright © 2009. All Rights Reserved.