|
JIDE 3.5.15 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.swing.table.AbstractTableModel com.jidesoft.grid.DefaultColumnTableModelWrapper com.jidesoft.grid.CalculatedTableModel
public class CalculatedTableModel
CalculatedTableModel allows user to create a new table model based on an existing table model using column
based conversion. For example, you can only expose some columns in the existing table model to the new table model by
using addColumn(CalculatedColumn)
with SingleColumn
.
Field Summary |
---|
Fields inherited from class com.jidesoft.grid.DefaultColumnTableModelWrapper |
---|
_indexes, _model |
Fields inherited from class javax.swing.table.AbstractTableModel |
---|
listenerList |
Fields inherited from interface com.jidesoft.grid.MultiTableModel |
---|
FOOTER_COLUMN, HEADER_COLUMN, REGULAR_COLUMN |
Constructor Summary | |
---|---|
CalculatedTableModel(TableModel model)
The constructor. |
Method Summary | |
---|---|
void |
addAllColumns()
Adds all columns from the original table model. |
void |
addColumn(CalculatedColumn column)
Adds a new CalculatedColumn. |
void |
addColumns(Collection<CalculatedColumn> columns)
Adds a set of new CalculatedColumns. |
protected Row |
createWrappedRow(ExpandableRow originalRow)
Creates wrapped row in the wrapped ITreeTableModel. |
int |
getActualColumnAt(int column)
Gets the actual column. |
CalculatedColumn |
getCalculatedColumnAt(int columnIndex)
Gets the CalculatedColumn instance at the column. |
Class<?> |
getCellClassAt(int row,
int column)
Gets the cell class of the underlying table model. |
Class<?> |
getColumnClass(int column)
|
int |
getColumnCount()
|
Object |
getColumnIdentifier(int column)
Returns the identifier of the column in the model. |
String |
getColumnName(int column)
|
ConverterContext |
getConverterContextAt(int row,
int column)
Gets the converter context of the underlying table model. |
protected int[] |
getDependingColumnsOf(int column)
Gets the depending columns of the column. |
EditorContext |
getEditorContextAt(int row,
int column)
Gets the editor context of the underlying table model. |
int[] |
getIndexes()
Gets the indexes that maps from the visual column index to the actual column index. |
Object |
getValueAt(int row,
int column)
|
int |
getVisualColumnAt(int actualColumn)
Gets the visual column. |
boolean |
isCellEditable(int row,
int column)
|
void |
removeColumn(CalculatedColumn column)
Removes an existing CalculatedColumn. |
void |
removeColumns(Collection<CalculatedColumn> columns)
Removes a set of existing CalculatedColumns. |
void |
setIndexes(int[] indexes)
Sets the indexes of the column mapping. |
void |
setValueAt(Object value,
int row,
int column)
|
void |
tableCellsUpdated(int columnIndex,
int firstRow,
int lastRow)
Called each time the cells in column in the range [firstRow , lastRow ] are
updated. |
protected void |
tableDataChanged(CompoundTableModelEvent event)
|
Methods inherited from class com.jidesoft.grid.DefaultColumnTableModelWrapper |
---|
createCompoundTableModelEvent, fireTableCellsUpdated, fireTableChanged, getActualModel, getCellSpanAt, getCellStyleAt, getColumnType, getRoot, getRowAt, getRowCount, getRowIndex, getTableIndex, isCellSpanOn, isCellStyleOn, reallocateIndexes, tableChanged, tableDataChanged, tableRowsDeleted, tableRowsInserted, tableRowsUpdated, tableStructureChanged |
Methods inherited from class javax.swing.table.AbstractTableModel |
---|
addTableModelListener, findColumn, fireTableCellUpdated, 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 |
Methods inherited from interface javax.swing.table.TableModel |
---|
addTableModelListener, removeTableModelListener |
Constructor Detail |
---|
public CalculatedTableModel(TableModel model)
model
- the original table model.Method Detail |
---|
public CalculatedColumn getCalculatedColumnAt(int columnIndex)
columnIndex
- the column index
public int getActualColumnAt(int column)
DefaultColumnTableModelWrapper
getActualColumnAt
in interface ColumnTableModelWrapper
getActualColumnAt
in class DefaultColumnTableModelWrapper
column
- the column on the UI.
public final int getVisualColumnAt(int actualColumn)
DefaultColumnTableModelWrapper
getVisualColumnAt
in interface ColumnTableModelWrapper
getVisualColumnAt
in class DefaultColumnTableModelWrapper
actualColumn
- the actual column in actual model.
public Object getValueAt(int row, int column)
getValueAt
in interface TableModel
getValueAt
in class DefaultColumnTableModelWrapper
public void setValueAt(Object value, int row, int column)
setValueAt
in interface TableModel
setValueAt
in class DefaultColumnTableModelWrapper
public int getColumnCount()
getColumnCount
in interface TableModel
getColumnCount
in class DefaultColumnTableModelWrapper
public String getColumnName(int column)
getColumnName
in interface TableModel
getColumnName
in class DefaultColumnTableModelWrapper
public Object getColumnIdentifier(int column)
ColumnIdentifierTableModel
JideTable
uses this method to get the unique
identifier of this column.
getColumnIdentifier
in interface ColumnIdentifierTableModel
getColumnIdentifier
in class DefaultColumnTableModelWrapper
column
- the index of the column
public Class<?> getColumnClass(int column)
getColumnClass
in interface TableModel
getColumnClass
in class DefaultColumnTableModelWrapper
public boolean isCellEditable(int row, int column)
isCellEditable
in interface TableModel
isCellEditable
in class DefaultColumnTableModelWrapper
public Class<?> getCellClassAt(int row, int column)
DefaultColumnTableModelWrapper
ContextSensitiveTableModel
. If not, it will return null.
getCellClassAt
in interface ContextSensitiveTableModel
getCellClassAt
in class DefaultColumnTableModelWrapper
row
- the row index.column
- the column index.
public EditorContext getEditorContextAt(int row, int column)
DefaultColumnTableModelWrapper
ContextSensitiveTableModel
. If not, it will return null.
getEditorContextAt
in interface ContextSensitiveTableModel
getEditorContextAt
in class DefaultColumnTableModelWrapper
row
- the row index.column
- the column index.
public ConverterContext getConverterContextAt(int row, int column)
DefaultColumnTableModelWrapper
ContextSensitiveTableModel
. If not, it will return null.
getConverterContextAt
in interface ContextSensitiveTableModel
getConverterContextAt
in class DefaultColumnTableModelWrapper
row
- the row index.column
- the column index.
public final int[] getIndexes()
DefaultColumnTableModelWrapper
getIndexes
in class DefaultColumnTableModelWrapper
public final void setIndexes(int[] indexes)
DefaultColumnTableModelWrapper
setIndexes
in class DefaultColumnTableModelWrapper
indexes
- the new index array.protected int[] getDependingColumnsOf(int column)
column
- the column index
protected void tableDataChanged(CompoundTableModelEvent event)
tableDataChanged
in class DefaultColumnTableModelWrapper
public void tableCellsUpdated(int columnIndex, int firstRow, int lastRow)
DefaultColumnTableModelWrapper
column
in the range [firstRow
, lastRow
] are
updated. This default implementation simply fires a corresponding TableModelEvent
to the listeners
on this model.
tableCellsUpdated
in class DefaultColumnTableModelWrapper
columnIndex
- the index of the column that was updatedfirstRow
- the index of the first row in the above column
that was updatedlastRow
- the index of the last row in the above column
that was updatedpublic void addAllColumns()
public void addColumn(CalculatedColumn column)
column
- the new columnaddColumns(java.util.Collection)
public void addColumns(Collection<CalculatedColumn> columns)
columns
- the new columnspublic void removeColumn(CalculatedColumn column)
column
- the columnremoveColumns(java.util.Collection)
public void removeColumns(Collection<CalculatedColumn> columns)
columns
- the columnsprotected Row createWrappedRow(ExpandableRow originalRow)
DefaultColumnTableModelWrapper
createWrappedRow
in class DefaultColumnTableModelWrapper
originalRow
- the original row in the wrapped ITreeTableModel
|
JIDE 3.5.15 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |