JHotDraw 7.0.9

org.jhotdraw.application
Class AbstractMDIApplication

java.lang.Object
  extended by application.Application
      extended by org.jhotdraw.application.AbstractDocumentOrientedApplication
          extended by org.jhotdraw.application.AbstractMDIApplication
All Implemented Interfaces:
DocumentOrientedApplication
Direct Known Subclasses:
TeddyMDIApplication

public abstract class AbstractMDIApplication
extends AbstractDocumentOrientedApplication

A AbstractMDIApplication can handle the life cycle of multiple document windows each being presented in a JInternalFrame of its own. A parent JFrame provides all the functionality needed to work with documents, such as a menu bar, tool bars and palette windows.

Version:
1.0 June 5, 2006 Created.
Author:
Werner Randelshofer.

Field Summary
 
Fields inherited from class org.jhotdraw.application.AbstractDocumentOrientedApplication
PROP_CURRENT_VIEW, PROP_VIEW_COUNT
 
Constructor Summary
AbstractMDIApplication()
          Creates a new instance.
 
Method Summary
 void add(DocumentView v)
          Adds a view to this application.
protected  javax.swing.ActionMap createActionMap()
          Creates an action map for actions which haven not been defined using the
protected  javax.swing.JMenu createFileMenu(DocumentView p)
          Creates the file menu.
protected  javax.swing.JMenu createHelpMenu(DocumentView p)
          Creates the help menu.
protected  javax.swing.JMenu createWindowMenu(DocumentView p)
          Creates the window menu.
 java.awt.Component getComponent()
          Returns the application component.
 DocumentView getCurrentView()
          Returns the current view.
protected  MDIDesktopPane getDesktopPane()
           
 void hide(DocumentView p)
          Hides a view.
static void initAWT(java.lang.String[] args)
           
 void initMainFrame()
          Initializes the main frame of the application - if there is one.
 boolean isEditorShared()
          Returns true, if this application shares an editor among multiple views.
 void setCurrentView(DocumentView newValue)
           
 void show(DocumentView p)
          Shows a view.
protected  java.awt.Component wrapDesktopPane(java.awt.Component c, java.util.LinkedList<javax.swing.Action> toolBarActions)
          Returns the wrapped desktop pane.
 
Methods inherited from class org.jhotdraw.application.AbstractDocumentOrientedApplication
addPalette, addRecentFile, clearRecentFiles, createEditMenu, createMenuBar, createMenus, createToolBars, createView, createViewMenu, destroyView, getAction, getFrameworkResourceMap, getResourceMap, getViewClass, getViews, initActionMap, initDefaults, initialize, initLookAndFeel, initRecentFiles, initView, isEnabled, launch, recentFiles, remove, removePalette, setEnabled, shutdown, startup, updateName, updateOpenRecentMenu
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jhotdraw.application.DocumentOrientedApplication
addPropertyChangeListener, removePropertyChangeListener
 

Constructor Detail

AbstractMDIApplication

public AbstractMDIApplication()
Creates a new instance.

Method Detail

createActionMap

protected javax.swing.ActionMap createActionMap()
Description copied from class: AbstractDocumentOrientedApplication
Creates an action map for actions which haven not been defined using the

Overrides:
createActionMap in class AbstractDocumentOrientedApplication

getDesktopPane

protected MDIDesktopPane getDesktopPane()

initMainFrame

public void initMainFrame()
Description copied from class: AbstractDocumentOrientedApplication
Initializes the main frame of the application - if there is one.

Overrides:
initMainFrame in class AbstractDocumentOrientedApplication

initAWT

public static void initAWT(java.lang.String[] args)

add

public void add(DocumentView v)
Description copied from class: AbstractDocumentOrientedApplication
Adds a view to this application. Calls init on the view. Fires a "viewCount" property change event. Invokes method setApplication(this) on the view object.

Specified by:
add in interface DocumentOrientedApplication
Overrides:
add in class AbstractDocumentOrientedApplication

show

public void show(DocumentView p)
Description copied from class: AbstractDocumentOrientedApplication
Shows a view. Calls start on the view.

Specified by:
show in interface DocumentOrientedApplication
Specified by:
show in class AbstractDocumentOrientedApplication

hide

public void hide(DocumentView p)
Description copied from class: AbstractDocumentOrientedApplication
Hides a view. Calls stop on the view.

Specified by:
hide in interface DocumentOrientedApplication
Specified by:
hide in class AbstractDocumentOrientedApplication

getCurrentView

public DocumentView getCurrentView()
Description copied from class: AbstractDocumentOrientedApplication
Returns the current view. This is used by Actions which act on the current DocumentView. Current view is null, if the application has no visible view.

This is a bound property.

Specified by:
getCurrentView in interface DocumentOrientedApplication
Specified by:
getCurrentView in class AbstractDocumentOrientedApplication

setCurrentView

public void setCurrentView(DocumentView newValue)

isEditorShared

public boolean isEditorShared()
Description copied from class: AbstractDocumentOrientedApplication
Returns true, if this application shares an editor among multiple views. This is true for MDI and OSX applications. This is false for SDI applications.

Specified by:
isEditorShared in interface DocumentOrientedApplication
Specified by:
isEditorShared in class AbstractDocumentOrientedApplication

getComponent

public java.awt.Component getComponent()
Description copied from interface: DocumentOrientedApplication
Returns the application component. This may return null, if the application is not represented by a component of its own on the user interface.


wrapDesktopPane

protected java.awt.Component wrapDesktopPane(java.awt.Component c,
                                             java.util.LinkedList<javax.swing.Action> toolBarActions)
Returns the wrapped desktop pane.


createFileMenu

protected javax.swing.JMenu createFileMenu(DocumentView p)
Description copied from class: AbstractDocumentOrientedApplication
Creates the file menu. Return null, if you don't want this menu.

Overrides:
createFileMenu in class AbstractDocumentOrientedApplication

createWindowMenu

protected javax.swing.JMenu createWindowMenu(DocumentView p)
Description copied from class: AbstractDocumentOrientedApplication
Creates the window menu. Return null, if you don't want this menu.  @param v The document view.

Overrides:
createWindowMenu in class AbstractDocumentOrientedApplication

createHelpMenu

protected javax.swing.JMenu createHelpMenu(DocumentView p)
Description copied from class: AbstractDocumentOrientedApplication
Creates the help menu. Return null, if you don't want this menu.

Overrides:
createHelpMenu in class AbstractDocumentOrientedApplication

Copyright 1996-2007 (c) JHotDraw.org.
Some rights reserved.