|
JIDE 3.5.15 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.awt.Component java.awt.Container javax.swing.JComponent javax.swing.JPanel com.jidesoft.pivot.PivotTablePane
public class PivotTablePane
PivotTablePane is the main component for JIDE Pivot Grid.
Nested Class Summary | |
---|---|
protected static class |
PivotTablePane.JideScrollPaneEx
|
static interface |
PivotTablePane.PopupMenuCustomizer
|
static interface |
PivotTablePane.TablePopupMenuCustomizer
|
Nested classes/interfaces inherited from class javax.swing.JPanel |
---|
JPanel.AccessibleJPanel |
Nested classes/interfaces inherited from class javax.swing.JComponent |
---|
JComponent.AccessibleJComponent |
Nested classes/interfaces inherited from class java.awt.Container |
---|
Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy |
Fields inherited from class javax.swing.JComponent |
---|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
Fields inherited from class java.awt.Component |
---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
PivotTablePane()
Create an empty PivotTablePane. |
|
PivotTablePane(IPivotDataModel dataModel)
Creates a PivotTablePane. |
Method Summary | |
---|---|
protected void |
addFieldBox(FieldBox fieldBox,
int areaType)
|
void |
addHiddenRowField(PivotField field)
Add hidden header field. |
void |
addHiddenValues(Values values)
Shows or hides the values based on the selection in the row header or column header. |
void |
autoResizeAllColumns()
Auto-resize all table's table column width so that all cell contents are visible. |
void |
autoResizeAllColumns(boolean visibleAreaOnly)
Auto-resize all table's table column width so that all cell contents are visible. |
void |
bothHeadersUpdated()
Calls this method to tell the pivot table that both row and column header need to be updated. |
void |
clearFilter(boolean isRowHeader,
int fromRow,
int toRow,
int fromColumn,
int toColumn)
clear current filters in the selected fields |
void |
clearHiddenRowFields()
Clear hidden header fields. |
void |
clearHiddenValues()
Shows all the hidden values. |
void |
columnFieldsUpdated()
Calls this method to tell the pivot table that the column fields are updated so pivot table pane needs to update so that user can see the changes in the UI. |
void |
columnHeaderUpdated()
Calls this method to tell the pivot table that the column header needs to be updated. |
protected void |
configureEnclosingScrollPaneForDataTable(JTable table)
Customizes the scroll pane for data table. |
String |
convertElementToString(Locale locale,
Object value,
Class<?> clazz,
ConverterContext context)
Converters the element to string and used in FieldBox. |
protected Container |
createContentPanel()
Creates the content panel that holds the pivot table and all the field areas. |
protected CustomFilterEditorDialog |
createCustomFilterEditorDialog(Container container,
String title,
CustomFilterEditor filterEditor)
Create the custom filter editor dialog. |
protected DataTable |
createDataTable()
Creates the table which is used for the data table. |
protected FieldArea |
createFieldArea(int areaType)
Creates FieldArea for different fields. |
protected FieldBox |
createFieldBox(PivotField field,
boolean sortArrowVisible,
boolean filterButtonVisible)
Creates the FieldBox. |
protected FieldBoxInputListener |
createFieldBoxInputListener()
Creates the FieldBoxInputListener. |
protected Container |
createFieldPanel()
Creates the panel holds the field chooser. |
protected ButtonPanel |
createFieldSettingsDialogButtonPanel(StandardDialog dialog)
Creates the button panel in field settings dialog. |
protected FieldSettingsPanel |
createFieldSettingsPanel()
Creates the field settings panel. |
protected HeaderTable |
createHeaderTable()
Creates the header table for row header and column header. |
protected JScrollPane |
createScrollPane()
Creates the scroll pane used by PivotTablePane. |
protected void |
customizeFieldBox(FieldBox box)
Customizes the FieldBox. |
protected void |
customizeFieldsPanel(Container panel)
|
protected void |
customizeScrollPane(JScrollPane scrollPane)
Customizes the scroll pane. |
void |
dataTableUpdated()
Calls this method to tell the pivot table that the data table needs to be repainted. |
void |
fieldsUpdated()
Calls this method to tell the pivot table that the fields are updated so pivot table pane needs to update so that user can see the changes in the UI. |
protected void |
fillUnassignedFieldArea(UnassignedFieldsArea fieldsArea,
List<FieldBox> boxes,
QuickFilterField filterField)
Fills the field boxes for the unassigned fields to the UnassignedFieldsArea. |
void |
filterSelectedHeaderValues(boolean isRowHeader,
boolean isFilterNotShow,
int fromRow,
int toRow,
int fromColumn,
int toColumn)
filter the selected header values or show only the selected header values |
protected int |
getAdjustedRowHeights()
Gets the number of row height each row will occupy. |
static String |
getAreaName(Locale locale,
int areaType)
|
JTable |
getColumnHeaderTable()
Gets the column header table. |
JTable |
getCornerTable()
Gets the corner table. |
JTable |
getDataTable()
Gets the data table. |
PivotTablePane.PopupMenuCustomizer |
getDataTablePopupMenuCustomizer()
Gets the popup menu customizer to customize the menu when user right click on the data table. |
Cursor |
getDragNoDropCursor()
Get the cursor to be displayed when the field is prohibited to be dropped into current area. |
Cursor |
getDragRemoveCursor()
Get the cursor to be displayed when the field is going to be removed from current area. |
protected String |
getDuplicatedTitle(PivotField field)
|
String |
getFieldAreaMessage(int areaType)
|
String |
getFieldAreaName(int areaType)
|
int |
getFieldAreaType(String name)
|
Container |
getFieldChooser()
Gets the unassigned field chooser. |
JPanel |
getFieldChooserComboBoxPanel()
Gets the panel for the add to combobox on FieldChooser. |
Icon |
getFilterIcon()
Gets the filter icon. |
Color |
getGridColor()
Gets the grid color that is used to paint the grid of the header tables and the data table. |
int |
getHeaderSelectionMode()
Get the flag indicating the selection mode while clicking on the header table. |
PivotTablePane.PopupMenuCustomizer |
getHeaderTablePopupMenuCustomizer()
Gets the popup menu customizer to customize the menu when user right click on the row or column header tables. |
PivotField[] |
getHiddenRowFields()
Get all hidden row fields. |
IPivotDataModel |
getPivotDataModel()
Gets the PivotDataModel. |
PivotTablePane.PopupMenuCustomizer |
getPopupMenuCustomizer()
Gets the popup menu customizer to customize the menu when user right click on the fields. |
String |
getResourceString(String key)
Gets the resource string used in PivotTablePane. |
int[] |
getRowFieldsWidth()
Gets the row field boxes' width as an int array. |
JTable |
getRowHeaderTable()
Gets the row header table. |
int |
getRowHeight()
|
JScrollPane |
getScrollPane()
Gets the scroll pane used by PivotTablePane. |
static int |
getSummaryCount()
|
static String |
getSummaryName(Locale locale,
int summaryType)
|
static Map<Integer,Integer>[] |
getTableColumnWidth(HeaderTable table)
|
String |
getVersion()
Gets an optional version string. |
int |
getVisibleRowCount()
Returns the preferred number of visible rows. |
void |
hideColumns(int[] columnIndices)
Hide the columns in DataTable. |
protected void |
hideFieldBox(FieldBox fieldBox)
Hides the field box. |
void |
hideValuesAt(boolean isRowHeader,
int rowIndex,
int columnIndex)
Hides the column or the row based on the row index and column index in the row header or column header. |
void |
indexChanged(IndexChangeEvent event)
Called whenever the model wrapper is going to have index changed. |
protected void |
initComponents()
Creates the child components. |
boolean |
isColumnAutoResizable()
Checks if the columns are auto-resizable. |
boolean |
isColumnFieldAreaVisible()
|
boolean |
isColumnFieldFilterable()
Checks if the column field filterable. |
boolean |
isColumnHidden(int columnIndex)
Check if the column in DataTable is hidden. |
boolean |
isConsiderRowFieldWidth()
Get the flag if it should consider row field width while auto resizing the row header table columns. |
boolean |
isDataFieldAreaVisible()
|
boolean |
isDataFieldFilterable()
Checks if the data field filterable. |
boolean |
isDataFieldsDuplicationEnabled()
Gets the flag indicating if the data fields could be duplicated. |
boolean |
isFieldChooserEnabled()
Checks if the field chooser panel is enabled. |
boolean |
isFieldChooserFilterFieldVisible()
Checks if the the quick filter field which is used to filter the field chooser is visible. |
boolean |
isFieldChooserVisible()
Checks if filter chooser area is visible. |
boolean |
isFilterFieldAreaVisible()
|
boolean |
isFiltering(boolean isRowHeader,
int fromRow,
int toRow,
int fromColumn,
int toColumn)
check if the selected field have some rows/columns filtered already |
boolean |
isFlatLayout()
Gets the flag indicating if the flat layout is in use. |
boolean |
isHideExpandIconOnSingleRow()
Get the flag indicating if the expand icon should be hidden if the row only contains one child. |
boolean |
isHideFieldOnDraggingOut()
Checks if the field box will be hidden when user drags it and drop outside the field areas. |
boolean |
isPlainHeaderTables()
Get the flag indicating the header table painting mode. |
boolean |
isRearrangable()
|
boolean |
isRespectFieldPreferredWidth()
Get the flag indicating if the column width will respect the preferred width defined in PivotField. |
boolean |
isRowFieldAreaVisible()
|
boolean |
isRowFieldFilterable()
Checks if the row field filterable. |
boolean |
isScrollSelectionToVisible()
Get the flag indicating if PivotTablePane should scroll the selection to visible while loading selections. |
boolean |
isSelectedHeaderFilterable(boolean isRowHeader,
int fromRow,
int toRow,
int fromColumn,
int toColumn)
|
boolean |
isShowFilterButtonsOnMouseOver()
Gets the flag indicating if the filter buttons in FieldBox should be displayed always or only when the mouse is over the button. |
boolean |
isShowFilterIcon()
Checks if the filter icon should be visible on the FieldBox when there is filter for a field. |
boolean |
isShrinkDataFieldArea()
If true, it will shrink the data field area so that it doesn't go wider than the row header table. |
void |
loadSelection(Object[] selectedKeyValues)
Restore the selection in the DataTable part of the PivotTablePane. |
void |
loadSelection(Object[] selectedKeyValues,
boolean scrollSelectionToVisible)
Restore the selection in the DataTable part of the PivotTablePane. |
void |
loadSelection(Object[] selectedKeyValues,
boolean scrollSelectionToVisible,
boolean selectParentNode)
Restore the selection in the DataTable part of the PivotTablePane. |
protected void |
moveFieldBox(FieldBox fieldBox,
boolean before)
Moves the field box |
protected void |
moveFieldBox(FieldBox fieldBox,
FieldBox destFieldBox,
boolean before)
|
protected void |
moveFieldBoxToBeginning(FieldBox fieldBox)
|
protected void |
moveFieldBoxToEnd(FieldBox fieldBox)
|
void |
paint(Graphics g)
|
void |
pivotValueProviderEventHandler(PivotValueProviderEvent event)
|
void |
propertyChange(PropertyChangeEvent evt)
|
void |
removeHiddenRowField(PivotField field)
Remove hidden header field. |
void |
removeHiddenValues(Values values)
Shows or hides the values based on the selection in the row header or column header. |
void |
rowFieldsUpdated()
Calls this method to tell the pivot table that the row fields are updated so pivot table pane needs to update so that user can see the changes in the UI. |
void |
rowHeaderUpdated()
Calls this method to tell the pivot table that the row header needs to be updated. |
Object[] |
saveSelection()
Save the selection of the DataTable part of the PivotTablePane as an array of Values. |
void |
selectDataCells(boolean isRowHeader,
int rowIndex,
int columnIndex)
Selects the data cells based on the selection in the row header or column header. |
protected void |
selectDataCells(boolean isRowHeader,
int rowIndex,
int columnIndex,
boolean toggle)
Selects the data cells based on the selection in the row header or column header. |
void |
selectDataCellsBetween(boolean isRowHeader,
int startRowIndex,
int startColumnIndex,
int endRowIndex,
int endColumnIndex)
Selects the data cells based on the selection in multiple row headers or column headers. |
protected void |
selectDataCellsBetween(boolean isRowHeader,
int startRowIndex,
int startColumnIndex,
int endRowIndex,
int endColumnIndex,
boolean toggle)
Selects the data cells based on the selection in multiple row headers or column headers. |
void |
selectFieldBox(FieldBox box)
|
void |
setColumnAutoResizable(boolean resizable)
Enable or disable the column auto-resizable. |
void |
setColumnFieldAreaVisible(boolean columnFieldAreaVisible)
|
void |
setColumnFieldFilterable(boolean columnFieldFilterable)
Sets the column field filterable flag. |
void |
setConsiderRowFieldWidth(boolean considerRowFieldWidth)
Set the flag if it should consider row field width while auto resizing the row header table columns. |
protected void |
setCornerTableModel(JTable table,
TableModel tableModel)
|
void |
setCursor(Cursor cursor)
|
void |
setDataFieldAreaVisible(boolean dataFieldAreaVisible)
|
void |
setDataFieldFilterable(boolean dataFieldFilterable)
Sets the data field filterable flag. |
void |
setDataFieldsDuplicationEnabled(boolean dataFieldsDuplicationEnabled)
Sets the flag indicating if the data fields could be duplicated. |
protected void |
setDataTableModel(JTable table,
TableModel tableModel)
Sets the data table model to the data table. |
void |
setDataTablePopupMenuCustomizer(PivotTablePane.PopupMenuCustomizer popupMenuCustomizer)
Sets the popup menu customizer to customize the menu when user right click on the data table. |
void |
setDragNoDropCursor(Cursor dragNoDropCursor)
Set the cursor to be displayed when the field is prohibited to be dropped into current area. |
void |
setDragRemoveCursor(Cursor dragRemoveCursor)
Set the cursor to be displayed when the field is going to be removed from current area. |
void |
setFieldChooserEnabled(boolean fieldChooserEnabled)
Sets whether the field chooser panel is enabled. |
void |
setFieldChooserFilterFieldVisible(boolean visible)
Shows or hides the quick filter field which is used to filter the field chooser. |
void |
setFieldChooserVisible(boolean fieldChooserAreaVisible)
Shows or hide the field chooser area. |
void |
setFilterFieldAreaVisible(boolean filterFieldAreaVisible)
|
void |
setFilterIcon(Icon filterIcon)
Sets the filter icon. |
void |
setFlatLayout(boolean flatLayout)
Sets the flag indicating if the flat layout is in use. |
void |
setGridColor(Color gridColor)
Sets the grid color that is used to paint the grid of the header tables and the data table. |
void |
setHeaderSelectionMode(int headerSelectionMode)
Set the flag indicating the selection mode while clicking on the header table. |
protected void |
setHeaderTableModel(JTable table,
TableModel tableModel)
Sets the header table model to header table. |
void |
setHeaderTablePopupMenuCustomizer(PivotTablePane.PopupMenuCustomizer popupMenuCustomizer)
Sets the popup menu customizer to customize the menu when user right click on the row or column header tables. |
void |
setHideExpandIconOnSingleRow(boolean hideExpandIconOnSingleRow)
Set the flag indicating if the expand icon should be hidden if the row only contains one child. |
void |
setHideFieldOnDraggingOut(boolean hideFieldOnDraggingOut)
Sets the flag if dragging a field box outside the field area will hide the field. |
protected void |
setKeepFieldAreaFit(boolean keepFieldAreaFit)
This is an internally used flag. |
void |
setLocale(Locale l)
|
void |
setPivotDataModel(IPivotDataModel dataModel)
Set the PivotDataModel. |
void |
setPlainHeaderTables(boolean plainHeaderTables)
Set the flag indicating the header table painting mode. |
void |
setPopupMenuCustomizer(PivotTablePane.PopupMenuCustomizer popupMenuCustomizer)
Sets the popup menu customizer to customize the menu when user right click on the fields. |
void |
setRearrangable(boolean rearrangable)
Sets the rearrangable flag. |
void |
setRespectFieldPreferredWidth(boolean respectFieldPreferredWidth)
Set the flag indicating if the column width will respect the preferred width defined in PivotField. |
void |
setRowFieldAreaVisible(boolean rowFieldAreaVisible)
|
void |
setRowFieldFilterable(boolean rowFieldFilterable)
Sets the row field filterable flag. |
void |
setRowHeight(int rowHeight)
|
void |
setScrollSelectionToVisible(boolean scrollSelectionToVisible)
Set the flag indicating if PivotTablePane should scroll the selection to visible while loading selections. |
void |
setShowFilterButtonsOnMouseOver(boolean showFilterButtonsOnMouseOver)
Sets the flag indicating if the filter buttons in FieldBox should be displayed always or only when the mouse is over the button. |
void |
setShowFilterIcon(boolean showFilterIcon)
Sets the flag to show the filter icon. |
void |
setShrinkDataFieldArea(boolean shrinkDataFieldArea)
If true, it will shrink the data field area so that it doesn't go wider than the row header table. |
static void |
setTableColumnWidth(HeaderTable table,
Map<Integer,Integer>[] widths)
|
protected void |
setupLayout(Container contentPanel,
Container fieldsPanel)
Setup the layout of the field areas and the child tables. |
void |
setVersion(String version)
Sets version string. |
void |
setVisibleRowCount(int visibleRowCount)
Sets the preferred number of rows in the lists. |
void |
showColumns(int[] columnIndices)
Show the columns in DataTable. |
protected void |
showFieldSettingsDialog(FieldBox fieldBox)
Shows the field setting dialog. |
protected void |
showPopup(Point p)
|
void |
stopCellEditing()
Stops the cell editing in case the tables in PivotTablePane is in editing mode. |
void |
synchronizeFieldAreaTableWidth(JTable table,
FieldArea fieldArea,
FieldArea secondaryFieldArea)
|
void |
synchronizeFieldAreaWithColumnWidth(JTable table,
FieldArea fieldArea)
|
void |
synchronizeFieldAreaWithField(FieldBox box)
|
protected void |
uncustomizeFieldBox(FieldBox box)
|
void |
updatePossibleValues()
|
void |
updatePossibleValues(FieldBox box)
|
void |
updateUI()
|
protected boolean |
validateFieldBoxDragging(FieldBox draggingFieldBox,
Component targetFieldBoxOrFieldArea,
boolean before)
A validation method before a field box is dropped to a target . |
Methods inherited from class javax.swing.JPanel |
---|
getAccessibleContext, getUI, getUIClassID, paramString, setUI |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected FieldArea _filterFieldsArea
protected FieldArea _dataFieldsArea
protected FieldArea _rowFieldsArea
protected FieldArea _columnFieldsArea
protected Map<PivotField,FieldBox> _fieldBoxMap
protected JTable _rowHeaderTable
protected JTable _columnHeaderTable
protected JTable _dataTable
protected JTable _cornerTable
public static final int FIELD_GAP
protected UnassignedFieldsArea _unassignedFieldsArea
public static final String PROPERTY_PLAIN_HEADER_TABLES
public static final String PROPERTY_HEADER_SELECTION_MODEL
public static final String PROPERTY_GRID_COLOR
public static final String PROPERTY_FILTER_FIELD_AREA_VISIBLE
public static final String PROPERTY_DATA_FIELD_AREA_VISIBLE
public static final String PROPERTY_ROW_FIELD_AREA_VISIBLE
public static final String PROPERTY_COLUMN_FIELD_AREA_VISIBLE
public static final String PROPERTY_FIELD_CHOOSER_AREA_VISIBLE
public static final String PROPERTY_DATA_FIELD_FILTERABLE
public static final String PROPERTY_COLUMN_FIELD_FILTERABLE
public static final String PROPERTY_ROW_FIELD_FILTERABLE
public static final String PROPERTY_HIDE_EXPAND_ICON_ON_SINGLE_ROW
public static final String PROPERTY_SCROLL_SELECTION_TO_VISIBLE
public static final String PROPERTY_FLAT_LAYOUT
public static final String PROPERTY_SHOW_FILTER_BUTTONS_ON_MOUSE_OVER
public static final String PROPERTY_DATA_FIELDS_DUPLICATION_ENABLED
protected JPanel _separator
protected Container _contentPanel
protected JScrollPane _scrollPane
protected JComboBox _addToComboBox
protected JButton _addToButton
protected PivotField _addToComboBoxField
protected TableColumnAutoResizer[] _columnAutoResizer
protected static final String CLIENT_PROPERTY_COLUMN_MODEL_LISTENER
protected static final String CLIENT_PROPERTY_PROPERTY_CHANGE_LISTENER
protected static final String CLIENT_PROPERTY_COMPONENT_LISTENER
public static final String FIELD_SETTING_DIALOG_OK_BUTTON
public static final String FIELD_SETTING_DIALOG_CANCEL_BUTTON
public static final String FIELD_SETTING_DIALOG_HIDE_BUTTON
Constructor Detail |
---|
public PivotTablePane()
public PivotTablePane(IPivotDataModel dataModel)
dataModel
- the pivot data modelMethod Detail |
---|
public void setPivotDataModel(IPivotDataModel dataModel)
dataModel
- the pivot data model.public void updateUI()
updateUI
in class JPanel
protected Container createFieldPanel()
protected Container createContentPanel()
UIDefaultsLookup.put(UIManager.getDefaults(), "Theme.painter", new Office2007Painter() {
public void paintContentBackground(JComponent c, Graphics g, Rectangle rect, int orientation, int
state) {
Graphics2D g2d = (Graphics2D) g.create();
g2d.setColor(Color.red);
g2d.fillRect(rect.x, rect.y, rect.width, rect.height);
g2d.dispose();
}
});
protected void initComponents()
public void propertyChange(PropertyChangeEvent evt)
propertyChange
in interface PropertyChangeListener
protected FieldBoxInputListener createFieldBoxInputListener()
protected boolean validateFieldBoxDragging(FieldBox draggingFieldBox, Component targetFieldBoxOrFieldArea, boolean before)
draggingFieldBox
- the FieldBox that is currently being draggedtargetFieldBoxOrFieldArea
- the target field box or target field area. Could be null if the field box is
dragged outside and will be moved to the unassigned field area.before
- if the second parameter is a FieldBox, this parameter indicates if the dragging
field box will be moved before or after the target field box.
public void indexChanged(IndexChangeEvent event)
IndexChangeListener
indexChanged
in interface IndexChangeListener
event
- the IndexChangeEventpublic void pivotValueProviderEventHandler(PivotValueProviderEvent event)
pivotValueProviderEventHandler
in interface PivotValueProviderListener
protected FieldArea createFieldArea(int areaType)
areaType
- the area type.
protected void configureEnclosingScrollPaneForDataTable(JTable table)
table
- the data tablecreateDataTable()
protected DataTable createDataTable()
protected CellStyleTable createDataTable() {
return new DataTable(this);
}
protected HeaderTable createHeaderTable()
protected int getAdjustedRowHeights()
protected void setupLayout(Container contentPanel, Container fieldsPanel)
contentPanel
- the content panel where the whole pivot table is placed.fieldsPanel
- the unassigned fields panelprotected JScrollPane createScrollPane()
PivotTablePane.JideScrollPaneEx
.
protected void customizeScrollPane(JScrollPane scrollPane)
scrollPane
- the scroll pane used by the pivot table.protected void customizeFieldsPanel(Container panel)
public void updatePossibleValues()
public void updatePossibleValues(FieldBox box)
protected String getDuplicatedTitle(PivotField field)
protected void fillUnassignedFieldArea(UnassignedFieldsArea fieldsArea, List<FieldBox> boxes, QuickFilterField filterField)
fieldsArea.removeAll();
fieldsArea.clearFieldBoxs();
fieldsArea.setLayout(new JideBoxLayout(fieldsArea, JideBoxLayout.Y_AXIS));
for (FieldBox box : boxes) {
fieldsArea.addFieldBox(box);
if (isFieldChooserFilterFieldVisible() && !filterField.matches(box.getField(),
filterField.getSearchingText())) {
continue;
}
fieldsArea.add(box);
}
fieldsArea.add(Box.createGlue(), JideBoxLayout.VARY);
fieldsArea.revalidate();
fieldsArea
- the unassigned field area. It is a JPanel.boxes
- the field boxes for unassigned fields.filterField
- the filter field for the unassigned field area.protected FieldBox createFieldBox(PivotField field, boolean sortArrowVisible, boolean filterButtonVisible)
field
- the pivot fieldsortArrowVisible
- whether sort arrow should be visible.filterButtonVisible
- whether the filter button should be visible.
protected void customizeFieldBox(FieldBox box)
box
- the field box to be customized.protected void uncustomizeFieldBox(FieldBox box)
public void selectFieldBox(FieldBox box)
public void rowHeaderUpdated()
PivotDataModel.setShowGrandTotalForRow(boolean)
, you should call this method to update the UI.
Please note, this method implies dataTableUpdated()
.
public void columnHeaderUpdated()
PivotDataModel.setShowGrandTotalForColumn(boolean)
, you should call this method to update the UI.
Please note, this method implies dataTableUpdated()
.
protected void setDataTableModel(JTable table, TableModel tableModel)
table
- the data tabletableModel
- the data table modelprotected void setHeaderTableModel(JTable table, TableModel tableModel)
table
- the data tabletableModel
- the data table modelprotected void setCornerTableModel(JTable table, TableModel tableModel)
public static Map<Integer,Integer>[] getTableColumnWidth(HeaderTable table)
public static void setTableColumnWidth(HeaderTable table, Map<Integer,Integer>[] widths)
public void bothHeadersUpdated()
PivotDataModel.setShowGrandTotalForColumn(boolean)
and PivotDataModel.setShowGrandTotalForRow(boolean)
,
you should call this method to update the UI.
Please note, this method implies dataTableUpdated()
.
public void dataTableUpdated()
public void fieldsUpdated()
public void rowFieldsUpdated()
public void columnFieldsUpdated()
public void synchronizeFieldAreaWithColumnWidth(JTable table, FieldArea fieldArea)
public void synchronizeFieldAreaTableWidth(JTable table, FieldArea fieldArea, FieldArea secondaryFieldArea)
public void synchronizeFieldAreaWithField(FieldBox box)
public int getRowHeight()
public void setRowHeight(int rowHeight)
public void setVisibleRowCount(int visibleRowCount)
visibleRowCount
- the visible row count.public int getVisibleRowCount()
public void paint(Graphics g)
paint
in class JComponent
public void setCursor(Cursor cursor)
setCursor
in class Component
protected void hideFieldBox(FieldBox fieldBox)
fieldBox
- the field box to be hidden.protected void moveFieldBox(FieldBox fieldBox, boolean before)
fieldBox
- the field box to be moved.before
- true to move it before its current position. False to move after its current position.protected void moveFieldBoxToBeginning(FieldBox fieldBox)
protected void moveFieldBoxToEnd(FieldBox fieldBox)
protected void addFieldBox(FieldBox fieldBox, int areaType)
protected void moveFieldBox(FieldBox fieldBox, FieldBox destFieldBox, boolean before)
public void setFieldChooserVisible(boolean fieldChooserAreaVisible)
fieldChooserAreaVisible
- true or false.public boolean isFieldChooserVisible()
public JTable getRowHeaderTable()
public JTable getColumnHeaderTable()
public JTable getDataTable()
public JTable getCornerTable()
public IPivotDataModel getPivotDataModel()
public String getVersion()
public void setVersion(String version)
version
- the version of the saved layout.protected void showPopup(Point p)
protected void showFieldSettingsDialog(FieldBox fieldBox)
fieldBox
- the field box for which the field settings dialog is for.protected CustomFilterEditorDialog createCustomFilterEditorDialog(Container container, String title, CustomFilterEditor filterEditor)
container
- the container of the dialogtitle
- the title of the dialogfilterEditor
- the corresponding filter editor of the dialog
protected FieldSettingsPanel createFieldSettingsPanel()
protected ButtonPanel createFieldSettingsDialogButtonPanel(StandardDialog dialog)
FIELD_SETTING_DIALOG_OK_BUTTON
FIELD_SETTING_DIALOG_CANCEL_BUTTON
FIELD_SETTING_DIALOG_HIDE_BUTTON
dialog
- the FieldSettingDialog instance
public PivotTablePane.PopupMenuCustomizer getPopupMenuCustomizer()
public void setPopupMenuCustomizer(PivotTablePane.PopupMenuCustomizer popupMenuCustomizer)
popupMenuCustomizer
- a new PopupMenuCustomizer.public PivotTablePane.PopupMenuCustomizer getHeaderTablePopupMenuCustomizer()
public void setHeaderTablePopupMenuCustomizer(PivotTablePane.PopupMenuCustomizer popupMenuCustomizer)
PivotTablePane.TablePopupMenuCustomizer
. In that case, TablePopupMenuCustomizer will be
invoked instead of PopupMenuCustomizer.
popupMenuCustomizer
- a new PopupMenuCustomizer.public PivotTablePane.PopupMenuCustomizer getDataTablePopupMenuCustomizer()
public void setDataTablePopupMenuCustomizer(PivotTablePane.PopupMenuCustomizer popupMenuCustomizer)
PivotTablePane.TablePopupMenuCustomizer
. In that case, TablePopupMenuCustomizer will be
invoked instead of PopupMenuCustomizer.
popupMenuCustomizer
- a new PopupMenuCustomizer.public static String getAreaName(Locale locale, int areaType)
public static int getSummaryCount()
public static String getSummaryName(Locale locale, int summaryType)
public void setLocale(Locale l)
setLocale
in class Component
public boolean isFieldChooserEnabled()
public void setFieldChooserEnabled(boolean fieldChooserEnabled)
setFieldChooserVisible(boolean)
and set it to true to show it. However end users will not be able to access it
through the default user interface when it is disabled.
fieldChooserEnabled
- true or false.public boolean isRearrangable()
public void setRearrangable(boolean rearrangable)
rearrangable
- true or false.public JPanel getFieldChooserComboBoxPanel()
public void setFieldChooserFilterFieldVisible(boolean visible)
visible
- true or false.public boolean isFieldChooserFilterFieldVisible()
public int[] getRowFieldsWidth()
public void autoResizeAllColumns()
public void autoResizeAllColumns(boolean visibleAreaOnly)
autoResizeAllColumns()
, this method will resize the visible area only if the parameter is true.
visibleAreaOnly
- true to resize to make the visible cells' content visible.public Container getFieldChooser()
setFieldChooserVisible(boolean)
will simply call setVisible on this field chooser.
So if you add the field chooser to somewhere else, you need to make sure you response to this call (using
ComponentListener) and do the right thing to hide the field chooser.
public Color getGridColor()
public void setGridColor(Color gridColor)
gridColor
- the grid color of the data table.public boolean isPlainHeaderTables()
setHeaderSelectionMode
method.
setHeaderSelectionMode(int)
,
getHeaderSelectionMode()
public void setPlainHeaderTables(boolean plainHeaderTables)
plainHeaderTables
- the flagisPlainHeaderTables()
public boolean isFilterFieldAreaVisible()
public void setFilterFieldAreaVisible(boolean filterFieldAreaVisible)
public boolean isColumnFieldAreaVisible()
public void setColumnFieldAreaVisible(boolean columnFieldAreaVisible)
public boolean isRowFieldAreaVisible()
public void setRowFieldAreaVisible(boolean rowFieldAreaVisible)
public boolean isDataFieldAreaVisible()
public void setDataFieldAreaVisible(boolean dataFieldAreaVisible)
public String getFieldAreaMessage(int areaType)
public String getFieldAreaName(int areaType)
public int getFieldAreaType(String name)
public boolean isDataFieldFilterable()
public void setDataFieldFilterable(boolean dataFieldFilterable)
dataFieldFilterable
- true or false.public boolean isRowFieldFilterable()
public void setRowFieldFilterable(boolean rowFieldFilterable)
rowFieldFilterable
- true or false.public boolean isColumnFieldFilterable()
public void setColumnFieldFilterable(boolean columnFieldFilterable)
columnFieldFilterable
- true or false.public boolean isSelectedHeaderFilterable(boolean isRowHeader, int fromRow, int toRow, int fromColumn, int toColumn)
public boolean isFiltering(boolean isRowHeader, int fromRow, int toRow, int fromColumn, int toColumn)
isRowHeader
- If it is true, it means it is triggered by a rowHeaderTable, otherwise columnHeaderTablefromRow
- selected minimum row indextoRow
- selected maximum row indexfromColumn
- selected minimum column indextoColumn
- selected maximum column index
public void clearFilter(boolean isRowHeader, int fromRow, int toRow, int fromColumn, int toColumn)
isRowHeader
- If it is true, it means it is triggered by a rowHeaderTable, otherwise columnHeaderTablefromRow
- selected minimum row indextoRow
- selected maximum row indexfromColumn
- selected minimum column indextoColumn
- selected maximum column indexpublic void filterSelectedHeaderValues(boolean isRowHeader, boolean isFilterNotShow, int fromRow, int toRow, int fromColumn, int toColumn)
isRowHeader
- If it is true, it means it is triggered by a rowHeaderTable, otherwise columnHeaderTableisFilterNotShow
- If it is true, it means it is that the selected values to be filtered, otherwise the
selected values to be showedfromRow
- selected minimum row indextoRow
- selected maximum row indexfromColumn
- selected minimum column indextoColumn
- selected maximum column indexpublic void selectDataCells(boolean isRowHeader, int rowIndex, int columnIndex)
isRowHeader
- true or false.rowIndex
- the cell row index of the header table.columnIndex
- the cell column index of the header table.protected void selectDataCells(boolean isRowHeader, int rowIndex, int columnIndex, boolean toggle)
isRowHeader
- true or false.rowIndex
- the cell row index of the header table.columnIndex
- the cell column index of the header table.toggle
- the flag to indicate if the selection should be toggled.public void selectDataCellsBetween(boolean isRowHeader, int startRowIndex, int startColumnIndex, int endRowIndex, int endColumnIndex)
isRowHeader
- true or false.startRowIndex
- the start cell row index of the header table.startColumnIndex
- the start cell column index of the header table.endRowIndex
- the end cell row index of the header table.endColumnIndex
- the end cell column index of the header table.protected void selectDataCellsBetween(boolean isRowHeader, int startRowIndex, int startColumnIndex, int endRowIndex, int endColumnIndex, boolean toggle)
isRowHeader
- true or false.startRowIndex
- the start cell row index of the header table.startColumnIndex
- the start cell column index of the header table.endRowIndex
- the end cell row index of the header table.endColumnIndex
- the end cell column index of the header table.toggle
- the flag to indicate if the selection should be toggled.public boolean isColumnHidden(int columnIndex)
columnIndex
- the column index in DataTable.
public void hideColumns(int[] columnIndices)
columnIndices
- the column index array to be hiddenpublic void showColumns(int[] columnIndices)
columnIndices
- the column index array to be shownpublic void hideValuesAt(boolean isRowHeader, int rowIndex, int columnIndex)
isRowHeader
- true or false.rowIndex
- the cell row index of the header table.columnIndex
- the cell column index of the header table.public void addHiddenValues(Values values)
values
- the Values to be shown or hide.public void clearHiddenRowFields()
addHiddenRowField(PivotField)
public void removeHiddenRowField(PivotField field)
field
- the row field to be hiddenaddHiddenRowField(PivotField)
public void addHiddenRowField(PivotField field)
field
- the row field to be hiddenpublic PivotField[] getHiddenRowFields()
public void removeHiddenValues(Values values)
values
- the Values to be shown or hide.public void clearHiddenValues()
public JScrollPane getScrollPane()
public String getResourceString(String key)
getAreaName(java.util.Locale, int)
and getSummaryName(java.util.Locale, int)
to provide a different
string although they are also defined in the resource bundle.
getResourceString
in interface ResourceProvider
key
- the resource key
public String convertElementToString(Locale locale, Object value, Class<?> clazz, ConverterContext context)
locale
- the localevalue
- the valueclazz
- the typecontext
- the converter context.
public boolean isShrinkDataFieldArea()
public void setShrinkDataFieldArea(boolean shrinkDataFieldArea)
shrinkDataFieldArea
- true or false.public boolean isHideFieldOnDraggingOut()
public void setHideFieldOnDraggingOut(boolean hideFieldOnDraggingOut)
hideFieldOnDraggingOut
- true or false.public boolean isShowFilterIcon()
public void setShowFilterIcon(boolean showFilterIcon)
showFilterIcon
- true or false.public void setFilterIcon(Icon filterIcon)
isShowFilterIcon()
returns true.
filterIcon
- a new filter icon.public Icon getFilterIcon()
isShowFilterIcon()
returns true.
protected void setKeepFieldAreaFit(boolean keepFieldAreaFit)
keepFieldAreaFit
- true or false.public boolean isColumnAutoResizable()
public void setColumnAutoResizable(boolean resizable)
resizable
- true to make columns auto-resizable.public boolean isConsiderRowFieldWidth()
public void setConsiderRowFieldWidth(boolean considerRowFieldWidth)
considerRowFieldWidth
- the flagpublic Cursor getDragRemoveCursor()
public void setDragRemoveCursor(Cursor dragRemoveCursor)
dragRemoveCursor
- the cursor.public Cursor getDragNoDropCursor()
FieldBoxInputListener.isDropAllowed(java.awt.Component, java.awt.Rectangle, int,
java.awt.Container)
public void setDragNoDropCursor(Cursor dragNoDropCursor)
dragNoDropCursor
- the cursor.FieldBoxInputListener.isDropAllowed(java.awt.Component, java.awt.Rectangle, int,
java.awt.Container)
public boolean isRespectFieldPreferredWidth()
public void setRespectFieldPreferredWidth(boolean respectFieldPreferredWidth)
respectFieldPreferredWidth
- the flagpublic int getHeaderSelectionMode()
PivotConstants.HEADER_SELECTION_DATA_TABLE_ONLY
or
PivotConstants.HEADER_SELECTION_HEADER_TABLE_ONLY
.PivotConstants.HEADER_SELECTION_DATA_TABLE_ONLY
,
PivotConstants.HEADER_SELECTION_HEADER_TABLE_ONLY
public void setHeaderSelectionMode(int headerSelectionMode)
headerSelectionMode
- the flagpublic boolean isHideExpandIconOnSingleRow()
public void setHideExpandIconOnSingleRow(boolean hideExpandIconOnSingleRow)
hideExpandIconOnSingleRow
- the flagisHideExpandIconOnSingleRow()
public void stopCellEditing()
public boolean isScrollSelectionToVisible()
setScrollSelectionToVisible(boolean)
public void setScrollSelectionToVisible(boolean scrollSelectionToVisible)
scrollSelectionToVisible
- the flagpublic boolean isFlatLayout()
setFlatLayout(boolean)
public void setFlatLayout(boolean flatLayout)
flatLayout
- the flagpublic Object[] saveSelection()
public void loadSelection(Object[] selectedKeyValues)
selectedKeyValues
- an Values array created by saveSelectionpublic void loadSelection(Object[] selectedKeyValues, boolean scrollSelectionToVisible)
selectedKeyValues
- an Values array created by saveSelectionscrollSelectionToVisible
- if the DataTable is row selection mode and this flag is true, this method willpublic void loadSelection(Object[] selectedKeyValues, boolean scrollSelectionToVisible, boolean selectParentNode)
selectedKeyValues
- an Values array created by saveSelectionscrollSelectionToVisible
- if the DataTable is row selection mode and this flag is true, this method will
scrollselectParentNode
- if load selection should find its parent node if the pre-selected node is
collapsedpublic boolean isShowFilterButtonsOnMouseOver()
setShowFilterButtonsOnMouseOver(boolean)
public void setShowFilterButtonsOnMouseOver(boolean showFilterButtonsOnMouseOver)
showFilterButtonsOnMouseOver
- the flagpublic boolean isDataFieldsDuplicationEnabled()
setDataFieldsDuplicationEnabled(boolean)
public void setDataFieldsDuplicationEnabled(boolean dataFieldsDuplicationEnabled)
dataFieldsDuplicationEnabled
- the flag
|
JIDE 3.5.15 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |