Oracle Fusion Middleware Java API Reference for Oracle Data Visualization Components
11g Release 1 (11.1.1.4.0)

E12063-05

oracle.dss.dataView
Class ModelAdapter

java.lang.Object
  extended by oracle.dss.dataView.ModelAdapter
All Implemented Interfaces:
java.io.Serializable, java.util.EventListener, ControllerActions, Model, DataDirectorListener
Direct Known Subclasses:
GaugeModelAdapter, GraphModelAdapter

public abstract class ModelAdapter
extends java.lang.Object
implements Model, ControllerActions, DataDirectorListener, java.io.Serializable

See Also:
Serialized Form

Field Summary
protected  DataAccess dataAccess
           
protected  DataDirector dataDirector
           
protected  DataSource dataDirectorFactory
           
protected  boolean drillingEnabled
           
protected static int INITIAL_DATA_COLUMN
           
protected static int INITIAL_DATA_ROW
           
protected static int INITIAL_EDGE_SIZE
           
protected  javax.swing.event.EventListenerList listenerList
           
protected  ErrorHandler m_eh
           
protected  DataAccess metadataAccess
           
 
Fields inherited from interface oracle.dss.dataView.Model
VIEW_PAGE_FIRST, VIEW_PAGE_LAST, VIEW_PAGE_NEXT, VIEW_PAGE_PREVIOUS
 
Constructor Summary
ModelAdapter()
          Constructor.
 
Method Summary
 void addDataListener(DataListener l)
          Registers a data listener with this model.
 void addModelListener(ModelListener l)
          Registers a model listener with this model.
 boolean canDrill(java.lang.Object source, int edge, int layer, int slice, int flags)
          Indicates whether a drill gesture is legal.
 boolean canPivot(java.lang.Object source, int fromEdge, int toEdge, int fromLayer, int toLayer, int flags)
          Indicates whether a pivot operation is legal.
protected  DataSource createDefaultDataSource()
           
 boolean drillGestureHappened(java.lang.Object source, int edge, int layer, int slice, int flags)
          Drills in data.
protected  void fireviewDrillRequested(DrillEvent e)
           
protected  void fireviewDrillRequesting(DrillEvent e)
           
protected  void fireviewPageRequested(PageEvent e)
           
protected  void fireviewPageRequesting(PageEvent e)
           
protected  void fireviewPivotRequested(PivotEvent e)
           
protected  void fireviewPivotRequesting(PivotEvent e)
           
 ControllerActions getControllerActions()
           
 DataAccess getDataAccess()
          Get the data access for this view.
 DataDirector getDataDirector()
          Retrieves the data director for this view.
protected abstract  DataMap getDataMap()
           
 DataSource getDataSource()
          Retrieves the data source for this view.
 ErrorHandler getErrorHandler()
          Retrieves the error handler for this view.
protected  FormatManager getFormatManager()
          Get the format manager.
protected abstract  LayerMetadataMap getLayerMetadataMap(int edge)
           
protected abstract  MetadataMap getMetadataMap(int edge)
           
protected  void initDefaults(DataviewDefaultValues ddv)
          Initialize default values from the given DataviewDefaultValues instance.
 boolean isDrillingEnabled()
          Indicates whether drilling is allowed in this view.
 boolean pageChangeHappened(java.lang.Object source, int pos)
          Changes the current page.
 boolean pageChangeHappened(java.lang.Object source, int[] hPos, int maxLayerSpecified)
          Changes the current page.
 boolean pivotGestureHappened(java.lang.Object source, int fromEdge, int toEdge, int fromLayer, int toLayer, int flags)
          Pivots data.
 void pollingRequired(PollingRequiredEvent polling)
          Event fired to inform listeners that the given DataDirector requires polling to retrieve data using the DataDirector3 events getStatus and possibly fireEvents.
 void removeDataListener(DataListener l)
          Removes the data listener from this model.
 void removeModelListener(ModelListener l)
          Removes a model listener from the list of listeners for this model.
 void setDataAccess(DataAccess dp)
          Specifies the data access for this view.
 void setDataDirector(DataDirector dd)
          Specifies the data director for this view.
 void setDataSource(DataSource ds)
          Specifies the data source for this view.
 void setDrillingEnabled(boolean b)
          Specifies whether drilling is allowed in this view.
 void setErrorHandler(ErrorHandler eh)
          Specifies the error handler for this view.
