|
JIDE 2.9.5 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JTable
com.jidesoft.grid.JideTable
com.jidesoft.grid.ContextSensitiveTable
com.jidesoft.grid.NavigableTable
com.jidesoft.grid.CellStyleTable
com.jidesoft.grid.CellSpanTable
com.jidesoft.grid.CategorizedTable
com.jidesoft.grid.SortableTable
com.jidesoft.pivot.AggregateTable
public class AggregateTable
AggregateTable provides a way to aggregate a table model with duplicated values using a TreeTable-like
expandable cells and cell spans.
// After you create the AggregateTable instance, you can add a CachedTableModel wrapper to improve the
performance.
_aggregateTable.setModel(new CachedTableModel(_aggregateTable.getModel()));
| Nested Class Summary | |
|---|---|
protected class |
AggregateTable.DelegateExpandMouseInputListener
|
class |
AggregateTable.DraggingHandler
|
protected class |
AggregateTable.ExpandMouseListener
|
static interface |
AggregateTable.PopupMenuCustomizer
Popup menu customizer interface without row index and column index as input. |
static interface |
AggregateTable.TablePopupMenuCustomizer
Popup menu customizer interface with row index and column index as input. |
| Nested classes/interfaces inherited from class com.jidesoft.grid.CellSpanTable |
|---|
CellSpanTable.DelegateAction |
| Nested classes/interfaces inherited from class com.jidesoft.grid.JideTable |
|---|
JideTable.NonContiguousTransferHandler |
| Nested classes/interfaces inherited from class javax.swing.JTable |
|---|
JTable.AccessibleJTable, JTable.DropLocation, JTable.PrintMode |
| 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 |
| Field Summary | |
|---|---|
static String |
PROPERTY_DOUBLE_CLICK_ENABLED
|
| Fields inherited from class com.jidesoft.grid.SortableTable |
|---|
MULTICOLUMN_SORTABLE_PROPERTY, PROPERTY_SHOW_SORT_ORDER_NUMBER, SORTABLE_PROPERTY |
| Fields inherited from class com.jidesoft.grid.CategorizedTable |
|---|
DEFAULT_ASCENDING_ICON, DEFAULT_DESCENDING_ICON, PROPERTY_EXPAND_ICON_VISIBLE |
| Fields inherited from class com.jidesoft.grid.CellSpanTable |
|---|
AUTO_CELL_MERGE_COLUMNS, AUTO_CELL_MERGE_COLUMNS_LIMITED, AUTO_CELL_MERGE_OFF, AUTO_CELL_MERGE_ROWS, AUTO_CELL_MERGE_ROWS_LIMITED, PROPERTY_AUTO_CONVERT_CELL_SPAN |
| Fields inherited from class com.jidesoft.grid.CellStyleTable |
|---|
_cellStyleList, PROPERTY_FILL_VIEWPORT_WITH_STRIPE |
| 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 | |
|---|---|
AggregateTable()
Creates an empty AggregateTable. |
|
AggregateTable(TableModel model)
Creates an AggregateTable. |
|
| Method Summary | |
|---|---|
void |
aggregate()
Aggregates the table model. |
void |
aggregate(int[] columns)
Aggregates the specified columns. |
void |
aggregate(String[] columnNames)
Aggregates the specified columns. |
void |
collapseAll()
Collapses all the cells. |
protected TableCellRenderer |
createCellRenderer()
Creates the special cell renderer for the first column which paints +/- icon and tree line. |
protected AggregateTable.DraggingHandler |
createDraggingColumnPropertyChangeListener()
Creates the TableColumnModelListener used to handle column rearrangement. |
protected MouseInputListener |
createExpandMouseInputListener(MouseInputListener listener)
Creates the mouse listener used to handle mouse click on +/- icon. |
protected MouseListener |
createExpandMouseListener()
Creates the mouse listener used to handle mouse click on +/- icon. |
protected ISortableTableModel |
createSortableTableModel(TableModel model)
Creates a SortableTableModel that wraps around the actual model. |
boolean |
editCellAt(int row,
int column,
EventObject o)
Overrides so that clicking in the +/- icon area will not start editing the cell. |
void |
expandAll()
Expands all the cells. |
AggregateTableModel |
getAggregateTableModel()
Gets the AggregateTableModel for this table. |
AggregateTable.PopupMenuCustomizer |
getCellPopupMenuCustomizer()
Gets the popup menu customizer to customize the menu when user right click on the cells on aggregated column. |
TableCellRenderer |
getCellRenderer(int rowIndex,
int columnIndex)
Returns an appropriate renderer for the cell specified by this row and column. |
Expandable |
getExpandableAt(int rowIndex,
int columnIndex)
|
HeaderTableModel |
getHeaderTableModel()
This is an interface for HeaderTableCellRenderer so that it can find the correct HeaderTableModel. |
String |
getResourceString(String key)
Gets the resource string used in AggregateTable. |
String |
getTableHeaderToolTipText(int columnIndex)
Gets the TableHeader's tooltip for a particular view column index |
String |
getValueAtInString(int rowIndex,
int columnIndex,
HssfTableUtils.CellValueConverter converter)
Gets the string value with summary name or the total/grand total. |
String |
getVersion()
Gets an optional version string. |
protected void |
handleMouseEvent(MouseEvent e)
Handles the mouse event. |
boolean |
isAutoAdjustGrouping()
Gets the grouping behavior when dragging columns. |
boolean |
isAutoGrouping()
Gets the flag if we should group the column if dragging the column to the very beginning of the table when there is no grouping. |
boolean |
isExpandIconVisible(Node node)
Checks if the +/- icon should visible for the node. |
boolean |
needAdjustCellValueString(int rowIndex,
int columnIndex)
Only adjust the cell value string on aggregated columns. |
void |
setAggregatedColumns(int[] columns)
Sets the aggregated columns. |
void |
setAggregatedColumns(String[] columnNames)
Sets the aggregated columns. |
void |
setAutoAdjustGrouping(boolean autoAdjustGrouping)
Sets the flag that controls the grouping behavior when dragging columns. |
void |
setAutoGrouping(boolean autoGrouping)
Sets the flag if we should group the column if dragging the column to the very beginning of the table when there is no grouping. |
void |
setCellPopupMenuCustomizer(AggregateTable.PopupMenuCustomizer popupMenuCustomizer)
Sets the popup menu customizer to customize the menu when user right click on the cells on aggregated column. |
void |
setModel(TableModel model)
|
void |
setVersion(String version)
Sets version string. |
void |
tableChanged(TableModelEvent e)
Invoked when this table's TableModel generates a TableModelEvent. |
protected void |
updateAggregateColumns(TableColumn draggingColumn,
int originalColumnIndex)
|
void |
updateUI()
Resets the UI property to a value from the current look and feel. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface com.jidesoft.grid.TableAdapter |
|---|
getCellSelectionEnabled, getColumnClass, getColumnCount, getColumnName, getColumnSelectionAllowed, getRowCount, getRowSelectionAllowed, isCellEditable, setCellSelectionEnabled, setValueAt |
| Field Detail |
|---|
public static final String PROPERTY_DOUBLE_CLICK_ENABLED
| Constructor Detail |
|---|
public AggregateTable()
public AggregateTable(TableModel model)
AggregateTableModel. If so, you of course don't need to call aggregate() method.
model - the table model.| Method Detail |
|---|
protected ISortableTableModel createSortableTableModel(TableModel model)
SortableTableSortableTableModel that wraps around the actual model. Subclass can override it to create
your own SortabletTableModel. For example TreeTable overrides it to create a
SortableTreeTableModel for TreeTableModel.
createSortableTableModel in class SortableTablemodel - the actual table model.
public void setModel(TableModel model)
setModel in class SortableTablepublic void tableChanged(TableModelEvent e)
JideTableTableModel generates a TableModelEvent. The
TableModelEvent should be constructed in the coordinate system of the model; the appropriate mapping
to the view coordinate system is performed by this JTable when it receives the event.
Application code will not use these methods explicitly, they are used internally by JTable.
tableChanged in interface TableModelListenertableChanged in class CellSpanTablepublic AggregateTableModel getAggregateTableModel()
AggregateTableModel for this table.
AggregateTableModel.public void updateUI()
CellSpanTable
updateUI in class CategorizedTableJComponent.updateUI()public String getTableHeaderToolTipText(int columnIndex)
getTableHeaderToolTipText in class JideTablecolumnIndex - the view column index.
protected TableCellRenderer createCellRenderer()
protected MouseListener createExpandMouseListener()
createExpandMouseInputListener(javax.swing.event.MouseInputListener)
instead.
createExpandMouseInputListener(javax.swing.event.MouseInputListener)protected MouseInputListener createExpandMouseInputListener(MouseInputListener listener)
createExpandMouseListener()
instead.
listener - old listener
createExpandMouseListener()protected void handleMouseEvent(MouseEvent e)
e - the mouse event.public AggregateTable.PopupMenuCustomizer getCellPopupMenuCustomizer()
public void setCellPopupMenuCustomizer(AggregateTable.PopupMenuCustomizer popupMenuCustomizer)
popupMenuCustomizer - a new PopupMenuCustomizer.public void expandAll()
public void collapseAll()
protected AggregateTable.DraggingHandler createDraggingColumnPropertyChangeListener()
protected void updateAggregateColumns(TableColumn draggingColumn,
int originalColumnIndex)
public TableCellRenderer getCellRenderer(int rowIndex,
int columnIndex)
ContextSensitiveTableContextSensitiveTable.getDefaultCellRenderer() method. If null, it will check is ContextSensitiveTable.isCellRendererManagerEnabled() is true. If true, it will look for the cell renderer that assigned to the
specific column. Only if the renderer is still null, it will use the EditorContext information from
ContextSensitiveTableModel and get the correct CellRedenerer from the CellRendererManager. In any case, if we
can't determine a cell renderer, we will call super.getCellRenderer(row, column) just like regular JTable.
getCellRenderer in class CellSpanTablerowIndex - the row of the cell to render, where 0 is the first rowcolumnIndex - the column of the cell to render, where 0 is the first column
public Expandable getExpandableAt(int rowIndex,
int columnIndex)
getExpandableAt in interface ExpandableProviderpublic HeaderTableModel getHeaderTableModel()
public void setAggregatedColumns(String[] columnNames)
aggregate() is called.
columnNames - the name of the columns to be aggregated.public void setAggregatedColumns(int[] columns)
aggregate() is called.
columns - the index of the columns to be aggregated.public void aggregate(String[] columnNames)
columnNames - the name of the columns that will be aggregated.public void aggregate(int[] columns)
columns - the index of the columns to be aggregated.public void aggregate()
setAggregatedColumns(String[]) or setAggregatedColumns(int[]) before calling this method. Or you can combine the two calls into aggregate(String[]) or aggregate(int[]).
public boolean editCellAt(int row,
int column,
EventObject o)
editCellAt in class CellSpanTablerow - the row to be editedcolumn - the column to be editedo - the event that starts the cell editing
public boolean isAutoAdjustGrouping()
setAutoAdjustGrouping(boolean)public void setAutoAdjustGrouping(boolean autoAdjustGrouping)
setAutoAdjustGrouping(true);
setAutoGrouping(true);
autoAdjustGrouping - the flag that if the dragging column will change its group/ungroup behavior while
dragged to boundarypublic boolean isAutoGrouping()
setAutoGrouping(boolean)public void setAutoGrouping(boolean autoGrouping)
isAutoAdjustGrouping() returns true. If that method returns false,
this behavior looks like this flag is FALSE no matter what the value actually is.
If the flag is true,
in the scenario that column A,B,C,D,E are all not grouped, move E before A will make E grouped.
If the flag is false,
in the scenario that column A,B,C,D,E are all not grouped, move E before A will keep E ungrouping.
Before 2.6.0 release, the behavior is the same as the flag is true. However, after 2.6.0 release, the default
setting of this flag is false. So if you want to get exactly the same column dragging behavior as before release
2.6.0, please call the following code:
setAutoAdjustGrouping(true);
setAutoGrouping(true);
autoGrouping - the flag if we should group the column if dragging the column to the very beginning of the
table when there is no grouping.public String getVersion()
public void setVersion(String version)
version - the version of the saved layout.public boolean isExpandIconVisible(Node node)
node - the node.
public String getResourceString(String key)
key - the resource key
public String getValueAtInString(int rowIndex,
int columnIndex,
HssfTableUtils.CellValueConverter converter)
getValueAtInString in interface ValueStringAdjustProviderrowIndex - the row index of the cellcolumnIndex - the column index of the cellconverter - the cell value converter if applicable. null if you are not invoking this method for exporting to excel purpose.
public boolean needAdjustCellValueString(int rowIndex,
int columnIndex)
needAdjustCellValueString in interface ValueStringAdjustProviderrowIndex - the row indexcolumnIndex - the column index
|
JIDE 2.9.5 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||