Copyright © 2011 Citra Technologies. All Rights Reserved.

com.citra.pivot.olap.remote
Class RemoteOlapModel

java.lang.Object
  extended by com.citra.pivot.AbstractPivotDataModel
      extended by com.citra.pivot.olap.remote.RemoteOlapModel
All Implemented Interfaces:
PivotDataModel, PivotDataModelListener, EventListener

public class RemoteOlapModel
extends AbstractPivotDataModel
implements PivotDataModelListener

RemoteOlapModel is a PivotDataModel that asynchronously retrieves the data values from an OlapDataModel. The data are retrieved from a separate thread than the EDT, which makes pivot table not freeze while data operations occur.


Field Summary
protected  OlapDataModel dataModel
          the underlying olap data model
protected  RemotePendingValue pendingValue
          the pending value to use for cells that have not been evaluated yet
 
Fields inherited from class com.citra.pivot.AbstractPivotDataModel
dataListeners
 
Constructor Summary
RemoteOlapModel(OlapDataModel dataModel)
          Constructs a RemoteOlapModel.
 
Method Summary
 void addRemoteListener(RemoteOlapListener x)
          Adds a listener that is notified when the remote model starts or stops retrieving data from the underlying olap data model.
 void dataChanged(ChangeEvent e)
          Notification that the data of a pivot data model has changed.
 void edgesChanged(ChangeEvent e)
          Notification that the edges (row and/or column header) of a pivot data model have changed.
protected  void fireRemoteActionStarted(TreePath[] rowPaths, TreePath[] columnPaths)
          Notifies listeners that have registered for a STARTED event type.
protected  void fireRemoteActionStopped(TreePath[] rowPaths, TreePath[] columnPaths)
          Notifies listeners that have registered for a STOPPED event type.
 Class getColumnClass(TreePath[] rowPaths, TreePath[] columnPaths)
          Determines the class of the model's cell at the specified row and column paths.
 OlapDataModel getOlapDataModel()
          Retrieves the underlying olap data model.
 RemotePendingValue getPendingValue(TreePath[] rowPaths, TreePath[] columnPaths)
          Determines the pending value used for the data cell specified by the given 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.
 void removeRemoteListener(RemoteOlapListener x)
          Removes a listener that is notified when the remote model starts or stops retrieving data from the underlying olap data model.
 void setOlapDataModel(OlapDataModel dataModel)
          Assigns the olap data model that the remote model will wrap.
 
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

dataModel

protected OlapDataModel dataModel
the underlying olap data model


pendingValue

protected RemotePendingValue pendingValue
the pending value to use for cells that have not been evaluated yet

Constructor Detail

RemoteOlapModel

public RemoteOlapModel(OlapDataModel dataModel)
Constructs a RemoteOlapModel.

Method Detail

addRemoteListener

public void addRemoteListener(RemoteOlapListener x)
Adds a listener that is notified when the remote model starts or stops retrieving data from the underlying olap data model.

Parameters:
x - the listener to be added

dataChanged

public void dataChanged(ChangeEvent e)
Notification that the data of a pivot data model has changed.

Specified by:
dataChanged in interface PivotDataModelListener
Parameters:
e - the event that triggers the notification

edgesChanged

public void edgesChanged(ChangeEvent e)
Notification that the edges (row and/or column header) of a pivot data model have changed.

Specified by:
edgesChanged in interface PivotDataModelListener
Parameters:
e - the event that triggers the notification

fireRemoteActionStarted

protected void fireRemoteActionStarted(TreePath[] rowPaths,
                                       TreePath[] columnPaths)
Notifies listeners that have registered for a STARTED event type.

Parameters:
rowPaths - the paths to the row header that have been retrieved
columnPaths - the paths to the column header that have been retrieved

fireRemoteActionStopped

protected void fireRemoteActionStopped(TreePath[] rowPaths,
                                       TreePath[] columnPaths)
Notifies listeners that have registered for a STOPPED event type.

Parameters:
rowPaths - the paths to the row header that have been retrieved
columnPaths - the paths to the column header that have been retrieved

getColumnClass

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

Specified by:
getColumnClass in interface PivotDataModel
Parameters:
rowPaths - the cell's row header paths
columnPaths - the cell's column header paths
Returns:
the class for the specified cell

getPendingValue

public RemotePendingValue getPendingValue(TreePath[] rowPaths,
                                          TreePath[] columnPaths)
Determines the pending value used for the data cell specified by the given row and column paths.

Parameters:
rowPaths - the paths to the row header
columnPaths - the paths to the column header
Returns:
the pending value that is returned for the given cell

getPivotColumnAdapter

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

Specified by:
getPivotColumnAdapter in interface PivotDataModel
Returns:
the column header

getPivotRowAdapter

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

Specified by:
getPivotRowAdapter in interface PivotDataModel
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.

Specified by:
getValueAt in interface PivotDataModel
Parameters:
rowPaths - the cell's row header paths
columnPaths - the cell's column header paths
Returns:
the value for the specified cell

removeRemoteListener

public void removeRemoteListener(RemoteOlapListener x)
Removes a listener that is notified when the remote model starts or stops retrieving data from the underlying olap data model.

Parameters:
x - the listener to be removed

getOlapDataModel

public OlapDataModel getOlapDataModel()
Retrieves the underlying olap data model.

Returns:
the olap data model

setOlapDataModel

public void setOlapDataModel(OlapDataModel dataModel)
Assigns the olap data model that the remote model will wrap.

Parameters:
dataModel - the underlying olap data model

Copyright © 2011 Citra Technologies. All Rights Reserved.