Copyright © 2011 Citra Technologies. All Rights Reserved.

com.citra.pivot
Class DefaultPivotColumnAdapter

java.lang.Object
  extended by com.citra.table.group.AbstractTreeTableColumnModelAdapter
      extended by com.citra.table.group.DefaultTreeTableColumnModelAdapter
          extended by com.citra.pivot.DefaultPivotColumnAdapter
All Implemented Interfaces:
PivotColumnAdapter, PivotConstants, ColumnInvalidatorListener, TreeTableColumnModelAdapter, VetoableTableColumnModel, PropertyChangeListener, Serializable, EventListener, ListSelectionListener, TableColumnModel

public class DefaultPivotColumnAdapter
extends DefaultTreeTableColumnModelAdapter
implements PivotColumnAdapter

The default PivotColumnAdapter implementation.


Field Summary
protected  TreeTableColumnModel[] columnModels
          the column models
 
Fields inherited from class com.citra.table.group.DefaultTreeTableColumnModelAdapter
cc, tree, treeColumnModel
 
Fields inherited from class com.citra.table.group.AbstractTreeTableColumnModelAdapter
changeEvent, changeSupport, columnMargin, columnSelectionAllowed, listenerList, selectionModel, totalColumnWidth
 
Fields inherited from interface com.citra.table.group.TreeTableColumnModelAdapter
TREE_PROPERTY, TREE_TABLE_COLUMN_MODEL_PROPERTY
 
Fields inherited from interface com.citra.pivot.PivotConstants
GRAND_TOTAL_TYPE, NORMAL_TYPE, SUBTOTAL_TYPE
 
Constructor Summary
DefaultPivotColumnAdapter()
          Constructs a DefaultPivotColumnAdapter.
DefaultPivotColumnAdapter(TreeTableColumnModel columnModel)
          Constructs a DefaultPivotColumnAdapter.
DefaultPivotColumnAdapter(TreeTableColumnModel[] columnModels)
          Constructs a DefaultPivotColumnAdapter.
DefaultPivotColumnAdapter(TreeTableColumnModel columnModel1, TreeTableColumnModel columnModel2)
          Constructs a DefaultPivotColumnAdapter.
 
Method Summary
 void addColumnInvalidatorListener(ColumnInvalidatorListener x)
          Adds a listener that is notified when the columns of the model were changed (via additions or removals).
 void collapseAll(boolean adapters)
          Convenience method to collapse the column tree.
protected  void columnAdded(TableColumn tc, int index)
          Invoke this method after columns were added.
protected  PivotColumnAdapter createAdapter(TreePath path)
          Creates and returns a pivot column adapter for the specified path.
protected  PivotColumnAdapter createAdapter(TreeTableColumnModel[] models)
          Creates and returns a pivot column adapter having models as its column models.
protected  void fireColumnsInvalidated()
          Notifies all listeners that have registered interest for notification on this event type.
 PivotColumnAdapter getAdapter(TreePath path)
          Returns the adapter at the specified tree path.
 int getAdapterDepth()
          Retrieves the maximum number of adapters beneath this one.
 int getPivotType(TreePath path)
          Returns the type of the specified path.
 TreeTableColumnModel[] getTreeTableColumnModels()
          Retrieves the column models currently assigned.
 void removeColumnInvalidatorListener(ColumnInvalidatorListener x)
          Removes a listener that is notified when the columns of the model were changed (via additions or removals).
 void setTreeTableColumnModels(TreeTableColumnModel[] treeColumnModels)
          Sets a new column model array.
 
Methods inherited from class com.citra.table.group.DefaultTreeTableColumnModelAdapter
addColumn, collapseAll, columnRemoved, columnsInvalidated, createDefaultTree, createDefaultTreeColumnModel, expandAll, fireColumnAdded, fireColumnRemoved, getColumn, getColumnCount, getColumnCountFromTree, getColumnFromModel, getColumns, getPreviousColumnCount, getTree, getTreeTableColumnModel, invalidateColumns, moveColumn, nodeCollapsed, nodeExpanded, nodeForRow, nodesChanged, nodesInserted, nodesRemoved, removeColumn, setTree, setTreeTableColumnModel, structureChanged
 
Methods inherited from class com.citra.table.group.AbstractTreeTableColumnModelAdapter
addColumnModelListener, addPropertyChangeListener, addVetoableColumnModelListener, createSelectionModel, fireColumnMarginChanged, fireColumnMoved, fireColumnSelectionChanged, fireColumnWillBeAdded, fireColumnWillBeMoved, fireColumnWillBeRemoved, getColumnIndex, getColumnIndexAtX, getColumnMargin, getColumnSelectionAllowed, getListeners, getSelectedColumnCount, getSelectedColumns, getSelectionModel, getTotalColumnWidth, invalidateWidthCache, propertyChange, recalcWidthCache, removeColumnModelListener, removePropertyChangeListener, removeVetoableColumnModelListener, setColumnMargin, setColumnSelectionAllowed, setSelectionModel, valueChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.citra.table.group.TreeTableColumnModelAdapter
addPropertyChangeListener, getTree, getTreeTableColumnModel, removePropertyChangeListener
 
Methods inherited from interface javax.swing.table.TableColumnModel
addColumn, addColumnModelListener, getColumn, getColumnCount, getColumnIndex, getColumnIndexAtX, getColumnMargin, getColumns, getColumnSelectionAllowed, getSelectedColumnCount, getSelectedColumns, getSelectionModel, getTotalColumnWidth, moveColumn, removeColumn, removeColumnModelListener, setColumnMargin, setColumnSelectionAllowed, setSelectionModel
 

Field Detail

columnModels

protected TreeTableColumnModel[] columnModels
the column models

Constructor Detail

DefaultPivotColumnAdapter

public DefaultPivotColumnAdapter()
Constructs a DefaultPivotColumnAdapter.


DefaultPivotColumnAdapter

public DefaultPivotColumnAdapter(TreeTableColumnModel[] columnModels)
Constructs a DefaultPivotColumnAdapter.


DefaultPivotColumnAdapter

public DefaultPivotColumnAdapter(TreeTableColumnModel columnModel)
Constructs a DefaultPivotColumnAdapter.


DefaultPivotColumnAdapter

public DefaultPivotColumnAdapter(TreeTableColumnModel columnModel1,
                                 TreeTableColumnModel columnModel2)
Constructs a DefaultPivotColumnAdapter.

Method Detail

addColumnInvalidatorListener

public void addColumnInvalidatorListener(ColumnInvalidatorListener x)
Adds a listener that is notified when the columns of the model were changed (via additions or removals).

Specified by:
addColumnInvalidatorListener in interface PivotColumnAdapter
Parameters:
x - the listener to be added

collapseAll

public void collapseAll(boolean adapters)
Convenience method to collapse the column tree. If adapters is true, the columns of created column adapters will also be collapsed.

Parameters:
adapters - true, whether created adapter columns will also be collapsed, false otherwise

columnAdded

protected void columnAdded(TableColumn tc,
                           int index)
Invoke this method after columns were added.

Overrides:
columnAdded in class DefaultTreeTableColumnModelAdapter
Parameters:
tc - the table column that was added
index - the index at which the column was added

createAdapter

protected PivotColumnAdapter createAdapter(TreeTableColumnModel[] models)
Creates and returns a pivot column adapter having models as its column models.

Parameters:
models - the column models of the adapter to create
Returns:
the pivot column adapter created

createAdapter

protected PivotColumnAdapter createAdapter(TreePath path)
Creates and returns a pivot column adapter for the specified path.

Parameters:
path - the path at which the adapter is created
Returns:
the pivot column adapter created

fireColumnsInvalidated

protected void fireColumnsInvalidated()
Notifies all listeners that have registered interest for notification on this event type.


getAdapter

public PivotColumnAdapter getAdapter(TreePath path)
Returns the adapter at the specified tree path.

Specified by:
getAdapter in interface PivotColumnAdapter
Parameters:
path - the given path
Returns:
the adapter at that path

getAdapterDepth

public int getAdapterDepth()
Retrieves the maximum number of adapters beneath this one.

Specified by:
getAdapterDepth in interface PivotColumnAdapter
Returns:
the maximum number of adapters beneath this one

getPivotType

public int getPivotType(TreePath path)
Returns the type of the specified path. The type is used by visualization classes, such as PivotTable, in order to group cells together accordingly.
The type is taken from the PivotConstants interface and may be:
NORMAL_PIVOT_TYPE: a normal cell
SUMMARY_PIVOT_TYPE: a summary cell

Specified by:
getPivotType in interface PivotColumnAdapter
Parameters:
path - the given path
Returns:
the path's type

getTreeTableColumnModels

public TreeTableColumnModel[] getTreeTableColumnModels()
Retrieves the column models currently assigned.

Returns:
the column models

removeColumnInvalidatorListener

public void removeColumnInvalidatorListener(ColumnInvalidatorListener x)
Removes a listener that is notified when the columns of the model were changed (via additions or removals).

Specified by:
removeColumnInvalidatorListener in interface PivotColumnAdapter
Parameters:
x - the listener to be removed

setTreeTableColumnModels

public void setTreeTableColumnModels(TreeTableColumnModel[] treeColumnModels)
Sets a new column model array.

Parameters:
treeColumnModels - the new column models to assign

Copyright © 2011 Citra Technologies. All Rights Reserved.