JHotDraw 7.0.9

org.jhotdraw.app
Class DefaultApplicationModel

java.lang.Object
  extended by org.jhotdraw.beans.AbstractBean
      extended by org.jhotdraw.app.DefaultApplicationModel
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, ApplicationModel
Direct Known Subclasses:
DrawApplicationModel, NetApplicationModel, ODGApplicationModel, PertApplicationModel, SVGApplicationModel, TeddyApplicationModel

public class DefaultApplicationModel
extends AbstractBean
implements ApplicationModel

DefaultApplicationModel.

Version:
1.1 2007-01-11 Changed method createToolBars.
1.0 June 10, 2006 Created.
Author:
Werner Randelshofer.
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.jhotdraw.beans.AbstractBean
propertySupport
 
Constructor Summary
DefaultApplicationModel()
          Creates a new instance.
 
Method Summary
protected  javax.swing.JMenu createEditMenu(Application a, Project p)
           
 java.util.List<javax.swing.JMenu> createMenus(Application a, Project p)
          Creates menus.
 Project createProject()
          Creates a new project for the application.
 java.util.List<javax.swing.JToolBar> createToolBars(Application app, Project p)
          Creates toolbars for the application.
 javax.swing.Action getAction(java.lang.String id)
          Returns the action with the specified id.
 java.lang.String getCopyright()
          Returns the copyright of the application.
 java.lang.String getName()
          Returns the name of the application.
 java.lang.Class getProjectClass()
           
 java.lang.String getVersion()
          Returns the version of the application.
 void initApplication(Application a)
           
 void initProject(Application a, Project p)
           
 void putAction(java.lang.String id, javax.swing.Action action)
          Puts an action with the specified id.
 void setCopyright(java.lang.String newValue)
           
 void setName(java.lang.String newValue)
           
 void setProjectClass(java.lang.Class newValue)
          Use this method only, if setProjectClassName() does not suit you.
 void setProjectClassName(java.lang.String newValue)
          Use this method for best application startup performance.
 void setVersion(java.lang.String newValue)
           
 
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
 

Constructor Detail

DefaultApplicationModel

public DefaultApplicationModel()
Creates a new instance.

Method Detail

setName

public void setName(java.lang.String newValue)

getName

public java.lang.String getName()
Description copied from interface: ApplicationModel
Returns the name of the application.

Specified by:
getName in interface ApplicationModel

setVersion

public void setVersion(java.lang.String newValue)

getVersion

public java.lang.String getVersion()
Description copied from interface: ApplicationModel
Returns the version of the application.

Specified by:
getVersion in interface ApplicationModel

setCopyright

public void setCopyright(java.lang.String newValue)

getCopyright

public java.lang.String getCopyright()
Description copied from interface: ApplicationModel
Returns the copyright of the application.

Specified by:
getCopyright in interface ApplicationModel

setProjectClassName

public void setProjectClassName(java.lang.String newValue)
Use this method for best application startup performance.


setProjectClass

public void setProjectClass(java.lang.Class newValue)
Use this method only, if setProjectClassName() does not suit you.


getProjectClass

public java.lang.Class getProjectClass()

createProject

public Project createProject()
Description copied from interface: ApplicationModel
Creates a new project for the application.

Specified by:
createProject in interface ApplicationModel

createToolBars

public java.util.List<javax.swing.JToolBar> createToolBars(Application app,
                                                           Project p)
Creates toolbars for the application. This class creates a standard toolbar with the following buttons in it:

Specified by:
createToolBars in interface ApplicationModel
Parameters:
app - Application.
p - The project for which the toolbars need to be created, or null if the toolbar needs to be shared with multiple projects.

createMenus

public java.util.List<javax.swing.JMenu> createMenus(Application a,
                                                     Project p)
Description copied from interface: ApplicationModel
Creates menus.

Depending on the document interface of the application, this method may be invoked only once for the application, or for each opened project.

Specified by:
createMenus in interface ApplicationModel
Parameters:
a - Application.
p - The project for which the toolbars need to be created, or null if the toolbar needs to be shared with multiple projects.

createEditMenu

protected javax.swing.JMenu createEditMenu(Application a,
                                           Project p)

initProject

public void initProject(Application a,
                        Project p)
Specified by:
initProject in interface ApplicationModel

initApplication

public void initApplication(Application a)
Specified by:
initApplication in interface ApplicationModel

getAction

public javax.swing.Action getAction(java.lang.String id)
Returns the action with the specified id.

Specified by:
getAction in interface ApplicationModel

putAction

public void putAction(java.lang.String id,
                      javax.swing.Action action)
Puts an action with the specified id.

Specified by:
putAction in interface ApplicationModel

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