public abstract class AbstractApplicationModel extends AbstractBean implements ApplicationModel
ApplicationModel.| Modifier and Type | Field and Description |
|---|---|
protected boolean |
allowMultipleViewsForURI |
protected java.lang.String |
copyright |
static java.lang.String |
COPYRIGHT_PROPERTY |
protected java.lang.String |
name |
static java.lang.String |
NAME_PROPERTY |
protected boolean |
openLastURIOnLaunch |
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 |
propertySupport| Constructor and Description |
|---|
AbstractApplicationModel()
Creates a new instance.
|
| Modifier and Type | Method and Description |
|---|---|
URIChooser |
createExportChooser(Application a,
View v)
Returns createSaveChooser.
|
URIChooser |
createImportChooser(Application a,
View v)
Returns createOpenChooser.
|
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.
|
boolean |
isAllowMultipleViewsPerURI()
Returns true if the application may open multiple views for the same
URI.
|
boolean |
isOpenLastURIOnLaunch()
Returns true if the application should open the last opened URI on launch
instead of opening an empty view.
|
void |
setAllowMultipleViewsForURI(boolean allowMultipleViewsForURI)
Whether the application may open multiple views for the same URI.
|
void |
setCopyright(java.lang.String newValue) |
void |
setName(java.lang.String newValue) |
void |
setOpenLastURIOnLaunch(boolean openLastURIOnLaunch)
Whether the application should open the last opened URI on launch.
|
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.
|
addPropertyChangeListener, addPropertyChangeListener, clone, firePropertyChange, firePropertyChange, firePropertyChange, getPropertyChangeListeners, removePropertyChangeListener, removePropertyChangeListenerequals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcreateActionMap, getMenuBuilderprotected java.lang.String name
protected java.lang.String version
protected java.lang.String copyright
protected java.lang.Class<?> viewClass
protected java.lang.String viewClassName
protected boolean allowMultipleViewsForURI
protected boolean openLastURIOnLaunch
public static final java.lang.String NAME_PROPERTY
public static final java.lang.String VERSION_PROPERTY
public static final java.lang.String COPYRIGHT_PROPERTY
public static final java.lang.String VIEW_CLASS_NAME_PROPERTY
public static final java.lang.String VIEW_CLASS_PROPERTY
public AbstractApplicationModel()
public void setName(java.lang.String newValue)
public java.lang.String getName()
ApplicationModelgetName in interface ApplicationModelpublic void setVersion(java.lang.String newValue)
public java.lang.String getVersion()
ApplicationModelgetVersion in interface ApplicationModelpublic void setCopyright(java.lang.String newValue)
public java.lang.String getCopyright()
ApplicationModelgetCopyright in interface ApplicationModelpublic void setViewClassName(java.lang.String newValue)
newValue - the class namepublic void setViewClass(java.lang.Class<?> newValue)
newValue - the classpublic java.lang.Class<?> getViewClass()
public View createView()
ApplicationModelcreateView in interface ApplicationModelpublic abstract java.util.List<javax.swing.JToolBar> createToolBars(Application a, @Nullable View p)
createToolBars in interface ApplicationModela - Application.p - The view for which the toolbars need to be created, or null
if the toolbars are shared by multiple views.public void initView(Application a, View p)
initView in interface ApplicationModela - the applicationp - the viewpublic void destroyView(Application a, View p)
destroyView in interface ApplicationModela - the applicationp - the viewpublic void initApplication(Application a)
initApplication in interface ApplicationModela - the applicationpublic void destroyApplication(Application a)
destroyApplication in interface ApplicationModela - the applicationpublic URIChooser createOpenChooser(Application a, @Nullable View v)
ApplicationModelcreateOpenChooser in interface ApplicationModela - Application.v - The view for which the chooser needs to be created, or null
if the chooser is shared by multiple views.public URIChooser createOpenDirectoryChooser(Application a, @Nullable View v)
ApplicationModelcreateOpenDirectoryChooser in interface ApplicationModela - Application.v - The view for which the chooser needs to be created, or null
if the chooser is shared by multiple views.public URIChooser createSaveChooser(Application a, @Nullable View v)
ApplicationModelcreateSaveChooser in interface ApplicationModela - Application.v - The view for which the chooser needs to be created, or null
if the chooser is shared by multiple views.public URIChooser createImportChooser(Application a, @Nullable View v)
createImportChooser in interface ApplicationModela - Application.v - The view for which the chooser needs to be created, or null
if the chooser is shared by multiple views.public URIChooser createExportChooser(Application a, @Nullable View v)
createExportChooser in interface ApplicationModela - Application.v - The view for which the chooser needs to be created, or null
if the chooser is shared by multiple views.public boolean isOpenLastURIOnLaunch()
This method defines an API for the Open last URI on Launch feature.
See org.jhotdraw.app.
The default value is true.
isOpenLastURIOnLaunch in interface ApplicationModelpublic boolean isAllowMultipleViewsPerURI()
This method defines an API for the Allow multiple views for URI feature.
See org.jhotdraw.app.
The default value is true.
isAllowMultipleViewsPerURI in interface ApplicationModelpublic void setAllowMultipleViewsForURI(boolean allowMultipleViewsForURI)
The default value is true.
allowMultipleViewsForURI - the valuepublic void setOpenLastURIOnLaunch(boolean openLastURIOnLaunch)
The default value is false.
openLastURIOnLaunch -