protected  void setFormatManager(FormatManager fm)
          Specifies the format manager.
protected abstract  void setSupportedDataLayerFlags()
          Set the flags for data layer supported.
 void viewDataAvailable(DataAvailableEvent e)
          Notifies listeners of a change in the availability of data.
 void viewDataChanged(DataChangedEvent e)
          Notify listeners of changes to the data or metadata.
 void waitDataAvailable(WaitDataAvailableEvent e)
          Notifies listeners that a slow data fetch has been completed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INITIAL_EDGE_SIZE

protected static final int INITIAL_EDGE_SIZE
See Also:
Constant Field Values

INITIAL_DATA_COLUMN

protected static final int INITIAL_DATA_COLUMN
See Also:
Constant Field Values

INITIAL_DATA_ROW

protected static final int INITIAL_DATA_ROW
See Also:
Constant Field Values

listenerList

protected javax.swing.event.EventListenerList listenerList

dataDirectorFactory

protected transient DataSource dataDirectorFactory

dataDirector

protected transient DataDirector dataDirector

dataAccess

protected transient DataAccess dataAccess

metadataAccess

protected transient DataAccess metadataAccess

drillingEnabled

protected boolean drillingEnabled

m_eh

protected transient ErrorHandler m_eh
Constructor Detail

ModelAdapter

public ModelAdapter()
Constructor.

Method Detail

initDefaults

protected void initDefaults(DataviewDefaultValues ddv)
Initialize default values from the given DataviewDefaultValues instance.


setErrorHandler

public void setErrorHandler(ErrorHandler eh)
Specifies the error handler for this view.

Specified by:
setErrorHandler in interface Model
Parameters:
eh - The error handler.
See Also:
Dataview.addErrorHandler(oracle.dss.util.ErrorHandler)

getErrorHandler

public ErrorHandler getErrorHandler()
Retrieves the error handler for this view.

Specified by:
getErrorHandler in interface Model
Returns:
The error handler. Returns null if no error handler has been specified for the view.

setDataSource

public void setDataSource(DataSource ds)
Specifies the data source for this view.

Specified by:
setDataSource in interface Model
Parameters:
ds - The data source for this view.

createDefaultDataSource

protected DataSource createDefaultDataSource()
Returns:
default static data source for this view

getDataSource

public DataSource getDataSource()
Retrieves the data source for this view.

Specified by:
getDataSource in interface Model
Returns:
The data source for this view. Returns null if no data source has been specified for this view.

setDataDirector

public void setDataDirector(DataDirector dd)
Specifies the data director for this view. The data director is the part of the data source that manipulates the data. This method sets the maps in the data director and registers this Model implementation as a listener to the data director.

Specified by:
setDataDirector in interface Model
Parameters:
dd - A DataDirector implementation that has been initialized.

setSupportedDataLayerFlags

protected abstract void setSupportedDataLayerFlags()
Set the flags for data layer supported.


getDataDirector

public DataDirector getDataDirector()
Retrieves the data director for this view. The data director is the part of the data source that manipulates the data.

Specified by:
getDataDirector in interface Model
Returns:
The data director for this view.

setDataAccess

public void setDataAccess(DataAccess dp)
Specifies the data access for this view. The data access is the part of the data source that feeds data to the view. It is, essentially, a cursor of data.

Specified by:
setDataAccess in interface Model
Parameters:
dp - An implementation of the DataAccess interface.

getDataAccess

public DataAccess getDataAccess()
Get the data access for this view. The data access is the part of the data source that feeds data to the view. It is, essentially, a cursor of data.

Specified by:
getDataAccess in interface Model
Returns:
The DataAccess for this view. This method can return null if no data access has been specified for this view.

addDataListener

public void addDataListener(DataListener l)
Registers a data listener with this model. A data listener listens for changes that a user requests in the data, such as drilling and pivoting.

Specified by:
addDataListener in interface Model
Parameters:
l - The listener to add.

removeDataListener

public void removeDataListener(DataListener l)
Removes the data listener from this model.

Specified by:
removeDataListener in interface Model
Parameters:
l - The listener to remove.

addModelListener

