|
JIDE 3.5.15 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.jidesoft.pivot.PivotDataModel
public class PivotDataModel
The model that contains the data for pivot table. It takes any table model as input. Then you can getField(String) method to get the PivotField to specify different settings such as which ones are row fields,
column fields, filter fields or data fields, do you want to calculate subtotals, the sort order. There are also a few
settings on PivotDataModel itself such as grand total. Once you setup everything, you can call calculate()
to generate pivot data.
| Nested Class Summary | |
|---|---|
static interface |
PivotDataModel.RowMerger
An interface to merge the rows when they have the same row and column fields. |
| Field Summary | |
|---|---|
protected PivotDataSource |
_dataSource
|
protected EventListenerList |
listenerList
|
static String |
PROPERTY_HIDE_REDUNDANT_SUBTOTAL
|
static String |
PROPERTY_HIDE_SINGLE_DATA_FIELD
|
static String |
PROPERTY_SHOW_GRAND_TOTAL_FOR_COLUMN
|
static String |
PROPERTY_SHOW_GRAND_TOTAL_FOR_ROW
|
static String |
PROPERTY_SHOW_SUBTOTAL_AS_CHILD
|
| Constructor Summary | |
|---|---|
PivotDataModel()
|
|
PivotDataModel(PivotDataSource dataSource)
Creates a PivotDataModel using PivotDataSource interface. |
|
PivotDataModel(TableModel tableModel)
Creates a PivotDataModel using table model as the data source. |
|
| Method Summary | |
|---|---|
void |
addHiddenColumn(Values values,
PivotField field)
Adds the designated column defined by values and PivotField to the hidden values. |
void |
addHiddenColumn(Values values,
PivotField dataField,
String width)
Adds the designated column defined by values and PivotField to the hidden values. |
void |
addHiddenValues(Values values)
Adds the values to the hidden values. |
void |
addPivotValueProviderListener(PivotValueProviderListener l)
Add PivotValueProviderListener so that the listener could know when calculation starts or ends. |
protected boolean |
addPrefixRowIndex(CompoundKey rowKey,
CompoundKey columnKey,
int rowIndex)
|
void |
addPropertyChangeListener(PropertyChangeListener listener)
Adds a PropertyChangeListener to the listener list. |
protected boolean |
addRowIndex(CompoundKey rowKey,
CompoundKey columnKey,
int rowIndex)
|
void |
calculate()
Calculates the pivot data. |
protected Object |
calculateStatistics(PivotField field,
int rowIndex,
int columnIndex,
int summaryType,
Object[] objects)
Deprecated. replaced by calculateStatistics(PivotField, Values, Values, int, Object[]) |
protected Object |
calculateStatistics(PivotField field,
Values rowValues,
Values columnValues,
int summaryType,
Object[] objects)
Calculate statistics for the cell with the same rowValues and the same columnValues in DataTable. |
void |
clearHiddenColumns()
Clears the hidden columns. |
void |
clearHiddenValues()
Clears the hidden values. |
protected Object[] |
collectValuesForCell(PivotField field,
int rowIndex,
int columnIndex,
int summaryType)
|
protected Object[] |
collectValuesForCell(PivotField field,
Values rowKeys,
Values columnKeys,
int summaryType)
|
protected HeaderTableModel |
createColumnHeaderTableModel(CompoundKey[] keys)
Creates the column header table model. |
protected DataTableModel |
createDataTableModel()
Creates DataTableModel. |
protected TableModelPivotDataSource |
createDefaultPivotDataSource(TableModel tableModel)
Creates default PivotDataSource which is TableModelPivotDataSource. |
protected com.jidesoft.pivot.PivotDataCube |
createPivotDataCube()
|
protected PivotField |
createPivotField(PivotDataSource dataSource,
int columnIndex)
Creates the PivotField. |
protected HeaderTableModel |
createRowHeaderTableModel(CompoundKey[] keys)
Creates the row header table model. |
void |
firePivotValueProviderChanged(int type)
|
void |
firePivotValueProviderChanged(int type,
Object object)
|
protected void |
firePropertyChange(String propertyName,
Object oldValue,
Object newValue)
Support for reporting property changes for boolean properties. |
void |
forceCalculate()
Ask PivotValueProvider to start calculate. |
PivotCellStyleProvider |
getCellStyleProvider()
Gets the PivotCellStyleProvider. |
int |
getColumnAt(int actualRow)
Gets the closest column index in DataTable that includes the actual row index in the original table model. |
int[] |
getColumnFieldIndices()
Gets the model indices for the column fields. |
PivotField[] |
getColumnFields()
Gets the column fields. |
int |
getColumnHeaderColumnIndexAt(int rowIndex)
Gets the column index in the column header table which has the data from the original table model at the specified rowIndex. |
PivotDataEditingProvider |
getColumnHeaderEditingProvider()
Gets the PivotDataEditingProvider for the column header table. |
HeaderTableModel |
getColumnHeaderTableModel()
Gets the column header table model. |
CompoundKey[] |
getColumnKeys()
Get column key array. |
protected CompoundKey |
getCompoundKeyAt(int rowIndex,
int areaType)
Gets the designated compound key from the row index in the data source. |
TableModel |
getCornerTableModel()
Gets the corner table model. |
List<Integer> |
getDataAt(CompoundKey rowKey,
CompoundKey columnKey)
Gets the row index list that matches with the rowKey and columnKey. |
List<Integer> |
getDataAt(int rowIndex,
int columnIndex)
Gets the row index list at the specified row index and column index. |
PivotDataEditingProvider |
getDataEditingProvider()
Gets the PivotDataEditingProvider for the data table. |
int[] |
getDataFieldIndices()
Gets the model indices for the data fields. |
PivotField[] |
getDataFields()
Gets the data fields. |
PivotDataSource |
getDataSource()
Gets the data source. |
TableModel |
getDataTableModel()
Gets the data table model. |
PivotField |
getField(int index)
Gets the PivotField by the index. |
PivotField |
getField(String name)
Gets the PivotField by the name. |
protected int[] |
getFieldIndices(PivotField[] fields)
|
PivotField[] |
getFields()
Gets all the PivotFields. |
int[] |
getFilterFieldIndices()
Gets the model indices for the filter fields. |
PivotField[] |
getFilterFields()
Gets the filter fields. |
Object[][] |
getHiddenColumns()
Get the hidden columns array. |
Values[] |
getHiddenValues()
Gets all the hidden values. |
PivotValueProviderListener[] |
getPivotValueProviderListeners()
|
Object[] |
getPossibleValues(int columnIndex)
Deprecated. the order of the possible values returned from this method is not clear. Please use getPossibleValues(int, java.util.Comparator) instead. We didn't use this method anymore in our
code. |
Object[] |
getPossibleValues(int columnIndex,
Comparator comparator)
Gets the possible values of the specified columnIndex. |
Object[] |
getPossibleValues(PivotField field)
Retrieve the possible values for the designated field. |
int |
getRowAt(int actualRow)
Gets the closest row index in DataTable that includes the actual row index in the original table model. |
int[] |
getRowFieldIndices()
Gets the model indices for the row fields. |
PivotField[] |
getRowFields()
Gets the row fields. |
PivotDataEditingProvider |
getRowHeaderEditingProvider()
Gets the PivotDataEditingProvider for the row header table. |
int |
getRowHeaderRowIndexAt(int rowIndex)
Gets the row index in the row header table which has the data from the original table model at the specified rowIndex. |
HeaderTableModel |
getRowHeaderTableModel()
Gets the row header table model. |
CompoundKey[] |
getRowKeys()
Get row key array. |
PivotDataModel.RowMerger |
getRowMerger()
Gets the row merger. |
int |
getStatisticsType(Values rowValues,
Values columnValues,
PivotField dataField)
Get the statistics layer. |
SummaryCalculator |
getSummaryCalculator()
Gets the statistics calculator used to calculate all the statistics for the pivot data model. |
SummaryCalculatorFactory |
getSummaryCalculatorFactory()
Gets the summary calculator factory which will create summary calculator to calculate all the statistics for the pivot data model. |
TableModel |
getTableModel()
Gets the table model. |
int[] |
getUnassignedFieldIndices()
Gets the model indices for the unassigned fields. |
PivotField[] |
getUnassignedFields()
Gets the unassigned fields. |
Object |
getValueAt(PivotField field,
Values rowKeys,
Values columnKeys)
Get the value to be compared. |
protected void |
handleFieldPropertyEvent(PropertyChangeEvent evt)
|
boolean |
hasHiddenColumns()
Checks if there are hidden columns. |
boolean |
hasHiddenValues()
Checks if there are hidden values. |
void |
initialize()
Initializes the PivotDataModel. |
void |
invalidateColumnHeaderTableModel()
Invalidate column header table model before calculate. |
void |
invalidateCornerTableModel()
Invalidate corner table model before calculate. |
void |
invalidateDataTableModel()
Invalidate data table model before calculate. |
void |
invalidateRowHeaderTableModel()
Invalidate row header table model before calculate. |
boolean |
isAdjusting()
Checks if the PivotDataModel is adjusting. |
boolean |
isAggregateMode()
Checks if the pivot data model works in aggregate mode. |
boolean |
isAllowEmptyColumnHeader()
Gets the flag if empty headers are allowed. |
boolean |
isAllowEmptyRowHeader()
Gets the flag if empty headers are allowed. |
boolean |
isAlwaysColumnDataFields()
Checks if the data fields will always displayed on the column header area. |
boolean |
isAlwaysRowDataFields()
Is the data field always displayed on the row header area. |
boolean |
isAutoSortKeys()
Checks whether the CompoundKeys automatically are sorted. |
boolean |
isAutoUpdate()
Checks if the pivot data will be automatically updated when the underlying table model data changes. |
boolean |
isCalculated()
Checks if calculate() is called on this pivot data model. |
boolean |
isCalculating()
Returns if PivotValueProvider is calculating. |
boolean |
isColumnDataFields()
Checks if the data field displayed on the column header area. |
boolean |
isColumnVisible(Values values,
PivotField field)
Checks if the Values is visible. |
boolean |
isComputeAffectedCellOnUpdate()
Get the flag indicating that if the PivotValueProviderEvent will contain the affected cells information on original data model change scenario. |
boolean |
isDisplayGrandTotalFirst()
Checks if the grand total is displayed as the first column (row). |
boolean |
isDisplayGrandTotalFirstForColumn()
Checks if the grand total is displayed as the first column. |
boolean |
isDisplayGrandTotalFirstForRow()
Checks if the grand total is displayed as the first row. |
boolean |
isExpandByDefault()
Checks the flag whether the pivot table expands to show all the values. |
boolean |
isHideExpandIconOnSingleRow()
Get the flag indicating if the expand/collapse icon will be hidden if there is only one row as its child. |
boolean |
isHideRedundantSubtotal()
When the subtotal is configured as automatically and there is only one item, the subtotal is redundant. |
boolean |
isHideSingleDataField()
|
boolean |
isHideSummaryValues()
Get the flag that indicating if summary values should be hidden if all its children values are hidden. |
boolean |
isHighPerformanceMode()
Gets the flag indicating if the IPivotDataModel should work on high performance mode. |
boolean |
isKeepRowChildrenOnSummaryFilter()
Get the flag indicating that if all its row children in row header table should be kept if the summary row is kept on data field filter. |
boolean |
isLayoutDataFieldsFirst()
Gets the flag indicating if the data field should be laid out in the first level or not. |
boolean |
isRowDataFields()
Is the data field displayed on the row header area. |
boolean |
isShowGrandTotalForColumn()
Checks if grand total column is visible. |
boolean |
isShowGrandTotalForRow()
Checks if grand total row is visible. |
boolean |
isShowSubtotalAsChild()
Get the flag. |
boolean |
isSingleValueMode()
The cells in the data table are actually summary of multiple rows in the original table model. |
boolean |
isSummaryLayer()
Gets the flag indicating if it's a summary layer. |
boolean |
isSummaryMode()
Checks if the pivot data model works in summary mode. |
static boolean |
isUseComparable()
Checks the useComparable flag. |
static boolean |
isValueImmutable()
Checks the valueImmutable flag. |
boolean |
isValuesVisible(Values values)
Checks if the Values is visible. |
protected void |
manageCompoundKeys()
Manages CompoundKeys after calculation to fill in some necessary CompoundKeys without adding dummy records in the original table model or removing some unnecessary CompoundKeys without removing records in the original table model. |
protected void |
removeColumnKey(CompoundKey columnKey)
Removes the CompoundKey in column header area. |
String |
removeHiddenColumn(Values values,
PivotField field)
Removes the column from the hidden columns. |
void |
removeHiddenValues(Values values)
Removes the values from the hidden values. |
void |
removePivotValueProviderListener(PivotValueProviderListener l)
Remove registered PivotValueProviderListener. |
void |
removePropertyChangeListener(PropertyChangeListener listener)
Removes a PropertyChangeListener from the listener list. |
protected void |
removeRowKey(CompoundKey rowKey)
Removes the CompoundKey in row header area. |
void |
resetDataFields()
Reset data fields based on the values in every PivotField. |
void |
setAdjusting(boolean adjusting)
Sets the PivotDataModel to adjusting mode. |
void |
setAllowEmptyColumnHeader(boolean allowEmptyColumnHeader)
Sets the flag if empty column header is allowed. |
void |
setAllowEmptyRowHeader(boolean allowEmptyRowHeader)
Sets the flag if empty row header is allowed. |
void |
setAlwaysColumnDataFields(boolean alwaysColumnDataFields)
Sets the flag whether the data fields will always be displayed on the column header area. |
void |
setAlwaysRowDataFields(boolean alwaysRowDataFields)
Sets the flag whether the data fields will always be displayed on the row header area. |
void |
setAutoSortKeys(boolean autoSortKeys)
Sets the flag whether the CompoundKeys should be automatically sorted when calcuate() is called. |
void |
setAutoUpdate(boolean autoUpdate)
Sets the flag if the pivot data will be automatically updated when the underlying table model data changes. |
void |
setCellStyleProvider(PivotCellStyleProvider cellStyleProvider)
Sets the PivotCellStyleProvider. |
void |
setColumnHeaderEditingProvider(PivotDataEditingProvider columnHeaderEditingProvider)
Sets the PivotDataEditingProvider that is used for the column header table. |
void |
setComputeAffectedCellOnUpdate(boolean computeAffectedCellOnUpdate)
Set the flag indicating that if the PivotValueProviderEvent will contain the affected cells information on original data model change scenario. |
void |
setDataEditingProvider(PivotDataEditingProvider dataEditingProvider)
Sets the PivotDataEditingProvider for the data table. |
void |
setDataSource(PivotDataSource dataSource)
Sets the data source. |
void |
setDisplayGrandTotalFirst(boolean displayGrandTotalFirst)
Deprecated. replaced by setDisplayGrandTotalFirstForRow(boolean) and setDisplayGrandTotalFirstForColumn(boolean) |
void |
setDisplayGrandTotalFirstForColumn(boolean displayGrandTotalFirstForColumn)
By default, grand total is displayed at the last column in the pivot table. |
void |
setDisplayGrandTotalFirstForRow(boolean displayGrandTotalFirstForRow)
By default, grand total is displayed at the last row in the pivot table. |
void |
setExpandByDefault(boolean expandByDefault)
Sets the flag whether the pivot table should expand to show all the values. |
void |
setHideExpandIconOnSingleRow(boolean hideExpandIconOnSingleRow)
Set the flag indicating if the expand/collapse icon will be hidden if there is only one row as its child. |
void |
setHideRedundantSubtotal(boolean hideRedundantSubtotal)
Sets the hideRedundantSubtotal flag. |
void |
setHideSingleDataField(boolean hideSingleDataField)
|
void |
setHideSummaryValues(boolean hideSummaryValues)
Set the flag that indicating if summary values should be hidden if all its children values are hidden. |
void |
setHighPerformanceMode(boolean highPerformanceMode)
Sets the flag indicating if the IPivotDataModel should work on high performance mode. |
void |
setKeepRowChildrenOnSummaryFilter(boolean keepRowChildrenOnSummaryFilter)
Set the flag indicating that if all its row children in row header table should be kept if the summary row is kept on data field filter. |
void |
setLayoutDataFieldsFirst(boolean layoutDataFieldsFirst)
Sets the flag indicating if the data field should be laid out in the first level or not. |
void |
setOriginalTableModel(TableModel tableModel)
Sets the original table model. |
void |
setPivotFields(PivotField[] rowFields,
PivotField[] columnFields,
PivotField[] dataFields,
PivotField[] filterFields)
Pass fields information to PivotValueProvider for calculation. |
void |
setRowHeaderEditingProvider(PivotDataEditingProvider rowHeaderEditingProvider)
Sets the PivotDataEditingProvider that is used for the row header table. |
void |
setRowMerger(PivotDataModel.RowMerger rowMerger)
Sets the row merger. |
void |
setShowGrandTotalForColumn(boolean showGrandTotalForColumn)
Shows grand total column. |
void |
setShowGrandTotalForRow(boolean showGrandTotalForRow)
Shows grand total row. |
void |
setShowSubtotalAsChild(boolean showSubtotalAsChild)
By default, the subtotal rows/columns are at the same level as the values. |
void |
setSingleValueMode(boolean singleValueMode)
Sets the single value mode. |
void |
setSummaryCalculator(SummaryCalculator summaryCalculator)
Sets the statistics calculator. |
void |
setSummaryCalculatorFactory(SummaryCalculatorFactory summaryCalculatorFactory)
Sets the statistics calculator factory. |
void |
setSummaryLayer(boolean summaryLayer)
Sets the flag indicating if it's a summary layer. |
void |
setSummaryMode(boolean summaryMode)
Sets the flag for the summary mode. |
static void |
setUseComparable(boolean useComparable)
Sets the flag of useComparable. |
static void |
setValueImmutable(boolean valueImmutable)
Sets the valueImmutable flag. |
protected boolean |
shouldCalculateSummary(int rowIndex,
int columnIndex)
Check if the cell in the DataTable need calculate summary. |
protected CompoundKey[] |
sortCompoundKeys(CompoundKey[] keys,
PivotField[] fields)
Sorts the compound keys based on the sort order in the fields. |
protected boolean |
tableCellsUpdated(int column,
int firstRow,
int lastRow)
|
protected boolean |
tableRowsDeleted(int firstRow,
int lastRow)
|
protected boolean |
tableRowsInserted(int firstRow,
int lastRow)
|
protected boolean |
tableRowsUpdated(int firstRow,
int lastRow)
|
void |
updateFields()
|
protected void |
updateFilters()
|
boolean |
verify()
This method is for debugging purpose, not a public API. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected PivotDataSource _dataSource
protected EventListenerList listenerList
public static final String PROPERTY_SHOW_GRAND_TOTAL_FOR_ROW
public static final String PROPERTY_SHOW_GRAND_TOTAL_FOR_COLUMN
public static final String PROPERTY_HIDE_REDUNDANT_SUBTOTAL
public static final String PROPERTY_SHOW_SUBTOTAL_AS_CHILD
public static final String PROPERTY_HIDE_SINGLE_DATA_FIELD
| Constructor Detail |
|---|
public PivotDataModel()
public PivotDataModel(TableModel tableModel)
tableModel - the table model.public PivotDataModel(PivotDataSource dataSource)
dataSource - the PivotDataSource.| Method Detail |
|---|
protected com.jidesoft.pivot.PivotDataCube createPivotDataCube()
public void initialize()
calculate(). If only the data is changed, just calculate() is enough.
initialize in interface IPivotDataModelpublic void setOriginalTableModel(TableModel tableModel)
tableModel - the new original table model.protected TableModelPivotDataSource createDefaultPivotDataSource(TableModel tableModel)
tableModel - the table model.
public void setDataSource(PivotDataSource dataSource)
setDataSource in interface IPivotDataModeldataSource - the new data source.
protected boolean tableCellsUpdated(int column,
int firstRow,
int lastRow)
protected boolean addRowIndex(CompoundKey rowKey,
CompoundKey columnKey,
int rowIndex)
protected boolean addPrefixRowIndex(CompoundKey rowKey,
CompoundKey columnKey,
int rowIndex)
protected boolean tableRowsUpdated(int firstRow,
int lastRow)
protected boolean tableRowsInserted(int firstRow,
int lastRow)
protected boolean tableRowsDeleted(int firstRow,
int lastRow)
protected PivotField createPivotField(PivotDataSource dataSource,
int columnIndex)
PivotField.
dataSource - the data source.columnIndex - the column index.
PivotField.public TableModel getTableModel()
PivotDataSource concept in 2.2.2 release. With the help of
PivotDataSource, PivotDataModel doesn't have to use TableModel as the data source.
Although this method will still return the table model in the default case when the data source is the default
TableModelPivotDataSource, it is not guaranteed. If you set your own PivotDataSource
which doesn't depend on any table model, this getTableModel will return null.
public PivotDataSource getDataSource()
getDataSource in interface IPivotDataModelpublic PivotField getField(String name)
getField in interface IPivotDataModelname - the field name
public PivotField getField(int index)
getField in interface IPivotDataModelindex - the field index
public PivotField[] getFields()
getFields in interface IPivotDataModel
public void setPivotFields(PivotField[] rowFields,
PivotField[] columnFields,
PivotField[] dataFields,
PivotField[] filterFields)
PivotValueProvider
setPivotFields in interface PivotValueProviderrowFields - the row fields arraycolumnFields - the column fields arraydataFields - the data fields arrayfilterFields - the filter fields arrayprotected void handleFieldPropertyEvent(PropertyChangeEvent evt)
public void updateFields()
updateFields in interface IPivotDataModelpublic void calculate()
PivotTablePane.fieldsUpdated() method in order for the change to take effect.
calculate in interface IPivotDataModelpublic void forceCalculate()
PivotValueProvider
forceCalculate in interface PivotValueProviderprotected void manageCompoundKeys()
addRowIndex(CompoundKey, CompoundKey, int) with the
third parameter as -1 to fill in the extra compound keys. Please invoke removeColumnKey(CompoundKey) or
removeRowKey(CompoundKey) to remove unnecessary CompoundKeys.
Please make sure you will check the getRowFields() and getColumnFields() first to construct correct
CompoundKeys. Otherwise, the behavior might be very odd.
// assume the first column field is year, the second is quarter and the third is month.
for (int year = 1993; year <= 1997; year++) {
for (int quarter = 0; quarter <= 3; quarter++) {
for (int month = quarter * 3; month <= quarter * 3 + 2; month++) {
addRowIndex(CompoundKey.newInstance(new Object[0]), CompoundKey.newInstance(new Object[]{year, quarter, month}), -1);
}
}
}
protected void removeRowKey(CompoundKey rowKey)
manageCompoundKeys() to remove some unnecessary row keys as you wish.
rowKey - the CompoundKeyprotected void removeColumnKey(CompoundKey columnKey)
manageCompoundKeys() to remove some unnecessary column keys as you wish.
columnKey - the CompoundKeypublic boolean isCalculating()
PivotValueProvider
isCalculating in interface PivotValueProviderprotected void updateFilters()
public boolean isCalculated()
calculate() is called on this pivot data model. There is no setter for this flag. Only calculate() will set it to true.
isCalculated in interface IPivotDataModelcalculate() is already called.
protected CompoundKey getCompoundKeyAt(int rowIndex,
int areaType)
rowIndex - the row index in the data source.areaType - AREA_ROW or AREA_COLUMN
public int getRowAt(int actualRow)
actualRow - the actual row index in the original table model
public int getColumnAt(int actualRow)
actualRow - the actual row index in the original table model
public void invalidateRowHeaderTableModel()
IPivotDataModel
invalidateRowHeaderTableModel in interface IPivotDataModelpublic void invalidateColumnHeaderTableModel()
IPivotDataModel
invalidateColumnHeaderTableModel in interface IPivotDataModelpublic void invalidateCornerTableModel()
IPivotDataModel
invalidateCornerTableModel in interface IPivotDataModelpublic void invalidateDataTableModel()
IPivotDataModel
invalidateDataTableModel in interface IPivotDataModel@Deprecated public Object[] getPossibleValues(int columnIndex)
getPossibleValues(int, java.util.Comparator) instead. We didn't use this method anymore in our
code.
getPossibleValues in interface IPivotDataModelcolumnIndex - the column index.
public Object[] getPossibleValues(PivotField field)
PivotValueProvider
getPossibleValues in interface IPivotDataModelgetPossibleValues in interface PivotValueProviderfield - the pivot field
public Object[] getPossibleValues(int columnIndex,
Comparator comparator)
Field.isPreferSelectedPossibleValues() returns false, all values in Field.getFilteredPossibleValues() will also present in the return array.
getPossibleValues in interface IPivotDataModelcolumnIndex - the column indexcomparator - the comparator
public HeaderTableModel getRowHeaderTableModel()
getRowHeaderTableModel in interface IPivotDataModelprotected HeaderTableModel createRowHeaderTableModel(CompoundKey[] keys)
keys - the row keys.
public TableModel getCornerTableModel()
protected void initComponents() {
super.initComponents();
_cornerTable = new HeaderTable(this);
_cornerTable.setRowHeight(getRowHeight());
setCornerTableModel(_cornerTable, getPivotDataModel().getCornerTableModel());
_cornerTable.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
_cornerTable.setCellSelectionEnabled(true);
((JideTable) _cornerTable).setColumnResizable(true);
((JideTable) _cornerTable).setNonContiguousCellSelection(true);
}
getCornerTableModel in interface IPivotDataModelpublic HeaderTableModel getColumnHeaderTableModel()
getColumnHeaderTableModel in interface IPivotDataModelprotected HeaderTableModel createColumnHeaderTableModel(CompoundKey[] keys)
keys - the column keys.
public TableModel getDataTableModel()
getDataTableModel in interface IPivotDataModelprotected DataTableModel createDataTableModel()
public PivotField[] getRowFields()
calculate() is called. Otherwise, it will return null.
getRowFields in interface IPivotDataModelprotected int[] getFieldIndices(PivotField[] fields)
public int[] getRowFieldIndices()
calculate() is called. Otherwise, it
will return null.
getRowFieldIndices in interface IPivotDataModelpublic PivotField[] getColumnFields()
calculate() is called. Otherwise, it will return null.
getColumnFields in interface IPivotDataModelpublic int[] getColumnFieldIndices()
calculate() is called. Otherwise,
it will return null.
getColumnFieldIndices in interface IPivotDataModelpublic PivotField[] getDataFields()
calculate() is called. Otherwise, it will return null.
getDataFields in interface IPivotDataModelpublic void resetDataFields()
IPivotDataModel
resetDataFields in interface IPivotDataModelpublic int[] getDataFieldIndices()
calculate() is called. Otherwise, it
will return null.
getDataFieldIndices in interface IPivotDataModelpublic PivotField[] getFilterFields()
calculate() is called. Otherwise, it will return null.
getFilterFields in interface IPivotDataModelpublic int[] getFilterFieldIndices()
calculate() is called. Otherwise,
it will return null.
getFilterFieldIndices in interface IPivotDataModelpublic PivotField[] getUnassignedFields()
calculate() is called. Otherwise, it will return
null.
getUnassignedFields in interface IPivotDataModelpublic int[] getUnassignedFieldIndices()
calculate() is called.
Otherwise, it will return null.
getUnassignedFieldIndices in interface IPivotDataModel
public List<Integer> getDataAt(int rowIndex,
int columnIndex)
getDataAt in interface IPivotDataModelrowIndex - the row index relative to DataTableModel.columnIndex - the column index relative to DataTableModel.
getDataSource().
public List<Integer> getDataAt(CompoundKey rowKey,
CompoundKey columnKey)
getDataAt in interface IPivotDataModelrowKey - the row compound keycolumnKey - the column compound key
getDataSource().
protected CompoundKey[] sortCompoundKeys(CompoundKey[] keys,
PivotField[] fields)
keys - the list of CompoundKeys.fields - the array of the fields.
public boolean isRowDataFields()
isRowDataFields in interface IPivotDataModelpublic boolean isColumnDataFields()
isColumnDataFields in interface IPivotDataModelpublic boolean isAlwaysColumnDataFields()
isAlwaysColumnDataFields in interface IPivotDataModelpublic void setAlwaysColumnDataFields(boolean alwaysColumnDataFields)
setAlwaysColumnDataFields in interface IPivotDataModelalwaysColumnDataFields - true or false.public boolean isAlwaysRowDataFields()
isAlwaysRowDataFields in interface IPivotDataModelpublic void setAlwaysRowDataFields(boolean alwaysRowDataFields)
setAlwaysRowDataFields in interface IPivotDataModelalwaysRowDataFields - true or false.public boolean isHideSingleDataField()
isHideSingleDataField in interface IPivotDataModelpublic void setHideSingleDataField(boolean hideSingleDataField)
setHideSingleDataField in interface IPivotDataModelpublic boolean isShowGrandTotalForRow()
isShowGrandTotalForRow in interface IPivotDataModelpublic void setShowGrandTotalForRow(boolean showGrandTotalForRow)
PivotTablePane.rowHeaderUpdated() or
PivotTablePane.bothHeadersUpdated() if you also changed grandTotalForColumn.
setShowGrandTotalForRow in interface IPivotDataModelshowGrandTotalForRow - whether show grand total for row.public boolean isShowGrandTotalForColumn()
isShowGrandTotalForColumn in interface IPivotDataModelpublic void setShowGrandTotalForColumn(boolean showGrandTotalForColumn)
PivotTablePane.columnHeaderUpdated() or PivotTablePane.bothHeadersUpdated() if you also changed
grandTotalForRow.
setShowGrandTotalForColumn in interface IPivotDataModelshowGrandTotalForColumn - whether show grand total for column.public PivotCellStyleProvider getCellStyleProvider()
getCellStyleProvider in interface IPivotDataModelpublic void setCellStyleProvider(PivotCellStyleProvider cellStyleProvider)
setCellStyleProvider in interface IPivotDataModelcellStyleProvider - the cell style provider.public void setRowHeaderEditingProvider(PivotDataEditingProvider rowHeaderEditingProvider)
setRowHeaderEditingProvider in interface IPivotDataModelrowHeaderEditingProvider - the date editing provider.public PivotDataEditingProvider getRowHeaderEditingProvider()
getRowHeaderEditingProvider in interface IPivotDataModelpublic void setColumnHeaderEditingProvider(PivotDataEditingProvider columnHeaderEditingProvider)
setColumnHeaderEditingProvider in interface IPivotDataModelcolumnHeaderEditingProvider - the date editing provider.public PivotDataEditingProvider getColumnHeaderEditingProvider()
getColumnHeaderEditingProvider in interface IPivotDataModelpublic PivotDataEditingProvider getDataEditingProvider()
getDataEditingProvider in interface IPivotDataModelpublic void setDataEditingProvider(PivotDataEditingProvider dataEditingProvider)
setDataEditingProvider in interface IPivotDataModeldataEditingProvider - the date editing provider.public SummaryCalculator getSummaryCalculator()
getSummaryCalculator in interface IPivotDataModelpublic void setSummaryCalculator(SummaryCalculator summaryCalculator)
setSummaryCalculator in interface IPivotDataModelsummaryCalculator - the summary calculator.public SummaryCalculatorFactory getSummaryCalculatorFactory()
calculateStatistics(PivotField, int, int, int, Object[]) method is called from a non-EDT. On EDT, we will use
getSummaryCalculator() method to get the SummaryCalculator.
getSummaryCalculatorFactory in interface IPivotDataModelpublic void setSummaryCalculatorFactory(SummaryCalculatorFactory summaryCalculatorFactory)
getSummaryCalculator() method to get
the SummaryCalculator.
setSummaryCalculatorFactory in interface IPivotDataModelsummaryCalculatorFactory - the summary calculator factory.public boolean isDisplayGrandTotalFirstForRow()
IPivotDataModel
isDisplayGrandTotalFirstForRow in interface IPivotDataModelpublic void setDisplayGrandTotalFirstForRow(boolean displayGrandTotalFirstForRow)
IPivotDataModel
setDisplayGrandTotalFirstForRow in interface IPivotDataModeldisplayGrandTotalFirstForRow - true or false.public boolean isDisplayGrandTotalFirstForColumn()
IPivotDataModel
isDisplayGrandTotalFirstForColumn in interface IPivotDataModelpublic void setDisplayGrandTotalFirstForColumn(boolean displayGrandTotalFirstForColumn)
IPivotDataModel
setDisplayGrandTotalFirstForColumn in interface IPivotDataModeldisplayGrandTotalFirstForColumn - true or false.public boolean isDisplayGrandTotalFirst()
isDisplayGrandTotalFirst in interface IPivotDataModel@Deprecated public void setDisplayGrandTotalFirst(boolean displayGrandTotalFirst)
setDisplayGrandTotalFirstForRow(boolean) and setDisplayGrandTotalFirstForColumn(boolean)
setDisplayGrandTotalFirstForRow(boolean) and setDisplayGrandTotalFirstForColumn(boolean).
setDisplayGrandTotalFirst in interface IPivotDataModeldisplayGrandTotalFirst - true or false.public boolean isAutoUpdate()
isAutoUpdate in interface IPivotDataModelpublic void setAutoUpdate(boolean autoUpdate)
calculate() method when the underlying table model data changes. However because the data
inside pivot table is very complex, right now autoUpdate will only update correctly if the table model data
change is cellUpdated event and rowUpdated event. If you add/remove rows or columns, you still have to call
calculate() just like before.
setAutoUpdate in interface IPivotDataModelautoUpdate - true or false.public boolean isAdjusting()
PivotField.setSelectedPossibleValues(Object[]).
By default, isAdjusting is false, so setSelectedPossibleValues will call calculate() and bothHeaderUpdated(). If
isAdjusting is true, they will be not be called.
isAdjusting in interface IPivotDataModelpublic void setAdjusting(boolean adjusting)
setAdjusting in interface IPivotDataModeladjusting - true or false.public boolean isSummaryMode()
isSummaryMode in interface IPivotDataModelisSummaryMode in interface PivotValueProviderpublic void setSummaryMode(boolean summaryMode)
setSummaryMode in interface IPivotDataModelsetSummaryMode in interface PivotValueProvidersummaryMode - true to set to summary mode. Otherwise false.isSummaryMode()public boolean isAggregateMode()
AggregateTableModel to show the actual cell values for the matched keys. By default, the
actual values will not be displayed. Typically you should setSummaryMode(false).
Default is false.
isAggregateMode in interface IPivotDataModelpublic boolean isSingleValueMode()
isSingleValueMode in interface IPivotDataModelisSingleValueMode in interface PivotValueProviderpublic void setSingleValueMode(boolean singleValueMode)
setSingleValueMode in interface IPivotDataModelsetSingleValueMode in interface PivotValueProvidersingleValueMode - true or false.public boolean verify()
verify in interface IPivotDataModelpublic int getRowHeaderRowIndexAt(int rowIndex)
getRowHeaderRowIndexAt in interface IPivotDataModelrowIndex - the row at the original table model.
public int getColumnHeaderColumnIndexAt(int rowIndex)
getColumnHeaderColumnIndexAt in interface IPivotDataModelrowIndex - the row at the original table model.
public static boolean isValueImmutable()
public static void setValueImmutable(boolean valueImmutable)
valueImmutable - true or false.public static boolean isUseComparable()
public static void setUseComparable(boolean useComparable)
useComparable - true or false.public boolean isHideSummaryValues()
isHideSummaryValues in interface IPivotDataModelpublic void setHideSummaryValues(boolean hideSummaryValues)
setHideSummaryValues in interface IPivotDataModelhideSummaryValues - the flagisHideSummaryValues()public boolean isKeepRowChildrenOnSummaryFilter()
IPivotDataModelPivotField.isDataFieldFilterOnSummary()
isKeepRowChildrenOnSummaryFilter in interface IPivotDataModelpublic void setKeepRowChildrenOnSummaryFilter(boolean keepRowChildrenOnSummaryFilter)
IPivotDataModel
setKeepRowChildrenOnSummaryFilter in interface IPivotDataModelkeepRowChildrenOnSummaryFilter - the flagpublic boolean isHideExpandIconOnSingleRow()
setHideExpandIconOnSingleRow(boolean)public void setHideExpandIconOnSingleRow(boolean hideExpandIconOnSingleRow)
hideExpandIconOnSingleRow - the flagpublic boolean isLayoutDataFieldsFirst()
isLayoutDataFieldsFirst in interface IPivotDataModelsetLayoutDataFieldsFirst(boolean)public void setLayoutDataFieldsFirst(boolean layoutDataFieldsFirst)
setLayoutDataFieldsFirst in interface IPivotDataModellayoutDataFieldsFirst - the flagpublic boolean isHighPerformanceMode()
IPivotDataModel
isHighPerformanceMode in interface IPivotDataModelIPivotDataModel.setHighPerformanceMode(boolean)public void setHighPerformanceMode(boolean highPerformanceMode)
IPivotDataModel
setHighPerformanceMode in interface IPivotDataModelhighPerformanceMode - the flagpublic PivotDataModel.RowMerger getRowMerger()
PivotDataModel.RowMergerpublic void setRowMerger(PivotDataModel.RowMerger rowMerger)
rowMerger - a new RowMergerPivotDataModel.RowMergerpublic boolean isAutoSortKeys()
public void setAutoSortKeys(boolean autoSortKeys)
autoSortKeys - true or false.
public int getStatisticsType(Values rowValues,
Values columnValues,
PivotField dataField)
PivotValueProviderPivotConstants.STATISTICS_CALCULATION_DEFAULT.
So that the PivotValueProvider itself will conduct the statistics. However, for running percentage or daily average,
you probably need return other values so that CalculatedPivotDataModel would calculate
the summary itself.
getStatisticsType in interface PivotValueProviderrowValues - the row valuescolumnValues - the column valuesdataField - the data field
protected Object calculateStatistics(PivotField field,
Values rowValues,
Values columnValues,
int summaryType,
Object[] objects)
field - the data fieldrowValues - the row valuescolumnValues - the column valuessummaryType - the summary typeobjects - the base values
@Deprecated
protected Object calculateStatistics(PivotField field,
int rowIndex,
int columnIndex,
int summaryType,
Object[] objects)
calculateStatistics(PivotField, Values, Values, int, Object[])
field - the data fieldrowIndex - the row index in the data tablecolumnIndex - the column index in the data tablesummaryType - the summary typeobjects - the base values
protected Object[] collectValuesForCell(PivotField field,
Values rowKeys,
Values columnKeys,
int summaryType)
protected Object[] collectValuesForCell(PivotField field,
int rowIndex,
int columnIndex,
int summaryType)
public Object getValueAt(PivotField field,
Values rowKeys,
Values columnKeys)
IPivotDataModel
getValueAt in interface IPivotDataModelgetValueAt in interface PivotValueProviderfield - the data fieldrowKeys - row value keys in the corresponding row header tablecolumnKeys - column value keys in the corresponding column header table
protected boolean shouldCalculateSummary(int rowIndex,
int columnIndex)
rowIndex - the row index of the cellcolumnIndex - the column index of the cell
public boolean isValuesVisible(Values values)
isValuesVisible in interface IPivotDataModelvalues - the Values.
public void addHiddenValues(Values values)
addHiddenValues(new DefaultValues(new Object[]{1994, 2, 6});
addHiddenValues in interface IPivotDataModelvalues - the Values.public void removeHiddenValues(Values values)
removeHiddenValues in interface IPivotDataModelvalues - the Values.public void clearHiddenValues()
clearHiddenValues in interface IPivotDataModelpublic boolean hasHiddenValues()
hasHiddenValues in interface IPivotDataModelpublic Values[] getHiddenValues()
getHiddenValues in interface IPivotDataModel
public boolean isColumnVisible(Values values,
PivotField field)
IPivotDataModel
isColumnVisible in interface IPivotDataModelvalues - the Valuesfield - the data field
public void addHiddenColumn(Values values,
PivotField field)
IPivotDataModelIPivotDataModel.addHiddenColumn(Values, PivotField, String) with the string as "15\t75\t75"
addHiddenColumn in interface IPivotDataModelvalues - the Valuesfield - the data field
public void addHiddenColumn(Values values,
PivotField dataField,
String width)
IPivotDataModel
addHiddenColumn in interface IPivotDataModelvalues - the ValuesdataField - the data fieldwidth - the width information before the column is hidden
public String removeHiddenColumn(Values values,
PivotField field)
IPivotDataModel
removeHiddenColumn in interface IPivotDataModelvalues - the Valuesfield - the data field
public void clearHiddenColumns()
IPivotDataModel
clearHiddenColumns in interface IPivotDataModelpublic boolean hasHiddenColumns()
IPivotDataModel
hasHiddenColumns in interface IPivotDataModelpublic Object[][] getHiddenColumns()
IPivotDataModel
getHiddenColumns in interface IPivotDataModelpublic boolean isAllowEmptyColumnHeader()
isAllowEmptyColumnHeader in interface IPivotDataModelpublic void setAllowEmptyColumnHeader(boolean allowEmptyColumnHeader)
setAllowEmptyColumnHeader in interface IPivotDataModelallowEmptyColumnHeader - true or false.public boolean isAllowEmptyRowHeader()
isAllowEmptyRowHeader in interface IPivotDataModelpublic void setAllowEmptyRowHeader(boolean allowEmptyRowHeader)
setAllowEmptyRowHeader in interface IPivotDataModelallowEmptyRowHeader - true or false.public boolean isExpandByDefault()
isExpandByDefault in interface IPivotDataModelpublic void setExpandByDefault(boolean expandByDefault)
setExpandByDefault in interface IPivotDataModelexpandByDefault - true or false.public boolean isShowSubtotalAsChild()
IPivotDataModel
isShowSubtotalAsChild in interface IPivotDataModelIPivotDataModel.setShowSubtotalAsChild(boolean)public void setShowSubtotalAsChild(boolean showSubtotalAsChild)
setShowSubtotalAsChild in interface IPivotDataModelshowSubtotalAsChild - true or false.public boolean isHideRedundantSubtotal()
isHideRedundantSubtotal in interface IPivotDataModelpublic void setHideRedundantSubtotal(boolean hideRedundantSubtotal)
setHideRedundantSubtotal in interface IPivotDataModelhideRedundantSubtotal - true or false.isHideRedundantSubtotal()public void addPivotValueProviderListener(PivotValueProviderListener l)
PivotValueProvider
addPivotValueProviderListener in interface PivotValueProviderl - the listenerpublic void removePivotValueProviderListener(PivotValueProviderListener l)
PivotValueProvider
removePivotValueProviderListener in interface PivotValueProviderl - the listenerpublic PivotValueProviderListener[] getPivotValueProviderListeners()
public void firePivotValueProviderChanged(int type)
public void firePivotValueProviderChanged(int type,
Object object)
public CompoundKey[] getRowKeys()
PivotValueProvider
getRowKeys in interface PivotValueProviderpublic CompoundKey[] getColumnKeys()
PivotValueProvider
getColumnKeys in interface PivotValueProviderpublic boolean isSummaryLayer()
IPivotDataModel
isSummaryLayer in interface IPivotDataModelpublic void setSummaryLayer(boolean summaryLayer)
IPivotDataModel
setSummaryLayer in interface IPivotDataModelsummaryLayer - the flag
protected void firePropertyChange(String propertyName,
Object oldValue,
Object newValue)
propertyName - the property whose value has changedoldValue - the property's previous valuenewValue - the property's new valuepublic void addPropertyChangeListener(PropertyChangeListener listener)
listener is null, no exception is thrown and no action is performed.
listener - the property change listener to be addedremovePropertyChangeListener(java.beans.PropertyChangeListener)public void removePropertyChangeListener(PropertyChangeListener listener)
listener - the PropertyChangeListener to be removedaddPropertyChangeListener(java.beans.PropertyChangeListener)public boolean isComputeAffectedCellOnUpdate()
isAutoUpdate(),
setComputeAffectedCellOnUpdate(boolean)public void setComputeAffectedCellOnUpdate(boolean computeAffectedCellOnUpdate)
computeAffectedCellOnUpdate - the flag
|
JIDE 3.5.15 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||