diva.gui.tutorial
Class MDIApplicationTutorial

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

public class MDIApplicationTutorial
extends MDIApplication

A simple MDI text editor. This application uses the MDIApplication base class to provide a separate internal frame associated with each document. This class is similar in many ways to the ApplicationTutorial. The code in the initializeApp(), initializeMenuBar(), and initializeToolBar() methods is the same in both.

Note that there appears to be a bug in jdk1.2 with the keyboard handling in JEditorPane. Maximizing one of the internal frames loses the event hooks that the JEditorPane uses for keyboard input. This is fixed in jdk1.3.

Version:
$Id: MDIApplicationTutorial.java 39592 2005-10-24 19:09:12Z cxh $
Author:
Steve Neuendorffer

Constructor Summary
MDIApplicationTutorial(DesktopContext context)
           
 
Method Summary
 View createView(Document d)
          Create a view on the given 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.MDIApplication
addView, getMDIContext, getView, removeView, setCurrentView
 
Methods inherited from class diva.gui.tutorial.AbstractApplication
actions, addAction, addDocument, addDocumentListener, addMenuItem, addMenuItem, addPropertyChangeListener, addToolBarButton, addToolBarButton, addViewListener, closeDocument, closeView, documentList, getAction, getAppContext, getClipboard, getCurrentView, getDocumentFactory, getResources, getStoragePolicy, isVisible, removeDocument, removeDocumentListener, removePropertyChangeListener, removeViewListener, setAppContext, setClipboard, 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

MDIApplicationTutorial

public MDIApplicationTutorial(DesktopContext 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)
Create a view on the given document.

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

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.