public void addModelListener(ModelListener l)
Registers a model listener with this model. A model listener listens for changes in the availability of data and for changes in the underlying data. The Dataview calls this method to register itself as a listener for this Model. Application developers do not need to call this method.

Specified by:
addModelListener in interface Model
Parameters:
l - The listener to add.

removeModelListener

public void removeModelListener(ModelListener l)
Removes a model listener from the list of listeners for this model. The Dataview calls this method before it shuts down, to remove itself from the list of listeners for this Model.

Specified by:
removeModelListener in interface Model
Parameters:
l - The listener to remove.

pivotGestureHappened

public boolean pivotGestureHappened(java.lang.Object source,
                                    int fromEdge,
                                    int toEdge,
                                    int fromLayer,
                                    int toLayer,
                                    int flags)
                             throws EdgeOutOfRangeException,
                                    LayerOutOfRangeException,
                                    DataDirectorException
Description copied from interface: ControllerActions
Pivots data. This method first fires a viewPivotRequesting event. If the event is not consumed, this method then calls the pivot method in the data director, to pivot the data in the data source. After the call to the data director, this method fires a viewPivotRequested event.

The view calls this method when a pivot gesture is detected in the UI.

Specified by:
pivotGestureHappened in interface ControllerActions
Specified by:
pivotGestureHappened in interface Model
Parameters:
source - The source of any events that this method fires. The DataView passes this as this parameter.
fromEdge - A constant that represents the edge to pivot from, such as COLUMN_EDGE. Edge constants are listed in the See Also section.
toEdge - A constant that represents the edge to pivot to.
fromLayer - The layer to pivot from. The layer identifies the location of the dimension or dimension member on the edge. Zero is the outer-most layer on the edge.
toLayer - The layer to pivot to.
flags - A constant that represents the type of pivot to perform, such as PIVOT_SWAP or PIVOT_MOVE_BEFORE. The constants are listed in the See Also section, and they begin with PIVOT_.
Returns:
true if the data director performs the pivot, false if the pivot is not performed for some reason.
Throws:
EdgeOutOfRangeException - If either edge parameter is too large.
LayerOutOfRangeException - If either layer parameter is negative or too large.
DataDirectorException - If a data provider error occurs.
See Also:
DataDirector.COLUMN_EDGE, DataDirector.ROW_EDGE, DataDirector.PAGE_EDGE, DataDirector.PIVOT_EDGES, DataDirector.PIVOT_MOVE_AFTER, DataDirector.PIVOT_MOVE_BEFORE, DataDirector.PIVOT_SWAP

canPivot

public boolean canPivot(java.lang.Object source,
                        int fromEdge,
                        int toEdge,
                        int fromLayer,
                        int toLayer,
                        int flags)
                 throws EdgeOutOfRangeException,
                        LayerOutOfRangeException,
                        DataDirectorException
Description copied from interface: ControllerActions
Indicates whether a pivot operation is legal. This method calls the pivotOK method in the data director, to pivot the data in the data source. The view calls this method when a pivot gesture is detected in the UI.

Specified by:
canPivot in interface ControllerActions
Specified by:
canPivot in interface Model
Parameters:
source - The source of any events that this method fires. The DataView passes this as this parameter.
fromEdge - A constant that represents the edge to pivot from, such as COLUMN_EDGE. Edge constants are listed in the See Also section.
toEdge - A constant that represents the edge to pivot to.
fromLayer - The layer to pivot from. The layer identifies the location of the dimension or dimension member on the edge. Zero is the outer-most dimension on the edge.
toLayer - The layer to pivot to.
flags - A constant that represents the type of pivot to perform, such as PIVOT_SWAP or PIVOT_MOVE_BEFORE. The constants are listed in the See Also section, and they all begin with PIVOT_.
Returns:
true if the pivot operation is legal, false if not.
Throws:
EdgeOutOfRangeException - If either edge parameter is too large.
LayerOutOfRangeException - If either layer parameter is negative or too large.
DataDirectorException - If a data provider error occurs.
See Also:
DataDirector.COLUMN_EDGE, DataDirector.ROW_EDGE, DataDirector.PAGE_EDGE, DataDirector.PIVOT_EDGES, DataDirector.PIVOT_MOVE_AFTER, DataDirector.PIVOT_MOVE_BEFORE, DataDirector.PIVOT_SWAP

