|
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()
Application
configure()
should have been invoked before the application
is inited. Alternatively an application can be configured using setter
methods.
init
in interface Application
public void start()
Application
init()
must have been invoked before the application is started.
start
in interface Application
public final View createView()
Application
View.init()
.
createView
in interface Application
public void setModel(ApplicationModel newValue)
Application
setModel
in interface Application
public ApplicationModel getModel()
Application
getModel
in interface Application
protected View basicCreateView()
public void setActiveView(View newValue)
newValue
- Active view, can be null.public View getActiveView()
getActiveView
in interface Application
public java.lang.String getName()
Application
getName
in interface Application
public java.lang.String getVersion()
Application
getVersion
in interface Application
public java.lang.String getCopyright()
Application
getCopyright
in interface Application
public void stop()
Application
init()
must have been invoked before the application is stopped.
stop
in interface Application
public void destroy()
Application
destroy
in interface Application
public void remove(View v)
Application
remove
in interface Application
public void add(View v)
Application
add
in interface Application
protected abstract javax.swing.ActionMap createViewActionMap(View p)
public void dispose(View view)
Application
dispose
in interface Application
public java.util.Collection<View> views()
Application
views
in interface Application
public boolean isEnabled()
Application
isEnabled
in interface Application
public void setEnabled(boolean newValue)
Application
setEnabled
in interface Application
public java.awt.Container createContainer()
public void launch(java.lang.String[] args)
Application
launch
in interface Application
protected void initLabels()
public void configure(java.lang.String[] args)
Application
configure
in interface Application
public void removePalette(java.awt.Window palette)
Application
removePalette
in interface Application
public void addPalette(java.awt.Window palette)
Application
addPalette
in interface Application
public void removeWindow(java.awt.Window window)
Application
removeWindow
in interface Application
public void addWindow(java.awt.Window window, View p)
Application
addWindow
in interface Application
window
- 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 Application
public void clearRecentURIs()
Application
clearRecentURIs
in interface Application
public void addRecentURI(java.net.URI uri)
Application
addRecentURI
in interface Application
protected javax.swing.JMenu createOpenRecentFileMenu(View view)
public URIChooser getOpenChooser(View v)
Application
getOpenChooser
in interface Application
v
- A view or null.
public URIChooser getSaveChooser(View v)
Application
getSaveChooser
in interface Application
v
- A view or null.
public URIChooser getImportChooser(View v)
Application
getImportChooser
in interface Application
v
- A view or null.
public URIChooser getExportChooser(View v)
Application
getExportChooser
in interface Application
v
- A view or null.
public void setActionMap(javax.swing.ActionMap m)
public javax.swing.ActionMap getActionMap(View v)
getActionMap
in interface Application
v
- 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 |