|
JIDE 3.5.15 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IPivotDataModel
This is an interface for PivotDataModel. We have a default implementation, which is PivotDataModel
. However, with this interface, you can create your own PivotDataModel if you
want.
Field Summary |
---|
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 field,
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 |
calculate()
Calculates the pivot data. |
void |
clearHiddenColumns()
Clears the hidden columns. |
void |
clearHiddenValues()
Clears the hidden values. |
PivotCellStyleProvider |
getCellStyleProvider()
Gets the PivotCellStyleProvider. |
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. |
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. |
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. |
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)
|
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. |
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. |
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. |
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()
Gets the flag indicating if it's used by AggregateTable. |
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 |
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 |
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 |
isDisplayGrandTotalFirst()
Deprecated. replaced by isDisplayGrandTotalFirstForRow() and isDisplayGrandTotalFirstForColumn() |
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 |
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. |
boolean |
isValuesVisible(Values values)
Checks if the Values is visible. |
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 |
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 |
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 |
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 |
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 filterRowSummaryValues)
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 |
setRowHeaderEditingProvider(PivotDataEditingProvider rowHeaderEditingProvider)
Sets the PivotDataEditingProvider that is used for the row header table. |
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. |
void |
updateFields()
|
boolean |
verify()
This method is for debugging purpose, not a public API. |
Method Detail |
---|
void setDataSource(PivotDataSource dataSource)
dataSource
- the new data source.PivotDataSource getDataSource()
PivotField getField(String name)
name
- the field name
PivotField getField(int index)
index
- the field index
PivotField[] getFields()
void initialize()
calculate()
. If only the data is changed, just calculate()
is enough.
void updateFields()
void calculate()
PivotTablePane.fieldsUpdated()
method in order for the change to take effect.
boolean isCalculated()
calculate()
is called on this pivot data model. There is no setter for this flag. Only calculate()
will set it to true.
calculate()
is already called.@Deprecated Object[] getPossibleValues(int columnIndex)
getPossibleValues(int, java.util.Comparator)
instead. We didn't use this method anymore in our
code.
columnIndex
- the column index.
Object[] getPossibleValues(int columnIndex, Comparator comparator)
columnIndex
- the column indexcomparator
- the comparator
Object[] getPossibleValues(PivotField field)
HeaderTableModel getRowHeaderTableModel()
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);
}
HeaderTableModel getColumnHeaderTableModel()
TableModel getDataTableModel()
Object getValueAt(PivotField field, Values rowKeys, Values columnKeys)
field
- the data fieldrowKeys
- row value keys in the corresponding row header tablecolumnKeys
- column value keys in the corresponding column header table
PivotField[] getRowFields()
calculate()
is called. Otherwise, it will return null.
int[] getRowFieldIndices()
calculate()
is called. Otherwise, it
will return null.
PivotField[] getColumnFields()
calculate()
is called. Otherwise, it will return null.
int[] getColumnFieldIndices()
calculate()
is called. Otherwise,
it will return null.
PivotField[] getDataFields()
calculate()
or resetDataFields()
is called.
Otherwise, it will return null.
void resetDataFields()
int[] getDataFieldIndices()
calculate()
is called. Otherwise, it
will return null.
PivotField[] getFilterFields()
calculate()
is called. Otherwise, it will return null.
int[] getFilterFieldIndices()
calculate()
is called. Otherwise,
it will return null.
PivotField[] getUnassignedFields()
calculate()
is called. Otherwise, it will return
null.
int[] getUnassignedFieldIndices()
calculate()
is called.
Otherwise, it will return null.
List<Integer> getDataAt(int rowIndex, int columnIndex)
rowIndex
- the row index relative to DataTableModel.columnIndex
- the column index relative to DataTableModel.
getDataSource()
.List<Integer> getDataAt(CompoundKey rowKey, CompoundKey columnKey)
rowKey
- the row compound keycolumnKey
- the column compound key
getDataSource()
.boolean isRowDataFields()
boolean isColumnDataFields()
boolean isAlwaysColumnDataFields()
void setAlwaysColumnDataFields(boolean alwaysColumnDataFields)
alwaysColumnDataFields
- true or false.boolean isAlwaysRowDataFields()
void setAlwaysRowDataFields(boolean alwaysRowDataFields)
alwaysRowDataFields
- true or false.boolean isHideSingleDataField()
void setHideSingleDataField(boolean hideSingleDataField)
boolean isAllowEmptyColumnHeader()
void setAllowEmptyColumnHeader(boolean allowEmptyColumnHeader)
allowEmptyColumnHeader
- true or false.boolean isAllowEmptyRowHeader()
void setAllowEmptyRowHeader(boolean allowEmptyRowHeader)
allowEmptyRowHeader
- true or false.boolean isShowGrandTotalForRow()
void setShowGrandTotalForRow(boolean showGrandTotalForRow)
PivotTablePane.rowHeaderUpdated()
or
PivotTablePane.bothHeadersUpdated()
if you also changed grandTotalForColumn.
showGrandTotalForRow
- whether show grand total for row.boolean isShowGrandTotalForColumn()
void setShowGrandTotalForColumn(boolean showGrandTotalForColumn)
PivotTablePane.columnHeaderUpdated()
or PivotTablePane.bothHeadersUpdated()
if you also changed
grandTotalForRow.
showGrandTotalForColumn
- whether show grand total for column.PivotCellStyleProvider getCellStyleProvider()
void setCellStyleProvider(PivotCellStyleProvider cellStyleProvider)
cellStyleProvider
- the cell style provider.void setRowHeaderEditingProvider(PivotDataEditingProvider rowHeaderEditingProvider)
rowHeaderEditingProvider
- the date editing provider.PivotDataEditingProvider getRowHeaderEditingProvider()
void setColumnHeaderEditingProvider(PivotDataEditingProvider columnHeaderEditingProvider)
columnHeaderEditingProvider
- the date editing provider.PivotDataEditingProvider getColumnHeaderEditingProvider()
PivotDataEditingProvider getDataEditingProvider()
void setDataEditingProvider(PivotDataEditingProvider dataEditingProvider)
dataEditingProvider
- the date editing provider.SummaryCalculator getSummaryCalculator()
void setSummaryCalculator(SummaryCalculator summaryCalculator)
summaryCalculator
- the summary calculator.SummaryCalculatorFactory getSummaryCalculatorFactory()
void setSummaryCalculatorFactory(SummaryCalculatorFactory summaryCalculatorFactory)
summaryCalculatorFactory
- the summary calculator factory.boolean isDisplayGrandTotalFirstForRow()
void setDisplayGrandTotalFirstForRow(boolean displayGrandTotalFirstForRow)
displayGrandTotalFirstForRow
- true or false.boolean isDisplayGrandTotalFirstForColumn()
void setDisplayGrandTotalFirstForColumn(boolean displayGrandTotalFirstForColumn)
displayGrandTotalFirstForColumn
- true or false.@Deprecated boolean isDisplayGrandTotalFirst()
isDisplayGrandTotalFirstForRow()
and isDisplayGrandTotalFirstForColumn()
@Deprecated void setDisplayGrandTotalFirst(boolean displayGrandTotalFirst)
setDisplayGrandTotalFirstForRow(boolean)
and setDisplayGrandTotalFirstForColumn(boolean)
displayGrandTotalFirst
- true or false.boolean isAutoUpdate()
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.
autoUpdate
- true or false.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.
void setAdjusting(boolean adjusting)
adjusting
- true or false.boolean isSummaryMode()
void setSummaryMode(boolean summaryMode)
summaryMode
- true to set to summary mode. Otherwise false.isSummaryMode()
boolean isSingleValueMode()
void setSingleValueMode(boolean singleValueMode)
singleValueMode
- true or false.int getRowHeaderRowIndexAt(int rowIndex)
rowIndex
- the row at the original table model.
int getColumnHeaderColumnIndexAt(int rowIndex)
rowIndex
- the row at the original table model.
boolean isHideSummaryValues()
void setHideSummaryValues(boolean hideSummaryValues)
hideSummaryValues
- the flagisHideSummaryValues()
boolean isValuesVisible(Values values)
values
- the Values.
void addHiddenValues(Values values)
addHiddenValues(new DefaultValues(new Object[]{1994, 2, 6});
values
- the Values.void removeHiddenValues(Values values)
values
- the Values.void clearHiddenValues()
boolean hasHiddenValues()
Values[] getHiddenValues()
boolean isColumnVisible(Values values, PivotField field)
values
- the Valuesfield
- the data field
void addHiddenColumn(Values values, PivotField field)
addHiddenColumn(Values, PivotField, String)
with the string as "15\t75\t75"
values
- the Valuesfield
- the data fieldvoid addHiddenColumn(Values values, PivotField field, String width)
values
- the Valuesfield
- the data fieldwidth
- the width information before the column is hiddenString removeHiddenColumn(Values values, PivotField field)
values
- the Valuesfield
- the data field
void clearHiddenColumns()
boolean hasHiddenColumns()
Object[][] getHiddenColumns()
void invalidateCornerTableModel()
void invalidateDataTableModel()
void invalidateRowHeaderTableModel()
void invalidateColumnHeaderTableModel()
boolean isExpandByDefault()
void setExpandByDefault(boolean expandByDefault)
expandByDefault
- true or false.boolean isShowSubtotalAsChild()
setShowSubtotalAsChild(boolean)
void setShowSubtotalAsChild(boolean showSubtotalAsChild)
showSubtotalAsChild
- true or false.boolean isHideRedundantSubtotal()
void setHideRedundantSubtotal(boolean hideRedundantSubtotal)
hideRedundantSubtotal
- the flagisHideRedundantSubtotal()
boolean verify()
boolean isKeepRowChildrenOnSummaryFilter()
PivotField.isDataFieldFilterOnSummary()
void setKeepRowChildrenOnSummaryFilter(boolean filterRowSummaryValues)
filterRowSummaryValues
- the flagboolean isAggregateMode()
boolean isSummaryLayer()
void setSummaryLayer(boolean summaryLayer)
summaryLayer
- the flagboolean isLayoutDataFieldsFirst()
setLayoutDataFieldsFirst(boolean)
void setLayoutDataFieldsFirst(boolean layoutDataFieldsFirst)
layoutDataFieldsFirst
- the flagboolean isHighPerformanceMode()
setHighPerformanceMode(boolean)
void setHighPerformanceMode(boolean highPerformanceMode)
highPerformanceMode
- the flag
|
JIDE 3.5.15 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |