org.jhotdraw.app
Interface ApplicationModel

All Known Implementing Classes:
DefaultApplicationModel, DrawApplicationModel, NetApplicationModel, ODGApplicationModel, PertApplicationModel, SVGApplicationModel, TeddyApplicationModel

public interface ApplicationModel

ApplicationModel provides meta-data for an Application, actions and factory methods for creating Views and toolbars.


Design Patterns

Framework
The interfaces and classes listed below together with the Action classes in the org.jhotddraw.app.action package define the contracts of a framework for document oriented applications:
Contract: Application, ApplicationModel, View.


Version:
$Id: ApplicationModel.java 550 2009-09-02 18:57:29Z rawcoder $
Author:
Werner Randelshofer.

Method Summary
 java.util.List<javax.swing.JMenu> createMenus(Application a, View v)
          Creates menus.
 java.util.List<javax.swing.JToolBar> createToolBars(Application a, View v)
          Creates tool bars.
 View createView()
          Creates a new view 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.String getVersion()
          Returns the version of the application.
 void initApplication(Application a)
          Inits the application model.
 void initView(Application a, View v)
          Inits the supplied view for the application.
 void putAction(java.lang.String id, javax.swing.Action action)
          Puts an action with the specified id.
 

Method Detail

getName

java.lang.String getName()
Returns the name of the application.


getVersion

java.lang.String getVersion()
Returns the version of the application.


getCopyright

java.lang.String getCopyright()
Returns the copyright of the application.


createView

View createView()
Creates a new view for the application.


initView

void initView(Application a,
              View v)
Inits the supplied view for the application.


initApplication

void initApplication(Application a)
Inits the application model.

Typically, the application model creates a number of AbstractApplicationAction objects, which can later be retrieved using getAction, and which are linked to menu items and toolbars created by the application model.


putAction

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


getAction

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


createToolBars

java.util.List<javax.swing.JToolBar> createToolBars(Application a,
                                                    View v)
Creates tool bars.

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

Parameters:
a - Application.
v - The view for which the toolbars need to be created, or null if the toolbars are shared by multiple views.

createMenus

java.util.List<javax.swing.JMenu> createMenus(Application a,
                                              View v)
Creates menus.

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

Parameters:
a - Application.
v - The view for which the toolbars need to be created, or null if the menus are shared by multiple views.