drillGestureHappened

public boolean drillGestureHappened(java.lang.Object source,
                                    int edge,
                                    int layer,
                                    int slice,
                                    int flags)
                             throws EdgeOutOfRangeException,
                                    LayerOutOfRangeException,
                                    SliceOutOfRangeException,
                                    DataDirectorException
Description copied from interface: ControllerActions
Drills in data. The view calls this method when a drill gesture is detected in the UI.

Specified by:
drillGestureHappened in interface ControllerActions
Specified by:
drillGestureHappened in interface Model
Parameters:
source - The source of any events that this method fires. The DataView passes this as this parameter.
edge - A constant that represents the edge to drill, such as COLUMN_EDGE. Edge constants are listed in the See Also secton.
layer - The layer to drill. The layer identifies the location of the dimension or dimension member on the edge. Zero is the outer-most layer on the edge.
slice - The slice to drill. The slice is zero-based. Each layer member in the innermost dimension has a unique slice. In outer layers, any slice that the outer layer spans can be used.
flags - A constant that represents the type of drill to perform, such as DRILLSTATE_DRILLABLE to drill down in data. Drill constants are listed in the See Also section. They begin with DRILLSTATE_.
Returns:
true if the data director performs the drill, false if not.
Throws:
EdgeOutOfRangeException - If edge is too large.
LayerOutOfRangeException - If layer is negative or too large.
SliceOutOfRangeException - If slice is negative or too large.
DataDirectorException - If a data provider error occurs.
See Also:
DataDirector.COLUMN_EDGE, DataDirector.ROW_EDGE, DataDirector.PAGE_EDGE, DataDirector.DRILLSTATE_DRILLABLE, DataDirector.DRILLSTATE_IS_DRILLED, DataDirector.DRILLSTATE_NOT_DRILLABLE

canDrill

public boolean canDrill(java.lang.Object source,
                        int edge,
                        int layer,
                        int slice,
                        int flags)
                 throws EdgeOutOfRangeException,
                        LayerOutOfRangeException,
                        SliceOutOfRangeException,
                        DataDirectorException
Description copied from interface: ControllerActions
Indicates whether a drill gesture is legal. The view calls this method when a drill gesture is detected in the UI.

Specified by:
canDrill in interface ControllerActions
Specified by:
canDrill in interface Model
Parameters:
source - The source of any events that this method fires. The DataView passes this as this parameter.
edge - A constant that represents the edge to drill, such as COLUMN_EDGE. Edge constants listed in the See Also section.
layer - The layer to drill. The layer identifies the location of the dimension or dimension member on the edge. Zero is the outer-most layer on the edge.
slice - The slice to drill. The slice is zero-based. Each layer member in the innermost layer has a unique slice. In outer layers, any slice that the outer layer spans can be used.
flags - A constant that represents the type of drill to perform, such as DRILLSTATE_DRILLABLE to drill down in data. Drill constants are listed in the See Also section. They begin with DRILLSTATE_.
Returns:
true if the drill operation is legal, false if not.
Throws:
EdgeOutOfRangeException - If edge is too large.
DepthOutOfRangeException - If depth is negative or too large.
SliceOutOfRangeException - If slice is negative or too large.
DataDirectorException - If a data provider error occurs.
LayerOutOfRangeException
See Also:
DataDirector.COLUMN_EDGE, DataDirector.ROW_EDGE, DataDirector.PAGE_EDGE, DataDirector.DRILLSTATE_DRILLABLE, DataDirector.DRILLSTATE_IS_DRILLED, DataDirector.DRILLSTATE_NOT_DRILLABLE

pageChangeHappened

public boolean pageChangeHappened(java.lang.Object source,
                                  int pos)
                           throws SliceOutOfRangeException,
                                  DataDirectorException
Description copied from interface: ControllerActions
Changes the current page.

Specified by:
pageChangeHappened in interface ControllerActions
Specified by:
pageChangeHappened in interface Model
Parameters:
source - The source of any event that this method fires.
pos - A constant that represents the first page, last page, next page, or previous page. Constants are listed in the See Also section.
Returns:
true if the page is changed, false if not.
Throws:
SliceOutOfRangeException - If page is negative or too large.
DataDirectorException - If a data provider error occurs.
See Also:
Model.VIEW_PAGE_FIRST, * @see Model#VIEW_PAGE_NEXT, Model.VIEW_PAGE_PREVIOUS

