JHotDraw 7.4.1

org.jhotdraw.app
Class AbstractApplicationModel

java.lang.Object
  extended by org.jhotdraw.beans.AbstractBean
      extended by org.jhotdraw.app.AbstractApplicationModel
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, ApplicationModel
Direct Known Subclasses:
DefaultApplicationModel, EmptyApplicationModel

public abstract class AbstractApplicationModel
extends AbstractBean
implements ApplicationModel

AbstractApplicationModel.

Version:
1.0 2009-12-19 Created.
Author:
Werner Randelshofer
See Also:
Serialized Form

Field Summary
protected  java.lang.String copyright
           
static java.lang.String COPYRIGHT_PROPERTY
           
protected  java.lang.String name
           
static java.lang.String NAME_PROPERTY
           
protected  java.lang.String version
           
static java.lang.String VERSION_PROPERTY
           
static java.lang.String VIEW_CLASS_NAME_PROPERTY
           
static java.lang.String VIEW_CLASS_PROPERTY
           
protected  java.lang.Class viewClass
           
protected  java.lang.String viewClassName
           
 
Fields inherited from class org.jhotdraw.beans.AbstractBean
propertySupport
 
Constructor Summary
AbstractApplicationModel()
          Creates a new instance.
 
Method Summary
 URIChooser createExportChooser(Application a, View v)
          Returns createSaveChooser.
 URIChooser createImportChooser(Application a, View v)
          Returns createOpenChooser.
abstract  java.util.List<javax.swing.JMenu> createMenus(Application a, View p)
          Creates menus.
 URIChooser createOpenChooser(Application a, View v)
          Creates an open chooser.
 URIChooser createOpenDirectoryChooser(Application a, View v)
          Creates an open chooser for directories.
 URIChooser createSaveChooser(Application a, View v)
          Creates a save chooser.
abstract  java.util.List<javax.swing.JToolBar> createToolBars(Application a, View p)
          Creates toolbars for the application.
 View createView()
          Creates a new view for the application.
 void destroyApplication(Application a)
          This method is empty.
 void destroyView(Application a, View p)
          This method is empty.
 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.
 java.lang.Class getViewClass()
           
 void initApplication(Application a)
          This method is empty.
 void initView(Application a, View p)
          This method is empty.
 void setCopyright(java.lang.String newValue)
           
 void setName(java.lang.String newValue)
           
 void setVersion(java.lang.String newValue)
           
 void setViewClass(java.lang.Class newValue)
          Use this method only, if setViewClassName() does not suit you.
 void setViewClassName(java.lang.String newValue)
          Use this method for best application startup performance.
 
Methods inherited from class org.jhotdraw.beans.AbstractBean
addPropertyChangeListener, addPropertyChangeListener, clone, firePropertyChange, firePropertyChange, firePropertyChange, getPropertyChangeListeners, 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.ApplicationModel
createActionMap
 

Field Detail

name

protected java.lang.String name

version

protected java.lang.String version

copyright

protected java.lang.String copyright

viewClass

protected java.lang.Class viewClass

viewClassName

protected java.lang.String viewClassName

NAME_PROPERTY

public static final java.lang.String NAME_PROPERTY
See Also:
Constant Field Values

VERSION_PROPERTY

public static final java.lang.String VERSION_PROPERTY
See Also:
Constant Field Values

COPYRIGHT_PROPERTY

public static final java.lang.String COPYRIGHT_PROPERTY
See Also:
Constant Field Values

VIEW_CLASS_NAME_PROPERTY

public static final java.lang.String VIEW_CLASS_NAME_PROPERTY
See Also:
Constant Field Values

VIEW_CLASS_PROPERTY

public static final java.lang.String VIEW_CLASS_PROPERTY
See Also:
Constant Field Values
Constructor Detail

AbstractApplicationModel

public AbstractApplicationModel()
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

setViewClassName

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


setViewClass

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


getViewClass

public java.lang.Class getViewClass()

createView

public View createView()
Description copied from interface: ApplicationModel
Creates a new view for the application.

Specified by:
createView in interface ApplicationModel

createToolBars

public abstract java.util.List<javax.swing.JToolBar> createToolBars(Application a,
                                                                    View p)
Creates toolbars for the application.

Specified by:
createToolBars in interface ApplicationModel
Parameters:
a - Application.
p - The view for which the toolbars need to be created, or null if the toolbars are shared by multiple views.

createMenus

public abstract java.util.List<javax.swing.JMenu> createMenus(Application a,
                                                              View 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 view.

If this method creates a menu with the same title as a standard menu created by Application, the menu created by this method is used. This method can create a standard menu from scratch, or call one of the createMenu-methods in Application and add additional items to the menu.

Specified by:
createMenus in interface ApplicationModel
Parameters:
a - Application.
p - The view for which the toolbars need to be created, or null if the menus are shared by multiple views.

initView

public void initView(Application a,
                     View p)
This method is empty.

Specified by:
initView in interface ApplicationModel

destroyView

public void destroyView(Application a,
                        View p)
This method is empty.

Specified by:
destroyView in interface ApplicationModel

initApplication

public void initApplication(Application a)
This method is empty.

Specified by:
initApplication in interface ApplicationModel

destroyApplication

public void destroyApplication(Application a)
This method is empty.

Specified by:
destroyApplication in interface ApplicationModel

createOpenChooser

public URIChooser createOpenChooser(Application a,
                                    View v)
Description copied from interface: ApplicationModel
Creates an open chooser.

Specified by:
createOpenChooser in interface ApplicationModel
Parameters:
a - Application.
v - The view for which the chooser needs to be created, or null if the chooser is shared by multiple views.

createOpenDirectoryChooser

public URIChooser createOpenDirectoryChooser(Application a,
                                             View v)
Description copied from interface: ApplicationModel
Creates an open chooser for directories.

Specified by:
createOpenDirectoryChooser in interface ApplicationModel
Parameters:
a - Application.
v - The view for which the chooser needs to be created, or null if the chooser is shared by multiple views.

createSaveChooser

public URIChooser createSaveChooser(Application a,
                                    View v)
Description copied from interface: ApplicationModel
Creates a save chooser.

Specified by:
createSaveChooser in interface ApplicationModel
Parameters:
a - Application.
v - The view for which the chooser needs to be created, or null if the chooser is shared by multiple views.

createImportChooser

public URIChooser createImportChooser(Application a,
                                      View v)
Returns createOpenChooser.

Specified by:
createImportChooser in interface ApplicationModel
Parameters:
a - Application.
v - The view for which the chooser needs to be created, or null if the chooser is shared by multiple views.

createExportChooser

public URIChooser createExportChooser(Application a,
                                      View v)
Returns createSaveChooser.

Specified by:
createExportChooser in interface ApplicationModel
Parameters:
a - Application.
v - The view for which the chooser needs to be created, or null if the chooser is shared by multiple views.

Copyright 1996-2010 (c) by the authors and contributors of the JHotDraw project.
Some rights reserved.