|
JHotDraw 7.5.1 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.jhotdraw.beans.AbstractBean
org.jhotdraw.app.AbstractApplication
public abstract class AbstractApplication
This abstract class can be extended to implement an Application.
| Field Summary | |
|---|---|
protected ResourceBundleUtil |
labels
|
protected ApplicationModel |
model
|
static java.lang.String |
VIEW_COUNT_PROPERTY
|
| Fields inherited from class org.jhotdraw.beans.AbstractBean |
|---|
propertySupport |
| Fields inherited from interface org.jhotdraw.app.Application |
|---|
ACTIVE_VIEW_PROPERTY, RECENT_URIS_PROPERTY |
| Constructor Summary | |
|---|---|
AbstractApplication()
Creates a new instance. |
|
| Method Summary | |
|---|---|
void |
add(View v)
Adds a view to this application. |
protected void |
addAction(javax.swing.JMenu m,
javax.swing.Action a)
Adds the specified action as a menu item to the supplied menu. |
protected void |
addAction(javax.swing.JMenu m,
View view,
java.lang.String actionID)
Adds the specified action as a menu item to the supplied menu. |
protected void |
addMenuItem(javax.swing.JMenu m,
javax.swing.JMenuItem mi)
Adds the specified action as a menu item to the supplied menu. |
void |
addPalette(java.awt.Window palette)
Adds a palette window to the application. |
void |
addRecentURI(java.net.URI uri)
Appends a URI to the list of recent URIs. |
void |
addWindow(java.awt.Window window,
View p)
Adds a (non-palette) window to the application. |
protected View |
basicCreateView()
|
void |
clearRecentURIs()
Clears the list of recent URIs. |
void |
configure(java.lang.String[] args)
Configures the application using the provided arguments array. |
java.awt.Container |
createContainer()
|
protected javax.swing.JMenu |
createOpenRecentFileMenu(View view)
|
View |
createView()
Creates a new view for this application and initializes it, by calling View.init(). |
protected abstract javax.swing.ActionMap |
createViewActionMap(View p)
|
void |
destroy()
Destroys the application and calls System.exit(0). |
void |
dispose(View view)
This is a convenience method for removing a view and disposing it. |
protected javax.swing.Action |
getAction(View view,
java.lang.String actionID)
|
javax.swing.ActionMap |
getActionMap(View v)
Gets the action map. |
View |
getActiveView()
Gets the active view. |
java.lang.String |
getCopyright()
Returns the copyright of the application. |
URIChooser |
getExportChooser(View v)
Gets an export chooser for the specified view or for the entire application. |
URIChooser |
getImportChooser(View v)
Gets an import chooser for the specified view or for the entire application. |
ApplicationModel |
getModel()
Returns the application model. |
java.lang.String |
getName()
Returns the name of the application. |
URIChooser |
getOpenChooser(View v)
Gets an open chooser for the specified view or for the entire application. |
java.util.List<java.net.URI> |
getRecentURIs()
Returns the recently opened URIs. |
URIChooser |
getSaveChooser(View v)
Gets a save chooser for the specified view or for the entire application. |
java.lang.String |
getVersion()
Returns the version of the application. |
void |
init()
Initializes the application. |
protected void |
initLabels()
|
boolean |
isEnabled()
Returns the enabled state of the application. |
void |
launch(java.lang.String[] args)
Launches the application from the main method. |
protected void |
maybeAddSeparator(javax.swing.JMenu m)
Adds a separator to the supplied menu. |
void |
remove(View v)
Removes a view from this application and removes it from the users view. |
void |
removePalette(java.awt.Window palette)
Removes a palette window from the application. |
void |
removeWindow(java.awt.Window window)
Removes a (non-palette) window from the application. |
void |
setActionMap(javax.swing.ActionMap m)
Sets the application-wide action map. |
void |
setActiveView(View newValue)
Sets the active view. |
void |
setEnabled(boolean newValue)
Sets the enabled state of the application. |
void |
setModel(ApplicationModel newValue)
Sets the application model. |
void |
start()
Starts the application. |
void |
stop()
Stops the application without saving any unsaved views. |
java.util.Collection<View> |
views()
Returns a read only collection view of the views of this application. |
| 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.Application |
|---|
addPropertyChangeListener, createEditMenu, createFileMenu, createHelpMenu, createViewMenu, createWindowMenu, getComponent, hide, isSharingToolsAmongViews, removePropertyChangeListener, show |
| Field Detail |
|---|
protected ResourceBundleUtil labels
protected ApplicationModel model
public static final java.lang.String VIEW_COUNT_PROPERTY
| Constructor Detail |
|---|
public AbstractApplication()
| Method Detail |
|---|
public void init()
Applicationconfigure() should have been invoked before the application
is inited. Alternatively an application can be configured using setter
methods.
init in interface Applicationpublic void start()
Applicationinit() must have been invoked before the application is started.
start in interface Applicationpublic final View createView()
ApplicationView.init().
createView in interface Applicationpublic void setModel(ApplicationModel newValue)
Application
setModel in interface Applicationpublic ApplicationModel getModel()
Application
getModel in interface Applicationprotected View basicCreateView()
public void setActiveView(View newValue)
newValue - Active view, can be null.public View getActiveView()
getActiveView in interface Applicationpublic java.lang.String getName()
Application
getName in interface Applicationpublic java.lang.String getVersion()
Application
getVersion in interface Applicationpublic java.lang.String getCopyright()
Application
getCopyright in interface Applicationpublic void stop()
Applicationinit() must have been invoked before the application is stopped.
stop in interface Applicationpublic void destroy()
Application
destroy in interface Applicationpublic void remove(View v)
Application
remove in interface Applicationpublic void add(View v)
Application
add in interface Applicationprotected abstract javax.swing.ActionMap createViewActionMap(View p)
public void dispose(View view)
Application
dispose in interface Applicationpublic java.util.Collection<View> views()
Application
views in interface Applicationpublic boolean isEnabled()
Application
isEnabled in interface Applicationpublic void setEnabled(boolean newValue)
Application
setEnabled in interface Applicationpublic java.awt.Container createContainer()
public void launch(java.lang.String[] args)
Application
launch in interface Applicationprotected void initLabels()
public void configure(java.lang.String[] args)
Application
configure in interface Applicationpublic void removePalette(java.awt.Window palette)
Application
removePalette in interface Applicationpublic void addPalette(java.awt.Window palette)
Application
addPalette in interface Applicationpublic void removeWindow(java.awt.Window window)
Application
removeWindow in interface Application
public void addWindow(java.awt.Window window,
View p)
Application
addWindow in interface Applicationwindow - The window.p - The View to which this window is associated, or null
if the window is associated to the application.
protected javax.swing.Action getAction(View view,
java.lang.String actionID)
protected void addAction(javax.swing.JMenu m,
View view,
java.lang.String actionID)
protected void addAction(javax.swing.JMenu m,
javax.swing.Action a)
protected void addMenuItem(javax.swing.JMenu m,
javax.swing.JMenuItem mi)
protected void maybeAddSeparator(javax.swing.JMenu m)
public java.util.List<java.net.URI> getRecentURIs()
Application
getRecentURIs in interface Applicationpublic void clearRecentURIs()
Application
clearRecentURIs in interface Applicationpublic void addRecentURI(java.net.URI uri)
Application
addRecentURI in interface Applicationprotected javax.swing.JMenu createOpenRecentFileMenu(View view)
public URIChooser getOpenChooser(View v)
Application
getOpenChooser in interface Applicationv - A view or null.
public URIChooser getSaveChooser(View v)
Application
getSaveChooser in interface Applicationv - A view or null.
public URIChooser getImportChooser(View v)
Application
getImportChooser in interface Applicationv - A view or null.
public URIChooser getExportChooser(View v)
Application
getExportChooser in interface Applicationv - A view or null.
public void setActionMap(javax.swing.ActionMap m)
public javax.swing.ActionMap getActionMap(View v)
getActionMap in interface Applicationv - A view or null
|
Copyright 1996-2010 (c) by the authors and contributors of the JHotDraw project. Some rights reserved. |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||