gumbo.visualize.data
Class DataView

java.lang.Object
  |
  +--gumbo.util.AbstractDisposable
        |
        +--gumbo.visualize.data.DataView
All Implemented Interfaces:
Disposable
Direct Known Subclasses:
PartView, WholeView

public abstract class DataView
extends AbstractDisposable

Abstract base class for the role of "view" in an MVC-based visualization of client data. A data view serves as an immutable data association object (proxy) between one data model and one graphic view, which is the concrete implementation of this abstract view. Data views are intended to be created by view factories (see DataViewFactory). Data views, unlike data models, are not intended to be serializable.

This object implements the Disposable interface with "fail fast" disposal detection. Any attempt to access this view after it has been disposed will throw an IllegalStateException.

Version:
$Revision: 1.19 $
Author:
Jon Barrilleaux (jonb@jmbaai.com) of JMB and Associates Inc.

Method Summary
 DataModel getDataModel()
          Gets the data model associated with this data view.
 GraphicView getGraphicView()
          Gets the concrete graphic view implementing this abstract data view.
protected  void implDispose()
          Disposes the graphic view and nulls the data model.
 void initGraphicView(GraphicView graphic)
          Used by factories to initialize this view's graphic implementation.
 
Methods inherited from class gumbo.util.AbstractDisposable
dispose, isDisposed
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getDataModel

public DataModel getDataModel()
Gets the data model associated with this data view.

Returns:
Reference to the data model. Never null.

getGraphicView

public GraphicView getGraphicView()
Gets the concrete graphic view implementing this abstract data view. The graphic view will be disposed automatically when this data view is disposed. The graphic view must not be disposed while its data view is active, and the graphic must remove itself from any parent graphic, and dispose any descendant graphics.

Returns:
Reference to the graphic view. Never null.
Throws:
java.lang.IllegalStateException - Graphic has not been set.

initGraphicView

public void initGraphicView(GraphicView graphic)
Used by factories to initialize this view's graphic implementation. The view is invalid and unusable until the graphic view is set. Throws an exception if the graphic view is already set.

Parameters:
graphic - Reference to the graphic view. Never null.

implDispose

protected void implDispose()
Disposes the graphic view and nulls the data model. This base class should be disposed first before the subclass to allow the graphic view to use the data view part tree for disposing itself and cleaning up its relations.

Specified by:
implDispose in class AbstractDisposable