Package diva.gui.tutorial
Class MDIApplication
- java.lang.Object
- 
- diva.gui.tutorial.AbstractApplication
- 
- diva.gui.tutorial.MDIApplication
 
 
- 
- All Implemented Interfaces:
- Application
 - Direct Known Subclasses:
- MDIApplicationTutorial
 
 public abstract class MDIApplication extends AbstractApplication An abstract superclass for applications that use an MDI (multiple document interface) style of presentation. This class manages the interaction between documents of the application, and the frame that they are displayed in. For example, keeping documents and views in sync, handling focus changes, and so on. The context must implement MDIContext for this to work properly. Note: this application only manages one view per document. If you have multiple views per document, you will need to implement the view-document mapping yourself.- Version:
- $Id$
- Author:
- John Reekie
 
- 
- 
Constructor SummaryConstructors Constructor Description MDIApplication(MDIContext context)Create an MDI application in the given MDI context
 - 
Method SummaryAll Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidaddView(View v)Add a view to the list of views currently known by this application.abstract ViewcreateView(Document d)Given a document, create a new view which displays that document.MDIContextgetMDIContext()Get the MDI frame -- type-specific version of getApplicationFrame().ViewgetView(javax.swing.JComponent c)Get the Document displayed by the given component.voidremoveView(View v)Remove a view from the list of view currently known by this application.voidsetCurrentView(View v)Set the given document to be the current document, and raise the internal window that corresponds to that component.- 
Methods inherited from class diva.gui.tutorial.AbstractApplicationactions, addAction, addDocument, addDocumentListener, addMenuItem, addMenuItem, addPropertyChangeListener, addToolBarButton, addToolBarButton, addViewListener, closeDocument, closeView, documentList, getAction, getAppContext, getClipboard, getCurrentView, getDocumentFactory, getResources, getStoragePolicy, getTitle, isVisible, removeDocument, removeDocumentListener, removePropertyChangeListener, removeViewListener, setAppContext, setClipboard, setDocumentFactory, setStoragePolicy, setVisible, showError, viewList, viewList
 
- 
 
- 
- 
- 
Constructor Detail- 
MDIApplicationpublic MDIApplication(MDIContext context) Create an MDI application in the given MDI context
 
- 
 - 
Method Detail- 
addViewpublic void addView(View v) Description copied from class:AbstractApplicationAdd a view to the list of views currently known by this application. Fire a view list event to registered listeners. Throw an exception if the view is already in the list of views.- Specified by:
- addViewin interface- Application
- Overrides:
- addViewin class- AbstractApplication
 
 - 
createViewpublic abstract View createView(Document d) Given a document, create a new view which displays that document. Subclasses must implement this method to create, initialize, and then return a View object that wraps a JComponent.- Specified by:
- createViewin interface- Application
- Specified by:
- createViewin class- AbstractApplication
 
 - 
getMDIContextpublic MDIContext getMDIContext() Get the MDI frame -- type-specific version of getApplicationFrame().
 - 
getViewpublic View getView(javax.swing.JComponent c) Get the Document displayed by the given component.
 - 
removeViewpublic void removeView(View v) Remove a view from the list of view currently known by this application. Fire a document list event to registered listeners. Throw an exception if the document is not known. This method assumes that setCurrentView will be called subsequently on another view.- Specified by:
- removeViewin interface- Application
- Overrides:
- removeViewin class- AbstractApplication
 
 - 
setCurrentViewpublic void setCurrentView(View v) Set the given document to be the current document, and raise the internal window that corresponds to that component.- Specified by:
- setCurrentViewin interface- Application
- Overrides:
- setCurrentViewin class- AbstractApplication
 
 
- 
 
-