JHotDraw 7.1

org.jhotdraw.app
Class DefaultMDIApplication

java.lang.Object
  extended by org.jhotdraw.beans.AbstractBean
      extended by org.jhotdraw.app.AbstractApplication
          extended by org.jhotdraw.app.DefaultMDIApplication
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, Application

public class DefaultMDIApplication
extends AbstractApplication

A DefaultMDIApplication 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.1 2007-12-25 Added method updateViewTitle.
1.0 June 5, 2006 Created.
Author:
Werner Randelshofer.
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.jhotdraw.app.AbstractApplication
labels, VIEW_COUNT_PROPERTY
 
Fields inherited from class org.jhotdraw.beans.AbstractBean
propertySupport
 
Fields inherited from interface org.jhotdraw.app.Application
ACTIVE_VIEW_PROPERTY
 
Constructor Summary
DefaultMDIApplication()
          Creates a new instance.
 
Method Summary
 void configure(java.lang.String[] args)
          Configures the application using the provided arguments array.
protected  javax.swing.JMenu createFileMenu()
           
protected  javax.swing.JMenu createHelpMenu()
           
protected  javax.swing.JMenuBar createMenuBar()
          Creates a menu bar.
protected  javax.swing.JMenu createWindowMenu()
           
 java.awt.Component getComponent()
          Returns the application component.
 void hide(View p)
          Hides a view.
 void init()
          Initializes the application.
protected  void initApplicationActions()
           
protected  void initLookAndFeel()
           
protected  void initViewActions(View p)
           
 boolean isSharingToolsAmongViews()
          Returns true, if this application shares tools among multiple views.
 void launch(java.lang.String[] args)
          Launches the application from the main method.
 void show(View p)
          Shows a view.
protected  void updateOpenRecentMenu(javax.swing.JMenu openRecentMenu)
          Updates the "File > Open Recent" menu.
protected  void updateViewTitle(View v, javax.swing.JInternalFrame f)
          Updates the title of a view and displays it in the given frame.
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.app.AbstractApplication
add, addPalette, addRecentFile, addWindow, basicCreateView, clearRecentFiles, createContainer, createView, dispose, getActiveView, getCopyright, getModel, getName, getVersion, initLabels, isEnabled, recentFiles, remove, removePalette, removeWindow, setActiveView, setEnabled, setModel, start, stop, views
 
Methods inherited from class org.jhotdraw.beans.AbstractBean
addPropertyChangeListener, addPropertyChangeListener, clone, firePropertyChange, firePropertyChange, firePropertyChange, removePropertyChangeListener, removePropertyChangeListener
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jhotdraw.app.Application
addPropertyChangeListener, removePropertyChangeListener
 

Constructor Detail

DefaultMDIApplication

public DefaultMDIApplication()
Creates a new instance.

Method Detail

initApplicationActions

protected void initApplicationActions()

initViewActions

protected void initViewActions(View p)
Specified by:
initViewActions in class AbstractApplication

launch

public void launch(java.lang.String[] args)
Description copied from interface: Application
Launches the application from the main method. This method is typically invoked on the main Thread. This will invoke configure() on the current thread and then init() and start() on the AWT Event Dispatcher Thread.

Specified by:
launch in interface Application
Overrides:
launch in class AbstractApplication

init

public void init()
Description copied from interface: Application
Initializes the application. configure() should have been invoked before the application is inited. Alternatively an application can be configured using setter methods.

Specified by:
init in interface Application
Overrides:
init in class AbstractApplication

configure

public void configure(java.lang.String[] args)
Description copied from interface: Application
Configures the application using the provided arguments array.

Specified by:
configure in interface Application
Overrides:
configure in class AbstractApplication

initLookAndFeel

protected void initLookAndFeel()

show

public void show(View p)
Description copied from interface: Application
Shows a view.


hide

public void hide(View p)
Description copied from interface: Application
Hides a view.


isSharingToolsAmongViews

public boolean isSharingToolsAmongViews()
Description copied from interface: Application
Returns true, if this application shares tools among multiple views.


getComponent

public java.awt.Component getComponent()
Description copied from interface: Application
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.


createMenuBar

protected javax.swing.JMenuBar createMenuBar()
Creates a menu bar.


createFileMenu

protected javax.swing.JMenu createFileMenu()

updateViewTitle

protected void updateViewTitle(View v,
                               javax.swing.JInternalFrame f)
Updates the title of a view and displays it in the given frame.

Parameters:
v - The view.
f - The frame.

updateOpenRecentMenu

protected void updateOpenRecentMenu(javax.swing.JMenu openRecentMenu)
Updates the "File > Open Recent" menu.

Parameters:
openRecentMenu -

createWindowMenu

protected javax.swing.JMenu createWindowMenu()

createHelpMenu

protected javax.swing.JMenu createHelpMenu()

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