diva.gui.tutorial
Class ApplicationTutorial

java.lang.Object
  extended by diva.gui.tutorial.AbstractApplication
      extended by diva.gui.tutorial.ApplicationTutorial
All Implemented Interfaces:
Application

public class ApplicationTutorial
extends AbstractApplication

A simple text editor. This application implements a very simple mapping between view and documents. There is only one view. Documents that are not currently being viewed are hidden and not available until the currently viewed document is closed. When a new document is to be viewed, the single view is associated with that document and its contents updated.

This kind of architecture is enough for simple applications that contain few documents (or more likely, only one document). For applications that require simultaneous editing of several documents, an MDI interface makes more sense. See MDIApplicationTutorial for an instance of the same application implemented in an MDI style.

Version:
$Id: ApplicationTutorial.java 40701 2006-02-07 00:50:57Z cxh $
Author:
Steve Neuendorffer

Constructor Summary
ApplicationTutorial(AppContext context)
           
 
Method Summary
 View createView(Document d)
          Return a view of this document.
 java.lang.String getTitle()
          Get the title of this application
 void initializeApp()
          Initialize the application.
 void initializeMenuBar(javax.swing.JMenuBar menuBar)
          Initialize the menu bar
 void initializeToolBar(javax.swing.JToolBar tb)
          Initialize the given toolbar.
static void main(java.lang.String[] argv)
          Construct a new instance of the Tutorial, running in a new application context.
 
Methods inherited from class diva.gui.tutorial.AbstractApplication
actions, addAction, addDocument, addDocumentListener, addMenuItem, addMenuItem, addPropertyChangeListener, addToolBarButton, addToolBarButton, addView, addViewListener, closeDocument, closeView, documentList, getAction, getAppContext, getClipboard, getCurrentView, getDocumentFactory, getResources, getStoragePolicy, isVisible, removeDocument, removeDocumentListener, removePropertyChangeListener, removeView, removeViewListener, setAppContext, setClipboard, setCurrentView, setDocumentFactory, setStoragePolicy, setVisible, showError, viewList, viewList
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ApplicationTutorial

public ApplicationTutorial(AppContext context)
Method Detail

main

public static void main(java.lang.String[] argv)
Construct a new instance of the Tutorial, running in a new application context.


createView

public View createView(Document d)
Return a view of this document.

Specified by:
createView in interface Application
Specified by:
createView in class AbstractApplication

getTitle

public java.lang.String getTitle()
Get the title of this application

Specified by:
getTitle in interface Application
Specified by:
getTitle in class AbstractApplication

initializeApp

public void initializeApp()
Initialize the application.


initializeMenuBar

public void initializeMenuBar(javax.swing.JMenuBar menuBar)
Initialize the menu bar


initializeToolBar

public void initializeToolBar(javax.swing.JToolBar tb)
Initialize the given toolbar. Image icons will be obtained from the ApplicationResources object and added to the actions. Note that the image icons are not added to the actions -- if we did that, the icons would appear in the menus, which I suppose is a neat trick but completely useless.