JIDE 3.5.15

com.jidesoft.pivot
Class AggregateTableModel

java.lang.Object
  extended by javax.swing.table.AbstractTableModel
      extended by com.jidesoft.grid.JoinTableModel
          extended by com.jidesoft.pivot.AggregateTableModel
All Implemented Interfaces:
ColumnIdentifierTableModel, ColumnTableModelWrapper, ContextSensitiveTableModel, GroupModelProvider, IndexChangeEventGenerator, MultiTableModel, NavigableModel, RowTableModelWrapper, SpanModel, StyleModel, TableModelsWrapper, TableModelWrapper, Serializable, TableModel

public class AggregateTableModel
extends JoinTableModel
implements RowTableModelWrapper, ColumnTableModelWrapper, GroupModelProvider, IndexChangeEventGenerator

AggregateTableModel takes any table models and aggregates the same values on the aggregated columns and add expand/collapse icon or cell span to the cell on these aggregated rows.

It is very similar to DefaultGroupTableModel except DefaultGroupTableModel is a kind of TreeTableModel, v.s. AggregateTableModel is just a regular TableModel.

AggregateTableModel used PivotDataModel to do the aggregation. We tried to hide this implementation detail from user as much as we can. But there is a getField(String) method which exposes the actual PivotField to the user. You can use this PivotField to add summary to the aggregated column.

