JHotDraw 7.0.9

org.jhotdraw.app
Class DefaultSDIApplication

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

public class DefaultSDIApplication
extends AbstractApplication

A DefaultSDIApplication can handle the life cycle of a single document window being presented in a JFrame. The JFrame provides all the functionality needed to work with the document, such as a menu bar, tool bars and palette windows.

Version:
1.4 2007-01-11 Removed method addStandardActionsTo.
1.3 2006-05-03 Show asterisk in window title, when project has unsaved changes.
1.2.1 2006-02-28 Stop application when last project is closed.
1.2 2006-02-06 Support for multiple open id added.
1.1 2006-02-06 Revised.
1.0 October 16, 2005 Created.
Author:
Werner Randelshofer
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.jhotdraw.app.AbstractApplication
labels
 
Fields inherited from class org.jhotdraw.beans.AbstractBean
propertySupport
 
Constructor Summary
DefaultSDIApplication()
          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(Project p)
           
protected  javax.swing.JMenu createHelpMenu(Project p)
           
protected  javax.swing.JMenuBar createMenuBar(Project p, java.util.List<javax.swing.Action> toolBarActions)
          The project menu bar is displayed for a project.
protected  javax.swing.JMenu createViewMenu(Project p, java.util.List<javax.swing.Action> toolBarActions)
           
 void dispose(Project p)
          This is a convenience method for removing a project and disposing it.
 java.awt.Component getComponent()
          Returns the application component.
 Project getCurrentProject()
          Returns the current project.
 void hide(Project p)
          Hides a project.
 void init()
          Initializes the application.
protected  void initApplicationActions()
           
protected  void initLookAndFeel()
           
protected  void initProjectActions(Project p)
           
 boolean isSharingToolsAmongProjects()
          Returns true, if this application shares tools among multiple projects.
 void launch(java.lang.String[] args)
          Launches the application from the main method.
 void remove(Project p)
          Removes a project from this application and removes it from the users view.
 void setCurrentProject(Project newValue)
           
 void show(Project p)
          Shows a project.
protected  java.awt.Component wrapProjectComponent(Project p)
          Returns the project component.
 
Methods inherited from class org.jhotdraw.app.AbstractApplication
add, addRecentFile, basicCreateProject, clearRecentFiles, createContainer, createProject, getCopyright, getModel, getName, getVersion, initLabels, isEnabled, projects, recentFiles, setEnabled, setModel, start, stop
 
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

DefaultSDIApplication

public DefaultSDIApplication()
Creates a new instance.

Method Detail

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

remove

public void remove(Project p)
Description copied from interface: Application
Removes a project from this application and removes it from the users view. Fires a "documentCount" property change event. Invokes method setApplication(null) on the project object.

Specified by:
remove in interface Application
Overrides:
remove 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()

initApplicationActions

protected void initApplicationActions()

initProjectActions

protected void initProjectActions(Project p)
Specified by:
initProjectActions in class AbstractApplication

show

public void show(Project p)
Description copied from interface: Application
Shows a project.


wrapProjectComponent

protected java.awt.Component wrapProjectComponent(Project p)
Returns the project component. Eventually wraps it into another component in order to provide additional functionality.


hide

public void hide(Project p)
Description copied from interface: Application
Hides a project.


dispose

public void dispose(Project p)
Description copied from interface: Application
This is a convenience method for removing a project and disposing it.

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

getCurrentProject

public Project getCurrentProject()
Description copied from interface: Application
Returns the current project. This is used for OSXApplication and MDIApplication which share actions among multiple Project instances. Current project may be become null, if the application has no project.

This is a bound property.


setCurrentProject

public void setCurrentProject(Project newValue)

createMenuBar

protected javax.swing.JMenuBar createMenuBar(Project p,
                                             java.util.List<javax.swing.Action> toolBarActions)
The project menu bar is displayed for a project. The default implementation returns a new screen menu bar.


createFileMenu

protected javax.swing.JMenu createFileMenu(Project p)

isSharingToolsAmongProjects

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


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.


createViewMenu

protected javax.swing.JMenu createViewMenu(Project p,
                                           java.util.List<javax.swing.Action> toolBarActions)

createHelpMenu

protected javax.swing.JMenu createHelpMenu(Project p)

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