|
JIDE 3.5.15 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.jidesoft.grid.Field com.jidesoft.pivot.PivotField
public class PivotField
PivotField represents a field in Pivot Table. Those fields can be row fields, column fields, data fields or filter fields.
Field Summary | |
---|---|
static int |
LOCATION_AFTER
|
static int |
LOCATION_BEFORE
|
static String |
PROPERTY_AREA_INDEX
|
static String |
PROPERTY_AREA_TYPE
|
static String |
PROPERTY_CUSTOM_SUBTOTALS
|
static String |
PROPERTY_FILTER_ON_SUMMARY
|
static String |
PROPERTY_GRAND_TOTAL_SUMMARY_TYPE
|
static String |
PROPERTY_RUNNING_SUMMARY_LIST
|
static String |
PROPERTY_SORT_BY
|
static String |
PROPERTY_SUBTOTAL_LOCATION
|
static String |
PROPERTY_SUBTOTAL_TYPE
|
static String |
PROPERTY_SUMMARY_TYPE
|
Constructor Summary | |
---|---|
PivotField()
Default constructor. |
|
PivotField(PivotDataSource dataSource,
int modelIndex)
Creates the PivotField. |
|
PivotField(TableModel tableModel,
int modelIndex)
Creates the PivotField. |
Method Summary | |
---|---|
protected Object |
clone()
|
int |
compareTo(PivotField o)
|
int |
getAreaIndex()
Gets the index in its area. |
int |
getAreaType()
Gets the area type. |
int[] |
getCustomSubtotals()
Gets the custom subtotals. |
int[] |
getCustomSubtotalsForColumn()
Gets the custom subtotals for row fields. |
int[] |
getCustomSubtotalsForRow()
Gets the custom subtotals for row fields. |
Summary |
getCustomSummary()
|
int |
getGrandTotalSummaryType()
Gets the summary type for the grand total. |
List<RunningSummary> |
getRunningSummaryList()
Get the running summary list. |
Values |
getSortByColumnKeys()
Gets the sort-by column key. |
int |
getSortByDataFieldModelIndex()
Gets the sort-by data field index. |
int |
getSortBySummaryType()
Gets the summary type of the sort-by. |
int |
getStatisticsCalculationType()
Gets the statistics calculation type. |
int |
getSubtotalLocation()
Gets the subtotal display location. |
int |
getSubtotalType()
Gets the subtotal type. |
int |
getSubtotalTypeForColumn()
Gets the subtotal type for row fields. |
int |
getSubtotalTypeForRow()
Gets the subtotal type for row fields. |
Class<?> |
getSummaryClass(int type)
Gets the summary class. |
int |
getSummaryType()
Gets the summary type. |
boolean |
isAllowedAsColumnField()
|
boolean |
isAllowedAsDataField()
|
boolean |
isAllowedAsField(int areaType)
|
boolean |
isAllowedAsFilterField()
|
boolean |
isAllowedAsRowField()
|
boolean |
isAllowedAsUnassignedField()
|
boolean |
isDataFieldFilterOnSummary()
|
boolean |
isHideOriginalData()
Get the flag indicating if the original calculated data columns should be hidden if there is any running summary. |
boolean |
isNumericType()
Checks if the type of the PivotField is numeric type. |
boolean |
isSeparateSubtotalSettings()
Checks if the subtotal settings are separately for row fields and column fields. |
boolean |
isSortByAscending()
Gets the sort order of the sort-by. |
void |
setAllowedAsColumnField(boolean allowedAsColumnField)
|
void |
setAllowedAsDataField(boolean allowedAsDataField)
|
void |
setAllowedAsFilterField(boolean allowedAsFilterField)
|
void |
setAllowedAsRowField(boolean allowedAsRowField)
|
void |
setAllowedAsUnassignedField(boolean allowedAsUnassignedField)
|
void |
setAreaIndex(int areaIndex)
Sets the index in its area. |
void |
setAreaType(int areaType)
Sets the area type. |
void |
setCustomSubtotals(int[] customSubtotals)
Sets the custom subtotals. |
void |
setCustomSubtotalsForColumn(int[] customSubtotalsForColumn)
Sets the custom subtotals. |
void |
setCustomSubtotalsForRow(int[] customSubtotalsForRow)
Sets the custom subtotals. |
void |
setCustomSummary(Summary customSummary)
|
void |
setDataFieldFilterOnSummary(boolean dataFieldFilterOnSummary)
|
void |
setFilteredPossibleValues(Object[] filteredPossibleValues)
Sets the filtered possible values for this field. |
void |
setGrandTotalSummaryType(int grandTotalSummaryType)
Sets the summary type for the grand total. |
void |
setHideOriginalData(boolean hideOriginalData)
Set the flag indicating if the original calculated data columns should be hidden if there is any running summary. |
void |
setRunningSummaryList(List<RunningSummary> runningSummaryList)
Set the running summary list. |
void |
setSelectedPossibleValues(Object[] selectedPossibleValues)
Sets the selected possible values for this field. |
void |
setSeparateSubtotalSettings(boolean separateSubtotalSettings)
Sets the flag of separateSubtotalSettings. |
void |
setSortByAscending(boolean sortByAscending)
Sets the sort order of the sort-by. |
void |
setSortByColumnKeys(Values sortByColumnKeys)
Sets the sort-by column key. |
void |
setSortByDataFieldModelIndex(int sortByDataFieldModelIndex)
Sets the sort-by data field index. |
void |
setSortBySummaryType(int sortBySummaryType)
Sets the summary type of the sort-by. |
void |
setSortOrder(int sortOrder)
Sets the sort order. |
void |
setStatisticsCalculationType(int statisticsCalculationType)
Sets the statistics calculation type. |
void |
setSubtotalLocation(int subtotalLocation)
Sets the subtotal display location. |
void |
setSubtotalType(int subtotalType)
Sets the subtotal types. |
void |
setSubtotalTypeForColumn(int subtotalTypeForColumn)
Sets the subtotal types for column fields. |
void |
setSubtotalTypeForRow(int subtotalTypeForRow)
Sets the subtotal types for row fields. |
void |
setSummaryType(int summaryType)
Sets the summary type. |
void |
setTitle(String title)
|
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int LOCATION_AFTER
public static final int LOCATION_BEFORE
public static final String PROPERTY_SUMMARY_TYPE
public static final String PROPERTY_GRAND_TOTAL_SUMMARY_TYPE
public static final String PROPERTY_SUBTOTAL_TYPE
public static final String PROPERTY_SUBTOTAL_LOCATION
public static final String PROPERTY_CUSTOM_SUBTOTALS
public static final String PROPERTY_AREA_TYPE
public static final String PROPERTY_AREA_INDEX
public static final String PROPERTY_SORT_BY
public static final String PROPERTY_FILTER_ON_SUMMARY
public static final String PROPERTY_RUNNING_SUMMARY_LIST
Constructor Detail |
---|
public PivotField()
public PivotField(TableModel tableModel, int modelIndex)
tableModel
- the table model.modelIndex
- the model index.public PivotField(PivotDataSource dataSource, int modelIndex)
dataSource
- the data sourcemodelIndex
- the model index.Method Detail |
---|
public int getAreaType()
PivotConstants.AREA_ROW
, PivotConstants.AREA_COLUMN
, PivotConstants.AREA_DATA
,
PivotConstants.AREA_FILTER
and PivotConstants.AREA_NOT_ASSIGNED
.
public boolean isNumericType()
public void setAreaType(int areaType)
PivotConstants.AREA_ROW
, PivotConstants.AREA_COLUMN
, PivotConstants.AREA_DATA
,
PivotConstants.AREA_FILTER
and PivotConstants.AREA_NOT_ASSIGNED
.
This is a bounded property. Property change event will be fired if the name is changed.
areaType
- the area type.public int getAreaIndex()
public void setAreaIndex(int areaIndex)
areaIndex
- the area index.public int compareTo(PivotField o)
compareTo
in interface Comparable<PivotField>
public Summary getCustomSummary()
public void setCustomSummary(Summary customSummary)
public int getSummaryType()
public void setSummaryType(int summaryType)
PivotConstants
starting with "SUMMARY_".
summaryType
- the new summary type.public int getGrandTotalSummaryType()
public void setGrandTotalSummaryType(int grandTotalSummaryType)
PivotConstants
starting with "SUMMARY_".
grandTotalSummaryType
- the new summary type for the grand total.public int getSubtotalType()
PivotConstants.SUBTOTAL_NONE
, PivotConstants.SUBTOTAL_AUTOMATIC
and PivotConstants.SUBTOTAL_CUSTOM
. If it is PivotConstants.SUBTOTAL_CUSTOM
, the actual subtotal types are defined
in getCustomSubtotals()
.
This is a bounded property. Property change event will be fired if the name is changed.
public void setSubtotalType(int subtotalType)
#setSeparateSubtotalSettings(false)
.
The valid values are PivotConstants.SUBTOTAL_NONE
, PivotConstants.SUBTOTAL_AUTOMATIC
and PivotConstants.SUBTOTAL_CUSTOM
. If you set it as PivotConstants.SUBTOTAL_CUSTOM
, you also need to define the
actual subtotal types using setCustomSubtotals(int[])
.
This is a bounded property. Property change event will be fired if the name is changed.
subtotalType
- the subtotal type.public int getSubtotalLocation()
LOCATION_AFTER
so that the subtotal is
displayed after the actual data that produces the subtotal. Or it could be be LOCATION_BEFORE
which is the opposite.
public void setSubtotalLocation(int subtotalLocation)
LOCATION_AFTER
and LOCATION_BEFORE
.
This is a bounded property. Property change event will be fired if the name is changed.
subtotalLocation
- the subtotal display locationpublic int[] getCustomSubtotals()
public void setCustomSubtotals(int[] customSubtotals)
customSubtotals
- the custom subtotals.public int getSubtotalTypeForRow()
isSeparateSubtotalSettings()
return true. If it returns false, this method will return the value of getSubtotalType()
.
The valid values are PivotConstants.SUBTOTAL_NONE
, PivotConstants.SUBTOTAL_AUTOMATIC
and PivotConstants.SUBTOTAL_CUSTOM
. If it is PivotConstants.SUBTOTAL_CUSTOM
, the actual subtotal types are defined
in getCustomSubtotals()
.
This is a bounded property. Property change event will be fired if the value is changed.
public void setSubtotalTypeForRow(int subtotalTypeForRow)
#setSeparateSubtotalSettings(true)
.
The valid values are PivotConstants.SUBTOTAL_NONE
, PivotConstants.SUBTOTAL_AUTOMATIC
and PivotConstants.SUBTOTAL_CUSTOM
. If you set it as PivotConstants.SUBTOTAL_CUSTOM
, you also need to define the
actual subtotal types using setCustomSubtotals(int[])
.
This is a bounded property. Property change event will be fired if the value is changed.
subtotalTypeForRow
- the subtotal type for rowpublic void setSeparateSubtotalSettings(boolean separateSubtotalSettings)
separateSubtotalSettings
- true or false.public boolean isSeparateSubtotalSettings()
public int[] getCustomSubtotalsForRow()
setCustomSubtotals(int[])
method, it will set for both row fields and column fields.
public void setCustomSubtotalsForRow(int[] customSubtotalsForRow)
customSubtotalsForRow
- the custom subtotals for the row.public int getSubtotalTypeForColumn()
isSeparateSubtotalSettings()
return true. If it returns false, this method will return the value of getSubtotalType()
.
The valid values are PivotConstants.SUBTOTAL_NONE
, PivotConstants.SUBTOTAL_AUTOMATIC
and PivotConstants.SUBTOTAL_CUSTOM
. If it is PivotConstants.SUBTOTAL_CUSTOM
, the actual subtotal types are defined
in getCustomSubtotals()
.
This is a bounded property. Property change event will be fired if the name is changed.
public void setSubtotalTypeForColumn(int subtotalTypeForColumn)
#setSeparateSubtotalSettings(true)
.
The valid values are PivotConstants.SUBTOTAL_NONE
, PivotConstants.SUBTOTAL_AUTOMATIC
and PivotConstants.SUBTOTAL_CUSTOM
. If you set it as PivotConstants.SUBTOTAL_CUSTOM
, you also need to define the
actual subtotal types using setCustomSubtotals(int[])
.
This is a bounded property. Property change event will be fired if the name is changed.
subtotalTypeForColumn
- the subtotal types for the column.public int[] getCustomSubtotalsForColumn()
setCustomSubtotals(int[])
method, it will set for both row fields and column fields.
public void setCustomSubtotalsForColumn(int[] customSubtotalsForColumn)
customSubtotalsForColumn
- the custom subtotals for the column.public Class<?> getSummaryClass(int type)
type
- the new summary type.
public void setSortOrder(int sortOrder)
Field
setSortOrder
in class Field
sortOrder
- the sort order. It can be Field.SORT_ORDER_ASCENDING
, Field.SORT_ORDER_DESCENDING
, or
Field.SORT_ORDER_UNSORTED
.public int getStatisticsCalculationType()
PivotConstants.STATISTICS_CALCULATION_DEFAULT
. It will accumulate the values from original table model and calculate
statistics on them. There is also a type called PivotConstants.STATISTICS_CALCULATION_RUNNING
. It will accumulate the
values from the cells as seen in the next level on the UI and calculate statistics on them. One more type called
PivotConstants.STATISTICS_CALCULATION_RUNNING_LEAF
is used to accumulate the values from the cells as seen in the leaf
level on the UI and calculate statistics on them.
For example, let's say we have two cells - one for the sales data in October, the other is for sales data in
November. In October, there are actual two transactions - one is $200, the other is $300. So the October cell
will display $500. There is only one transaction is November which is $400 so the November cell will display
$400. Now we want to calculate Max statistics on these two cells. If using PivotConstants.STATISTICS_CALCULATION_DEFAULT
, the Max will be $400 because that's the maximum sales in a single transaction
in October and November. However if we use STATISTICS_CALCULATION_RUNNING
, the Max will be $500 because
that's the maximum value of October cell and November cell.
Please be noted that this flag takes effect only if the CalculatedPivotDataModel
is in use.
public void setStatisticsCalculationType(int statisticsCalculationType)
statisticsCalculationType
- the statistics calculation type. It could be PivotConstants.STATISTICS_CALCULATION_DEFAULT
or PivotConstants.STATISTICS_CALCULATION_RUNNING
OR PivotConstants.STATISTICS_CALCULATION_RUNNING_LEAF
.public boolean isAllowedAsDataField()
public void setAllowedAsDataField(boolean allowedAsDataField)
public boolean isAllowedAsFilterField()
public void setAllowedAsFilterField(boolean allowedAsFilterField)
public boolean isAllowedAsRowField()
public void setAllowedAsRowField(boolean allowedAsRowField)
public boolean isAllowedAsColumnField()
public void setAllowedAsColumnField(boolean allowedAsColumnField)
public boolean isAllowedAsUnassignedField()
public void setAllowedAsUnassignedField(boolean allowedAsUnassignedField)
public boolean isAllowedAsField(int areaType)
public Values getSortByColumnKeys()
public void setSortByColumnKeys(Values sortByColumnKeys)
sortByColumnKeys
- the sort-by column keys.public int getSortByDataFieldModelIndex()
public void setSortByDataFieldModelIndex(int sortByDataFieldModelIndex)
sortByDataFieldModelIndex
- a new sort-by data field index.public boolean isSortByAscending()
public void setSortByAscending(boolean sortByAscending)
sortByAscending
- the sort order of the sort-bypublic int getSortBySummaryType()
public void setSortBySummaryType(int sortBySummaryType)
sortBySummaryType
- the summary type of the sort-by.public void setSelectedPossibleValues(Object[] selectedPossibleValues)
PivotDataModel.setAdjusting(boolean)
to
false if you want to disable the auto-update when you need to set selected possible values on several fields. If
so, remember to call calculate() and bothHeaderUpdated() after you finished the changes.
Please note, this method has a lower priority than Field.setFilter(com.jidesoft.filter.Filter)
method. In the
other word, if setFilter is called with a valid filter, the (Custom...) item will be selected in the drop down
list and the selected possible values will be ignored.
setSelectedPossibleValues
in class Field
selectedPossibleValues
- new selected possible values.public void setFilteredPossibleValues(Object[] filteredPossibleValues)
PivotDataModel.setAdjusting(boolean)
to
false if you want to disable the auto-update when you need to set filtered possible values on several fields. If
so, remember to call calculate() and bothHeaderUpdated() after you finished the changes.
Please note, this method has a lower priority than Field.setFilter(com.jidesoft.filter.Filter)
method. In the
other word, if setFilter is called with a valid filter, the (Custom...) item will be selected in the drop down
list and the filtered possible values will be ignored.
setFilteredPossibleValues
in class Field
filteredPossibleValues
- new deselected possible values.public boolean isDataFieldFilterOnSummary()
public void setDataFieldFilterOnSummary(boolean dataFieldFilterOnSummary)
public List<RunningSummary> getRunningSummaryList()
public void setRunningSummaryList(List<RunningSummary> runningSummaryList)
runningSummaryList
- the running summary listpublic boolean isHideOriginalData()
setRunningSummaryList(java.util.List)
public void setHideOriginalData(boolean hideOriginalData)
hideOriginalData
- the flagisHideOriginalData()
protected Object clone() throws CloneNotSupportedException
clone
in class Object
CloneNotSupportedException
public void setTitle(String title)
setTitle
in class Field
|
JIDE 3.5.15 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |