Copyright © 2011 Citra Technologies. All Rights Reserved.

com.citra.pivot
Class DefaultPivotDataModel

java.lang.Object
  extended by com.citra.pivot.AbstractPivotDataModel
      extended by com.citra.pivot.DefaultPivotDataModel
All Implemented Interfaces:
PivotDataModel

public class DefaultPivotDataModel
extends AbstractPivotDataModel

DefaultPivotDataModel is the default implementation of a PivotDataModel. This class exists so that PivotTable can still function when an OlapDataModel is not used.


Field Summary
protected  PivotColumnAdapter pivotColumnAdapter
          the pivot column adapter
protected  PivotRowAdapter pivotRowAdapter
          the pivot row adapter
 
Fields inherited from class com.citra.pivot.AbstractPivotDataModel
dataListeners
 
Constructor Summary
DefaultPivotDataModel()
          Constructs a DefaultPivotDataModel.
DefaultPivotDataModel(PivotRowAdapter pivotRowAdapter, PivotColumnAdapter pivotColumnAdapter)
          Constructs a DefaultPivotDataModel.
 
Method Summary
protected  TableModel createAxis(TreePath[] rowPaths, TreePath[] columnPaths, TreePath[] rowValues, TreePath[] columnValues)
          Returns a two-dimensional table model containing the values at the specified row and column paths.
 Class getColumnClass(TreePath[] rowPaths, TreePath[] columnPaths)
          Determines the class of the model's cell at the specified row and column paths.
 PivotColumnAdapter getPivotColumnAdapter()
          Retrieves the model's pivot column header.
 PivotRowAdapter getPivotRowAdapter()
          Retrieves the model's pivot row header.
 Object getValueAt(TreePath[] rowPaths, TreePath[] columnPaths)
          Retrieves the value of the data at the specfied row and column paths.
 
Methods inherited from class com.citra.pivot.AbstractPivotDataModel
addDataModelListener, fireDataChanged, fireEdgesChanged, removeDataModelListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

pivotRowAdapter

protected PivotRowAdapter pivotRowAdapter
the pivot row adapter


pivotColumnAdapter

protected PivotColumnAdapter pivotColumnAdapter
the pivot column adapter

Constructor Detail

DefaultPivotDataModel

public DefaultPivotDataModel()
Constructs a DefaultPivotDataModel.


DefaultPivotDataModel

public DefaultPivotDataModel(PivotRowAdapter pivotRowAdapter,
                             PivotColumnAdapter pivotColumnAdapter)
Constructs a DefaultPivotDataModel.

Method Detail

createAxis

protected TableModel createAxis(TreePath[] rowPaths,
                                TreePath[] columnPaths,
                                TreePath[] rowValues,
                                TreePath[] columnValues)
Returns a two-dimensional table model containing the values at the specified row and column paths.

Parameters:
rowPaths - the paths of the row header
columnPaths - the paths of the column header
rowValues - the paths of the row header for which a value is provided
columnValues - the paths of column row header for which a value is provided
Returns:
a two-dimension model holding the requested values

getColumnClass

public Class getColumnClass(TreePath[] rowPaths,
                            TreePath[] columnPaths)
Determines the class of the model's cell at the specified row and column paths.

Parameters:
rowPaths - the cell's row header paths
columnPaths - the cell's column header paths
Returns:
the class for the specified cell

getPivotColumnAdapter

public PivotColumnAdapter getPivotColumnAdapter()
Retrieves the model's pivot column header.

Returns:
the column header

getPivotRowAdapter

public PivotRowAdapter getPivotRowAdapter()
Retrieves the model's pivot row header.

Returns:
the row header

getValueAt

public Object getValueAt(TreePath[] rowPaths,
                         TreePath[] columnPaths)
Retrieves the value of the data at the specfied row and column paths.

Parameters:
rowPaths - the cell's row header paths
columnPaths - the cell's column header paths
Returns:
the value for the specified cell

Copyright © 2011 Citra Technologies. All Rights Reserved.