pageChangeHappened

public boolean pageChangeHappened(java.lang.Object source,
                                  int[] hPos,
                                  int maxLayerSpecified)
                           throws LayerOutOfRangeException,
                                  SliceOutOfRangeException,
                                  DataDirectorException
Description copied from interface: ControllerActions
Changes the current page. The view calls this method when a page change gesture is detected in the UI.

Specified by:
pageChangeHappened in interface ControllerActions
Specified by:
pageChangeHappened in interface Model
Parameters:
source - The source of any event that this method fires.
hPos - An array of relative indices that indicate the set of new values to give to the various layers that make up the target slice.
maxLayerSpecified - The maximum index into hPos (layer) that the call should use in making the slice change.
Returns:
true if the page is changed, false if not.
Throws:
LayerOutOfRangeException - If there are too many layers.
SliceOutOfRangeException - If page is negative or too large.
DataDirectorException - If a data provider error occurs.

setDrillingEnabled

public void setDrillingEnabled(boolean b)
Specifies whether drilling is allowed in this view.

Specified by:
setDrillingEnabled in interface Model
Parameters:
b - true to enable drilling, false to disable drilling.

isDrillingEnabled

public boolean isDrillingEnabled()
Indicates whether drilling is allowed in this view.

Specified by:
isDrillingEnabled in interface Model
Returns:
true if drilling is enabled, false if not.

getControllerActions

public ControllerActions getControllerActions()
Specified by:
getControllerActions in interface Model
Returns:
This ModelAdapter.

fireviewPivotRequesting

protected void fireviewPivotRequesting(PivotEvent e)

fireviewPivotRequested

protected void fireviewPivotRequested(PivotEvent e)

fireviewDrillRequesting

protected void fireviewDrillRequesting(DrillEvent e)

fireviewDrillRequested

protected void fireviewDrillRequested(DrillEvent e)

fireviewPageRequesting

protected void fireviewPageRequesting(PageEvent e)

fireviewPageRequested

protected void fireviewPageRequested(PageEvent e)

viewDataChanged

public void viewDataChanged(DataChangedEvent e)
Notify listeners of changes to the data or metadata. This method calls the modelDataChanged method of each registered listener.

Specified by:
viewDataChanged in interface Model
Specified by:
viewDataChanged in interface DataDirectorListener
Parameters:
e - Information about the data change.

viewDataAvailable

public void viewDataAvailable(DataAvailableEvent e)
Notifies listeners of a change in the availability of data. This method notifies listeners that data is now available or is no longer available. It calls the modelDataAvailable method of each registered listeners.

Specified by:
viewDataAvailable in interface DataDirectorListener
Parameters:
e - Information about the availability of data.

waitDataAvailable

public void waitDataAvailable(WaitDataAvailableEvent e)
Notifies listeners that a slow data fetch has been completed. It calls the modelWaitDataAvailable method of each registered ModelListener.

Specified by:
waitDataAvailable in interface DataDirectorListener
Parameters:
e - Information about the fetch.
See Also:
DataDirector, WaitData

pollingRequired

public void pollingRequired(PollingRequiredEvent polling)
Description copied from interface: DataDirectorListener
Event fired to inform listeners that the given DataDirector requires polling to retrieve data using the DataDirector3 events getStatus and possibly fireEvents.

Specified by:
pollingRequired in interface DataDirectorListener

setFormatManager

protected void setFormatManager(FormatManager fm)
Specifies the format manager.

Parameters:
fm - format manager instance

getFormatManager

protected FormatManager getFormatManager()
Get the format manager.

Returns:
the current FormatManager instance

getDataMap

protected abstract DataMap getDataMap()

getMetadataMap

protected abstract MetadataMap getMetadataMap(int edge)

getLayerMetadataMap

protected abstract LayerMetadataMap getLayerMetadataMap(int edge)

Oracle Fusion Middleware Java API Reference for Oracle Data Visualization Components
11g Release 1 (11.1.1.4.0)

E12063-05

Copyright © 1997, 2011, Oracle. All rights reserved.