If you have a table model, you call AggregateTableModel(javax.swing.table.TableModel) to create an AggregateTableModel. Then you call setAggregatedColumns(int[]) or {setAggregatedColumns(String[]) to aggregate the columns that have duplicated values. At last, you call aggregate(). This call will make the AggregateTableModel to be ready to be used by AggregateTable.

See Also:
Serialized Form

Nested Class Summary
protected  class AggregateTableModel.AggregateTablePivotDataModel
          The PivotDataModel for AggregateTable to use.
 
Field Summary
static String PROPERTY_AGGREGATED_COLUMNS_CHANGING
           
 
Fields inherited from class com.jidesoft.grid.JoinTableModel
_models
 
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
AggregateTableModel(TableModel model)
           
AggregateTableModel(TableModel model, int[] aggregateColumnNames)
           
AggregateTableModel(TableModel model, String[] aggregateColumnNames)
           
 
Method Summary
 void addAggregatedColumn(int column)
           
 void addAggregatedColumn(int index, int column)
           
 void addIndexChangeListener(IndexChangeListener l)
          Add IndexChangelistener.
 void addPropertyChangeListener(PropertyChangeListener listener)
          Adds a PropertyChangeListener to the listener list.
 void addPropertyChangeListener(String propertyName, PropertyChangeListener listener)
          Adds a PropertyChangeListener to the listener list for a specific property.
 void aggregate()
          Aggregates the table model.
protected  PivotDataModel createPivotDataModel(TableModel model)
          Creates PivotDataModel and overrides calculate method to update the aggregate table model.
protected  void customizePivotDataModel(PivotDataModel pivotDataModel)
           
protected  void firePropertyChange(String propertyName, Object oldValue, Object newValue)
          Support for reporting bound property changes for Object properties.
 int getActualColumnAt(int column)
          Gets actual column index in actual table model from the column index in AggregateTableModel.
 TableModel getActualModel()
          Gets the underlying table model.
 int getActualModelColumnIndex(int columnModelIndex)
          Gets the actual column index in the actual table model that is passed to the constructor of the AggregateTableModel.
 int getActualRowAt(int visualRow)
          Gets the actual row index based on the visual row index.
 List<Integer> getActualRowsAt(int visualRow)
          Gets the actual rows based on the visual row index.
 Integer[] getActualRowsAt(int visualRow, int aggregatedColumnVisualIndex)
          Gets the actual row indices based on the visual row index and the aggregated column index.
 int getAggregatedColumnCount()
          Gets the number of aggregated column count.
 int[] getAggregatedColumns()
          Gets the aggregated column indices.
 int[] getAggregatedColumnsInPivotFields()
          Gets the aggregated column indices recorded in PivotField, which could be different with getAggregatedColumns() if you just invoked setAggregatedColumns(int[]) and did not invoke aggregate() yet.
 Class<?> getCellClassAt(int rowIndex, int columnIndex)
          Overrides to return the getCellClassAt from the underlying table models, of course, only when the underlying table model is ContextSensitiveTableModel.
 CellSpan getCellSpanAt(int rowIndex, int columnIndex)
          Overrides to return the CellSpan from the underlying table models, of course, only when the underlying table model is SpanModel and isCellSpanOn is true.
 CellStyle getCellStyleAt(int rowIndex, int columnIndex)
          Overrides to return the CellStyle from the underlying table models, of course, only when the underlying table model is StyleModel and isCellStyleOn is true.
 CellStyleProvider getCellStyleProvider()
           
 Class<?> getColumnClass(int columnIndex)
          Overrides to return the getColumnClass from the underlying table models.
 int getColumnCount()
          Gets the total number of column count.
 Object getColumnIdentifier(int columnIndex)
          Returns the identifier of the column in the model.
 String getColumnName(int columnIndex)
          Overrides to return the getColumnName from the underlying table models.
 int getColumnType(int columnIndex)
          Gets the column type in MultiTableModel.
 ConverterContext getConverterContextAt(int rowIndex, int columnIndex)
          Overrides to return the getConverterContextAt from the underlying table models, of course, only when the underlying table model is ContextSensitiveTableModel.
 EditorContext getEditorContextAt(int rowIndex, int columnIndex)
          Overrides to return the getEditorContextAt from the underlying table models, of course, only when the underlying table model is ContextSensitiveTableModel.
 PivotField getField(int columnIndex)
          Gets the PivotField from the underlying PivotDataModel.
 PivotField getField(String name)
          Gets the PivotField from the underlying PivotDataModel.
 int getGroupColumnAt(int index)
          Gets the corresponding column index in its actual table model for the designated aggregated column.
 int getGroupColumnCount()
          Gets the count of aggregated columns.
 Object getGroupColumnIdentifier(int groupColumnIndex)
          Gets the identifier of the group column index.
 int getGroupColumnOrder(int index)
          Gets the corresponding column order in its actual table model for the designated aggregated column.
 IndexChangeListener[] getIndexChangeListeners()
          Returns an array of all the IndexChangeListeners
 int getMaximumAggregatedRows()
          Gets the maximum number of aggregated rows.
 int getModelColumnIndex(int actualColumnIndex)
          Gets the column index as in the AggregateTableModel.
 IPivotDataModel getPivotDataModel()
          Gets the PivotDataModel.
 PropertyChangeListener[] getPropertyChangeListeners()
          Returns an array of all the property change listeners registered on this component.
 PropertyChangeListener[] getPropertyChangeListeners(String propertyName)
          Returns an array of all the listeners which have been associated with the named property.
 int getRowAt(int actualRow)
          Gets the view row index based on the actual row index.
 int getRowCount()
          Gets the total number of row count.
 SummaryCalculator getSummaryCalculator()
          Gets the statistics calculator used to calculate all the statistics for the pivot data model.
 int getTableIndex(int columnIndex)
          Get the table index.
 Object getValueAt(int rowIndex, int columnIndex)
          Overrides to return the getValueAt from the underlying table models.
 int getVisualColumnAt(int actualColumn)
          Gets the column index in AggregateTableModel from actual column index in actual table model.
 int getVisualRowAt(int actualRow)
          Gets the visual row index representing the specified actual row.
 void groupAndRefresh()
          Aggregates the table model.
 boolean groupColumnsFirst()
          Gets the flag indicating if group columns should always be displayed at the begging when displayed.
 boolean hasAggregateColumns()
           
 void hideColumn(int column)
           
 boolean isAggregated()
          Checks if the table model has been aggregated.
 boolean isCellSpanOn()
          Overrides to return true if any of the underlying table models is SpanModel and the isCellSpanOn is true.
 boolean isCellStyleOn()
          Overrides to return true if any of the underlying table models is StyleModel and the isCellStyleOn is true.
 boolean isColumnAggregated(int column)
          Checks if the table model has been aggregated.
 boolean isColumnGroupable(int columnIndex)
          Checks if the column is groupable or not.
 boolean isDisplayGroupColumns()
          Always displays the grouped columns for AggregateTable.
 boolean isSettingAggregateColumns()
           
 boolean isShowGrandTotal()
          Gets the showSummary flag.
 boolean isShowSummary()
          Gets the showSummary flag.
 boolean isShowSummaryOnly()
          Gets the showSummaryOnly flag.
 boolean isSortAggregatedColumns()
          Gets the flag if the aggregated columns should be sorted automatically
 boolean isSummaryMode()
          Gets the summaryMode flag.
 void removeAggregatedColumn(int column)
           
 void removeIndexChangeListener(IndexChangeListener l)
          Remove IndexChangelistener.
 void removePropertyChangeListener(PropertyChangeListener listener)
          Removes a PropertyChangeListener from the listener list.
 void removePropertyChangeListener(String propertyName, PropertyChangeListener listener)
          Removes a PropertyChangeListener from the listener list for a specific property.
 void setAggregatedColumns(int[] columns)
          Sets the aggregated columns.
 void setAggregatedColumns(String[] columnNames)
          Sets the aggregated columns.
 void setCellStyleProvider(CellStyleProvider cellStyleProvider)
           
 void setGroupColumns(int[] columns, int[] orders)
          Sets the aggregated columns.
 void setMaximumAggregatedRows(int maximumAggregatedRows)
          Sets the maximum number of aggregated rows.
 void setSettingAggregateColumns(boolean settingAggregateColumns)
           
 void setShowGrandTotal(boolean show)
          Sets showGrandTotal flag.
 void setShowSummary(boolean show)
          Sets showSummary flag.
 void setShowSummaryOnly(boolean showSummaryOnly)
          Sets showSummaryOnly flag.
 void setSortAggregatedColumns(boolean sorted)
          Sets the flag if the aggregated columns should be sorted automatically.
 void setSummaryCalculator(SummaryCalculator summaryCalculator)
          Sets the statistics calculator.
 void setSummaryMode(boolean show)
          Sets summaryMode flag.
 void setValueAt(Object aValue, int rowIndex, int columnIndex)
          Overrides to call setValueAt of the underlying table models to set the value.
 
Methods inherited from class com.jidesoft.grid.JoinTableModel
addTableModel, addTableModel, getActualModel, getTableModel, getTableModelCount, isCellEditable, isNavigableAt, isNavigationOn, removeAllTableModels, removeTableModel
 
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
 
Methods inherited from interface javax.swing.table.TableModel
addTableModelListener, removeTableModelListener
 

Field Detail

PROPERTY_AGGREGATED_COLUMNS_CHANGING

public static final String PROPERTY_AGGREGATED_COLUMNS_CHANGING
See Also:
Constant Field Values
Constructor Detail

AggregateTableModel

public AggregateTableModel(TableModel model)

AggregateTableModel

public AggregateTableModel(TableModel model,
                           String[] aggregateColumnNames)

AggregateTableModel

public AggregateTableModel(TableModel model,
                           int[] aggregateColumnNames)
Method Detail

createPivotDataModel

protected PivotDataModel createPivotDataModel(TableModel model)
Creates PivotDataModel and overrides calculate method to update the aggregate table model. See below for the default code.
 return new AggregateTablePivotDataModel(model);
 

Parameters:
model - the table model
Returns:
PivotDataModel

customizePivotDataModel

protected void customizePivotDataModel(PivotDataModel pivotDataModel)

setAggregatedColumns

public void setAggregatedColumns(int[] columns)
Sets the aggregated columns. The previous aggregated columns setting will be reset. If you want to add some column name instead of reset, please call addAggregatedColumn(int)

Sets the aggregated columns. Nothing is changed at this point until aggregate() is called.

Parameters:
columns - the index of the columns to be aggregated.

setAggregatedColumns

public void setAggregatedColumns(String[] columnNames)
Sets the aggregated columns. The previous aggregated columns setting will be reset. If you want to add some column name instead of reset, please call addAggregatedColumn(int)

Nothing is changed at this point until aggregate() is called.

Parameters:
columnNames - the name of the columns to be aggregated.

addAggregatedColumn

public void addAggregatedColumn(int index,
                                int column)

addAggregatedColumn

public void addAggregatedColumn(int column)

removeAggregatedColumn

public void removeAggregatedColumn(int column)

hideColumn

public void hideColumn(int column)

isAggregated

public boolean isAggregated()
Checks if the table model has been aggregated.

Returns:
true or false.

isColumnAggregated

public boolean isColumnAggregated(int column)
Checks if the table model has been aggregated.

Parameters:
column - the column index.
Returns:
true or false.

setShowSummary

public void setShowSummary(boolean show)
Sets showSummary flag. If true, there will be a summary row before the aggregated rows. The value of this summary rows are depending on the corresponding PivotField's getSummaryType.

Parameters:
show - true or false.

isShowSummary

public boolean isShowSummary()
Gets the showSummary flag.

Returns:
true if summary is shown. Otherwise false.

setSummaryMode

public void setSummaryMode(boolean show)
Sets summaryMode flag. If false, only the first row will be displayed when the value is collapsed. If true, the collapsed row will display the summary of all the rows. This method basically calls to PivotDataModel.setSummaryMode(boolean).

Parameters:
show - true or false.

isSummaryMode

public boolean isSummaryMode()
Gets the summaryMode flag.

Returns:
true if summary is shown when the row is collapsed. Otherwise the first row will be displayed.

setShowSummaryOnly

public void setShowSummaryOnly(boolean showSummaryOnly)
Sets showSummaryOnly flag. If true, the last aggregated column will not be expandable.

Parameters:
showSummaryOnly - true or false.

isShowSummaryOnly

public boolean isShowSummaryOnly()
Gets the showSummaryOnly flag.

Returns:
true if the last aggregated column is not expandable. Otherwise false.

setSortAggregatedColumns

public void setSortAggregatedColumns(boolean sorted)
Sets the flag if the aggregated columns should be sorted automatically. If true, the aggregated columns will be sorted automatically.

Parameters:
sorted - true or false.

isSortAggregatedColumns

public boolean isSortAggregatedColumns()
Gets the flag if the aggregated columns should be sorted automatically

Returns:
true if the aggregated columns is sorted automatically. Otherwise false.

setShowGrandTotal

public void setShowGrandTotal(boolean show)
Sets showGrandTotal flag. If true, the last row will be the grand total row.

Parameters:
show - true or false.

isShowGrandTotal

public boolean isShowGrandTotal()
Gets the showSummary flag.

Returns:
true if summary is shown. Otherwise false.

getMaximumAggregatedRows

public int getMaximumAggregatedRows()
Gets the maximum number of aggregated rows.

Returns:
the maximum number of aggregated rows.

setMaximumAggregatedRows

public void setMaximumAggregatedRows(int maximumAggregatedRows)
Sets the maximum number of aggregated rows. For example, if you set it to 5, the aggregated table will display only five rows when you expand the row for the last aggregated column. You need to call aggregate() method when this property is changed.

Parameters:
maximumAggregatedRows - the maximum number of aggregated rows.

getField

public PivotField getField(String name)
Gets the PivotField from the underlying PivotDataModel.

Parameters:
name - the name of the field. It should be the column name.
Returns:
the PivotField.

getField

public PivotField getField(int columnIndex)
Gets the PivotField from the underlying PivotDataModel.

Parameters:
columnIndex - the column index.
Returns:
the PivotField.

aggregate

public void aggregate()
Aggregates the table model. Please note, this method could take a long time if you have a huge table model to aggregate. At the end, it will fire TableStructureChanged event.

To keep the column order, please try call YourAggregateTable#aggregate() instead of call this method directly.


hasAggregateColumns

public boolean hasAggregateColumns()

getGroupColumnCount

public int getGroupColumnCount()
Gets the count of aggregated columns.

Specified by:
getGroupColumnCount in interface GroupModelProvider
Returns:
the column count.
Since:
3.2.3

getGroupColumnAt

public int getGroupColumnAt(int index)
Gets the corresponding column index in its actual table model for the designated aggregated column.

Specified by:
getGroupColumnAt in interface GroupModelProvider
Parameters:
index - the aggregated column index
Returns:
the corresponding column index in its actual table model
Since:
3.2.3

getGroupColumnOrder

public final int getGroupColumnOrder(int index)
Gets the corresponding column order in its actual table model for the designated aggregated column.

Specified by:
getGroupColumnOrder in interface GroupModelProvider
Parameters:
index - the aggregated column index
Returns:
the corresponding column order in its actual table model
Since:
3.2.3

setGroupColumns

public void setGroupColumns(int[] columns,
                            int[] orders)
Sets the aggregated columns.

Specified by:
setGroupColumns in interface GroupModelProvider
Parameters:
columns - the columns array
orders - no use for AggregateTableModel
Since:
3.2.3

groupAndRefresh

public void groupAndRefresh()
Aggregates the table model.

Specified by:
groupAndRefresh in interface GroupModelProvider
Since:
3.2.3

isColumnGroupable

public boolean isColumnGroupable(int columnIndex)
Checks if the column is groupable or not.

Specified by:
isColumnGroupable in interface GroupModelProvider
Parameters:
columnIndex - the column index
Returns:
true if the column is groupable. Otherwise false.
Since:
3.2.3

isDisplayGroupColumns

public final boolean isDisplayGroupColumns()
Always displays the grouped columns for AggregateTable.

Specified by:
isDisplayGroupColumns in interface GroupModelProvider
Returns:
true.
Since:
3.2.3

groupColumnsFirst

public boolean groupColumnsFirst()
Description copied from interface: GroupModelProvider
Gets the flag indicating if group columns should always be displayed at the begging when displayed.

Specified by:
groupColumnsFirst in interface GroupModelProvider
Returns:
true if the group columns should be displayed in the beginning in the native table header. Otherwise false.

getGroupColumnIdentifier

public Object getGroupColumnIdentifier(int groupColumnIndex)
Description copied from interface: GroupModelProvider
Gets the identifier of the group column index.

Specified by:
getGroupColumnIdentifier in interface GroupModelProvider
Parameters:
groupColumnIndex - the group column index
Returns:
the identifier.

getAggregatedColumnCount

public int getAggregatedColumnCount()
Gets the number of aggregated column count.

Returns:
the number of aggregated column count.

getAggregatedColumnsInPivotFields

public int[] getAggregatedColumnsInPivotFields()
Gets the aggregated column indices recorded in PivotField, which could be different with getAggregatedColumns() if you just invoked setAggregatedColumns(int[]) and did not invoke aggregate() yet.

Returns:
the aggregated column indices.

getAggregatedColumns

public int[] getAggregatedColumns()
Gets the aggregated column indices.

Returns:
the aggregated column indices.

getCellStyleProvider

public CellStyleProvider getCellStyleProvider()

setCellStyleProvider

public void setCellStyleProvider(CellStyleProvider cellStyleProvider)

getCellStyleAt

public CellStyle getCellStyleAt(int rowIndex,
                                int columnIndex)
Description copied from class: JoinTableModel
Overrides to return the CellStyle from the underlying table models, of course, only when the underlying table model is StyleModel and isCellStyleOn is true. Otherwise null will be returned.

Specified by:
getCellStyleAt in interface StyleModel
Overrides:
getCellStyleAt in class JoinTableModel
Parameters:
rowIndex - the row index.
columnIndex - the column index.
Returns:
the CellStyle at the specified row and column index.

isCellStyleOn

public boolean isCellStyleOn()
Description copied from class: JoinTableModel
Overrides to return true if any of the underlying table models is StyleModel and the isCellStyleOn is true.

Specified by:
isCellStyleOn in interface StyleModel
Overrides:
isCellStyleOn in class JoinTableModel
Returns:
return true if any of the underlying table models is StyleModel and the isCellStyleOn is true. Otherwise false.

setSummaryCalculator

public void setSummaryCalculator(SummaryCalculator summaryCalculator)
Sets the statistics calculator.

Parameters:
summaryCalculator - the summary calculator.

getSummaryCalculator

public SummaryCalculator getSummaryCalculator()
Gets the statistics calculator used to calculate all the statistics for the pivot data model.

Returns:
the statistics calculator.

getActualModelColumnIndex

public int getActualModelColumnIndex(int columnModelIndex)
Gets the actual column index in the actual table model that is passed to the constructor of the AggregateTableModel.

Parameters:
columnModelIndex - the column index as in the AggregateTableModel.
Returns:
the actual column index in the actual table model that is passed to the constructor of the AggregateTableModel.

getModelColumnIndex

public int getModelColumnIndex(int actualColumnIndex)
Gets the column index as in the AggregateTableModel.

Parameters:
actualColumnIndex - the actual model index as in the table model passed to the constructor of the AggregateTableModel.
Returns:
the column index as in the AggregateTableModel.

getActualRowsAt

public Integer[] getActualRowsAt(int visualRow,
                                 int aggregatedColumnVisualIndex)
Gets the actual row indices based on the visual row index and the aggregated column index.

Parameters:
visualRow - the visual row index.
aggregatedColumnVisualIndex - the visual column index of the aggregated column. It must be greater than 0 and less then the count of the aggregated columns.
Returns:
a list of the actual row indices.

getRowAt

public int getRowAt(int actualRow)
Gets the view row index based on the actual row index.

Parameters:
actualRow - the row index in the actual table model
Returns:
the view row index. -1 if not found.

getActualRowAt

public int getActualRowAt(int visualRow)
Gets the actual row index based on the visual row index.

Specified by:
getActualRowAt in interface RowTableModelWrapper
Parameters:
visualRow - the visual row index.
Returns:
the actual row index. If -1, it means there are multiple rows for the specified visual row index (such as a summary row). In this case, you can use getActualRowsAt(int) to find out all the rows.

getVisualRowAt

public int getVisualRowAt(int actualRow)
Gets the visual row index representing the specified actual row.

Specified by:
getVisualRowAt in interface RowTableModelWrapper
Parameters:
actualRow - the actual row index.
Returns:
the visual row index. -1 if there is no visual row representing it.
Since:
3.1.1

getActualRowsAt

public List<Integer> getActualRowsAt(int visualRow)
Gets the actual rows based on the visual row index.

Parameters:
visualRow - the visual row index.
Returns:
the actual row indices. In most cases, it will return a list with just one row index. But if the row is a summary row, it could return a list of several row indices which results in the summary row.

getPivotDataModel

public IPivotDataModel getPivotDataModel()
Gets the PivotDataModel. This is the actual class that does the aggregation.

Returns:
the PivotDataModel.

getColumnIdentifier

public Object getColumnIdentifier(int columnIndex)
Description copied from interface: ColumnIdentifierTableModel
Returns the identifier of the column in the model. A JideTable uses this method to get the unique identifier of this column.

Specified by:
getColumnIdentifier in interface ColumnIdentifierTableModel
Overrides:
getColumnIdentifier in class JoinTableModel
Parameters:
columnIndex - the index of the column
Returns:
the unique identifier of the column.

getColumnClass

public Class<?> getColumnClass(int columnIndex)
Description copied from class: JoinTableModel
Overrides to return the getColumnClass from the underlying table models.

Specified by:
getColumnClass in interface TableModel
Overrides:
getColumnClass in class JoinTableModel
Parameters:
columnIndex - the column index.
Returns:
the column class for the column.

getColumnName

public String getColumnName(int columnIndex)
Description copied from class: JoinTableModel
Overrides to return the getColumnName from the underlying table models.

Specified by:
getColumnName in interface TableModel
Overrides:
getColumnName in class JoinTableModel
Parameters:
columnIndex - the column index.
Returns:
the column name for the column.

getColumnCount

public int getColumnCount()
Description copied from class: JoinTableModel
Gets the total number of column count. It is the sum of all table models' column count.

Specified by:
getColumnCount in interface TableModel
Overrides:
getColumnCount in class JoinTableModel
Returns:
the total number of column count.

getRowCount

public int getRowCount()
Description copied from class: JoinTableModel
Gets the total number of row count. It is the max of all table models' row count.

Specified by:
getRowCount in interface TableModel
Overrides:
getRowCount in class JoinTableModel
Returns:
the total number of row count.

getValueAt

public Object getValueAt(int rowIndex,
                         int columnIndex)
Description copied from class: JoinTableModel
Overrides to return the getValueAt from the underlying table models.

Specified by:
getValueAt in interface TableModel
Overrides:
getValueAt in class JoinTableModel
Parameters:
rowIndex - the row index.
columnIndex - the column index.
Returns:
the value at the specified row and column index.

setValueAt

public void setValueAt(Object aValue,
                       int rowIndex,
                       int columnIndex)
Description copied from class: JoinTableModel
Overrides to call setValueAt of the underlying table models to set the value.

Specified by:
setValueAt in interface TableModel
Overrides:
setValueAt in class JoinTableModel
Parameters:
aValue - the new value at the specified row and column index.
rowIndex - the row index.
columnIndex - the column index.

getConverterContextAt

public ConverterContext getConverterContextAt(int rowIndex,
                                              int columnIndex)
Description copied from class: JoinTableModel
Overrides to return the getConverterContextAt from the underlying table models, of course, only when the underlying table model is ContextSensitiveTableModel. Otherwise null will be returned.

Specified by:
getConverterContextAt in interface ContextSensitiveTableModel
Overrides:
getConverterContextAt in class JoinTableModel
Parameters:
rowIndex - the row index.
columnIndex - the column index.
Returns:
the ConverterContext at the specified row and column index.

getEditorContextAt

public EditorContext getEditorContextAt(int rowIndex,
                                        int columnIndex)
Description copied from class: JoinTableModel
Overrides to return the getEditorContextAt from the underlying table models, of course, only when the underlying table model is ContextSensitiveTableModel. Otherwise null will be returned.

Specified by:
getEditorContextAt in interface ContextSensitiveTableModel
Overrides:
getEditorContextAt in class JoinTableModel
Parameters:
rowIndex - the row index.
columnIndex - the column index.
Returns:
the EditorContext at the specified row and column index.

getCellClassAt

public Class<?> getCellClassAt(int rowIndex,
                               int columnIndex)
Description copied from class: JoinTableModel
Overrides to return the getCellClassAt from the underlying table models, of course, only when the underlying table model is ContextSensitiveTableModel. Otherwise null will be returned.

Specified by:
getCellClassAt in interface ContextSensitiveTableModel
Overrides:
getCellClassAt in class JoinTableModel
Parameters:
rowIndex - the row index.
columnIndex - the column index.
Returns:
the CellClass at the specified row and column index.

getCellSpanAt

public CellSpan getCellSpanAt(int rowIndex,
                              int columnIndex)
Description copied from class: JoinTableModel
Overrides to return the CellSpan from the underlying table models, of course, only when the underlying table model is SpanModel and isCellSpanOn is true. Otherwise null will be returned.

Specified by:
getCellSpanAt in interface SpanModel
Overrides:
getCellSpanAt in class JoinTableModel
Parameters:
rowIndex - the row index.
columnIndex - the column index.
Returns:
the CellSpan at the specified row and column index.

isCellSpanOn

public boolean isCellSpanOn()
Description copied from class: JoinTableModel
Overrides to return true if any of the underlying table models is SpanModel and the isCellSpanOn is true.

Specified by:
isCellSpanOn in interface SpanModel
Overrides:
isCellSpanOn in class JoinTableModel
Returns:
return true if any of the underlying table models is SpanModel and the isCellSpanOn is true. Otherwise false.

getTableIndex

public int getTableIndex(int columnIndex)
Description copied from class: JoinTableModel
Get the table index. This is a method MultiTableModel index. It always return 0. If you need something different, you would need to override it to return something else.

Specified by:
getTableIndex in interface MultiTableModel
Overrides:
getTableIndex in class JoinTableModel
Parameters:
columnIndex - the column index.
Returns:
always 0.

getColumnType

public int getColumnType(int columnIndex)
Description copied from class: JoinTableModel
Gets the column type in MultiTableModel. The returned value is limited to the first three table model. If you need something different, you would need to override it to return something else.

Specified by:
getColumnType in interface MultiTableModel
Overrides:
getColumnType in class JoinTableModel
Parameters:
columnIndex - the column index.
Returns:
HEADER_COLUMN if the column index is part of the first table model, REGULAR_COLUMN if the column index is part of the second table model and FOOTER_COLUMN if the column index is part of the third table model.

getActualModel

public TableModel getActualModel()
Description copied from interface: TableModelWrapper
Gets the underlying table model.

Specified by:
getActualModel in interface TableModelWrapper
Returns:
the underlying table model.

firePropertyChange

protected void firePropertyChange(String propertyName,
                                  Object oldValue,
                                  Object newValue)
Support for reporting bound property changes for Object properties. This method can be called when a bound property has changed and it will send the appropriate PropertyChangeEvent to any registered PropertyChangeListeners.

Parameters:
propertyName - the property whose value has changed
oldValue - the property's previous value
newValue - the property's new value

addPropertyChangeListener

public void addPropertyChangeListener(PropertyChangeListener listener)
Adds a PropertyChangeListener to the listener list.

Parameters:
listener - the PropertyChangeListener to be added
See Also:
removePropertyChangeListener(java.beans.PropertyChangeListener), getPropertyChangeListeners(), addPropertyChangeListener(java.lang.String,java.beans.PropertyChangeListener)

removePropertyChangeListener

public void removePropertyChangeListener(PropertyChangeListener listener)
Removes a PropertyChangeListener from the listener list. This method should be used to remove PropertyChangeListeners that were registered for all bound properties of this class.

If listener is null, no exception is thrown and no action is performed.

Parameters:
listener - the PropertyChangeListener to be removed
See Also:
addPropertyChangeListener(java.beans.PropertyChangeListener), getPropertyChangeListeners(), removePropertyChangeListener(java.lang.String,java.beans.PropertyChangeListener)

getPropertyChangeListeners

public PropertyChangeListener[] getPropertyChangeListeners()
Returns an array of all the property change listeners registered on this component.

Returns:
all of this component's PropertyChangeListeners or an empty array if no property change listeners are currently registered
Since:
1.4
See Also:
addPropertyChangeListener(java.beans.PropertyChangeListener), removePropertyChangeListener(java.beans.PropertyChangeListener), getPropertyChangeListeners(java.lang.String), PropertyChangeSupport.getPropertyChangeListeners()

addPropertyChangeListener

public void addPropertyChangeListener(String propertyName,
                                      PropertyChangeListener listener)
Adds a PropertyChangeListener to the listener list for a specific property.

Parameters:
propertyName - one of the property names listed above
listener - the PropertyChangeListener to be added
See Also:
removePropertyChangeListener(java.lang.String,java.beans.PropertyChangeListener), getPropertyChangeListeners(java.lang.String), addPropertyChangeListener(java.lang.String,java.beans.PropertyChangeListener)

removePropertyChangeListener

public void removePropertyChangeListener(String propertyName,
                                         PropertyChangeListener listener)
Removes a PropertyChangeListener from the listener list for a specific property. This method should be used to remove PropertyChangeListeners that were registered for a specific bound property.

If listener is null, no exception is thrown and no action is performed.

Parameters:
propertyName - a valid property name
listener - the PropertyChangeListener to be removed
See Also:
addPropertyChangeListener(java.lang.String,java.beans.PropertyChangeListener), getPropertyChangeListeners(java.lang.String), removePropertyChangeListener(java.beans.PropertyChangeListener)

getPropertyChangeListeners

public PropertyChangeListener[] getPropertyChangeListeners(String propertyName)
Returns an array of all the listeners which have been associated with the named property.

Parameters:
propertyName - the property name.
Returns:
all of the PropertyChangeListeners associated with the named property or an empty array if no listeners have been added
See Also:
addPropertyChangeListener(java.lang.String,java.beans.PropertyChangeListener), removePropertyChangeListener(java.lang.String,java.beans.PropertyChangeListener), getPropertyChangeListeners()

isSettingAggregateColumns

public boolean isSettingAggregateColumns()

setSettingAggregateColumns

public void setSettingAggregateColumns(boolean settingAggregateColumns)

getActualColumnAt

public int getActualColumnAt(int column)
Gets actual column index in actual table model from the column index in AggregateTableModel.

Specified by:
getActualColumnAt in interface ColumnTableModelWrapper
Parameters:
column - the column index in AggregateTableModel
Returns:
the actual column index in actual table model. -1 if not found.
Since:
3.2.0

getVisualColumnAt

public int getVisualColumnAt(int actualColumn)
Gets the column index in AggregateTableModel from actual column index in actual table model.

Specified by:
getVisualColumnAt in interface ColumnTableModelWrapper
Parameters:
actualColumn - the actual column index in actual table model
Returns:
the column index in AggregateTableModel. -1 if not found.
Since:
3.2.0

addIndexChangeListener

public void addIndexChangeListener(IndexChangeListener l)
Description copied from interface: IndexChangeEventGenerator
Add IndexChangelistener.

Specified by:
addIndexChangeListener in interface IndexChangeEventGenerator
Parameters:
l - the listener

removeIndexChangeListener

public void removeIndexChangeListener(IndexChangeListener l)
Description copied from interface: IndexChangeEventGenerator
Remove IndexChangelistener.

Specified by:
removeIndexChangeListener in interface IndexChangeEventGenerator
Parameters:
l - the listener

getIndexChangeListeners

public IndexChangeListener[] getIndexChangeListeners()
Description copied from interface: IndexChangeEventGenerator
Returns an array of all the IndexChangeListeners

Specified by:
getIndexChangeListeners in interface IndexChangeEventGenerator
Returns:
all of the IndexChangeListeners added or an empty array if no listeners have been added
See Also:
IndexChangeEventGenerator.addIndexChangeListener(com.jidesoft.grid.IndexChangeListener)

JIDE 3.5.15