gumbo.visualize.data
Class TestViewWindow

java.lang.Object
  |
  +--gumbo.util.AbstractDisposable
        |
        +--gumbo.app.MainWindow
              |
              +--gumbo.visualize.data.TestViewWindow
All Implemented Interfaces:
Disposable
Direct Known Subclasses:
TestGraphWindow, TestListWindow, TestTreeWindow

public abstract class TestViewWindow
extends MainWindow

Base class for data model view windows.

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

Nested Class Summary
protected  class TestViewWindow.NewModelAction
          Used by subclasses to create an action intended to replace this window's model and view.
protected  class TestViewWindow.NewWindowAction
          Used by subclasses to create an action intended to open a new child window of this window.
static class TestViewWindow.StatusBarUpdater
           
 
Constructor Summary
TestViewWindow(MainWindow owner, java.lang.String name, TestViewInput input)
          Creates a new window.
 
Method Summary
protected  void createdNewView(WholeView view)
          Called by the system to notify subclasses when a new view has been created.
protected abstract  DataViewFactory getDataViewFactory()
          Called by the system to get the view factory for window display.
 TestViewInput getInput()
          Gets the interaction input for this window.
 WholeModel getWholeModel()
          Gets the current model displayed by this window.
 void newMainArea(WholeModel model)
          Replaces any old view with a new one based on the specified model, and saves the new model, which is returned by getWholeModel().
 void showWindow(WholeModel model)
          Called by subclasses to build and show a new view of a model.
 void updateWindow(WholeModel model)
          Called by subclasses to build a new view of a model without changing its visbility status.
 
Methods inherited from class gumbo.app.MainWindow
getContentPane, getMenuBar, getStatusBar, getStatusText, getTitleText, getToolBar, getWindowGraphic, getWindowName, implDispose, initWindowGraphic, pack, setDefaultCloseOperation, setMainArea, setStatusText, setTitleText, setVisible, setWindowName, showProblemMessage, showProblemMessage
 
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
 

Constructor Detail

TestViewWindow

public TestViewWindow(MainWindow owner,
                      java.lang.String name,
                      TestViewInput input)
Creates a new window. If owner is null the window is unowned and the graphic is a JFrame, otherwise it is owned and the graphic is a JDialog. The new window will be hidden, with an empty main area. Call newMainArea() to fill the main area. Call showWindow() to fill it and show the window.

Method Detail

updateWindow

public final void updateWindow(WholeModel model)
Called by subclasses to build a new view of a model without changing its visbility status. If the window is visible, calls showWindow(), otherwise calls newMainPane().


showWindow

public void showWindow(WholeModel model)
Called by subclasses to build and show a new view of a model. Default implementation: Calls newMainPane() to replace the current view, then shows this window. Subclasses should chain to the super and perform any layout (after the window is known to be visible).

Parameters:
model - The new model. Never null.

newMainArea

public final void newMainArea(WholeModel model)
Replaces any old view with a new one based on the specified model, and saves the new model, which is returned by getWholeModel(). Does not dispose the old model. Calls createdNewView() after the view is created.

Parameters:
model - The new model. Never null.

getWholeModel

public WholeModel getWholeModel()
Gets the current model displayed by this window. Null if none.


getInput

public TestViewInput getInput()
Gets the interaction input for this window. Never null.


getDataViewFactory

protected abstract DataViewFactory getDataViewFactory()
Called by the system to get the view factory for window display.


createdNewView

protected void createdNewView(WholeView view)
Called by the system to notify subclasses when a new view has been created. Note that any view layout must wait until after the view has a root window and the window is visible). Default implementation: Does nothing.