Package diva.gui.tutorial
Class ApplicationTutorial
- java.lang.Object
-
- diva.gui.tutorial.AbstractApplication
-
- 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$
- Author:
- Steve Neuendorffer
-
-
Constructor Summary
Constructors Constructor Description ApplicationTutorial(AppContext context)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description View
createView(Document d)
Return a view of this document.java.lang.String
getTitle()
Get the title of this applicationvoid
initializeApp()
Initialize the application.void
initializeMenuBar(javax.swing.JMenuBar menuBar)
Initialize the menu barvoid
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
-
-
-
-
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 interfaceApplication
- Specified by:
createView
in classAbstractApplication
-
getTitle
public java.lang.String getTitle()
Get the title of this application- Specified by:
getTitle
in interfaceApplication
- Specified by:
getTitle
in classAbstractApplication
-
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.
-
-