|
JHotDraw 7.0.9 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectapplication.Application
org.jhotdraw.application.AbstractDocumentOrientedApplication
public abstract class AbstractDocumentOrientedApplication
Base class for DocumentOrientedApplication
s.
Field Summary | |
---|---|
static java.lang.String |
PROP_CURRENT_VIEW
|
static java.lang.String |
PROP_VIEW_COUNT
|
Constructor Summary | |
---|---|
AbstractDocumentOrientedApplication()
|
Method Summary | ||
---|---|---|
void |
add(DocumentView v)
Adds a view to this application. |
|
void |
addPalette(java.awt.Window w)
Adds a palette window to the application. |
|
void |
addRecentFile(java.io.File file)
Appends a file to the list of recent files. |
|
void |
clearRecentFiles()
Clears the list of recent files. |
|
protected javax.swing.ActionMap |
createActionMap()
Creates an action map for actions which haven not been defined using the |
|
protected javax.swing.JMenu |
createEditMenu(DocumentView v)
Creates the edit menu. |
|
protected javax.swing.JMenu |
createFileMenu(DocumentView v)
Creates the file menu. |
|
protected javax.swing.JMenu |
createHelpMenu(DocumentView v)
Creates the help menu. |
|
protected javax.swing.JMenuBar |
createMenuBar(DocumentView v,
java.util.List<javax.swing.Action> toolBarActions)
Creates a menu bar. |
|
protected java.util.LinkedList<javax.swing.JMenu> |
createMenus(DocumentView v)
Creates the menus for the application. |
|
protected java.util.LinkedList<javax.swing.JToolBar> |
createToolBars(DocumentView v)
Creates the toolbars for the application. |
|
DocumentView |
createView()
Creates a new view. |
|
protected javax.swing.JMenu |
createViewMenu(DocumentView v)
Creates the view menu. |
|
protected javax.swing.JMenu |
createWindowMenu(DocumentView v)
Creates the window menu. |
|
protected void |
destroyView(DocumentView v)
Destroys the view. |
|
javax.swing.Action |
getAction(java.lang.Object key)
Convenience method for getting an action with the specified key from the ActionMap of the application. |
|
abstract DocumentView |
getCurrentView()
Returns the current view. |
|
protected ResourceMap |
getFrameworkResourceMap()
Convenience method for getting the resource map of the JHotDraw application framework. |
|
protected ResourceMap |
getResourceMap()
Convenience method for getting the resource map of the current application. |
|
abstract java.lang.Class |
getViewClass()
|
|
java.util.List<DocumentView> |
getViews()
Returns a read only collection of all the views of this application. |
|
abstract void |
hide(DocumentView v)
Hides a view. |
|
protected void |
initActionMap()
Initializes the action map of the application. |
|
static void |
initAWT(java.lang.String[] args)
Initializes AWT before it is started. |
|
protected void |
initDefaults()
Initializes the defaults of the application.. |
|
void |
initialize(java.lang.String[] args)
Initializes the application. |
|
protected void |
initLookAndFeel()
Initializes the look and feel of the application. |
|
protected void |
initMainFrame()
Initializes the main frame of the application - if there is one. |
|
protected void |
initRecentFiles()
Initializes the recent files of the application. |
|
protected void |
initView(DocumentView v)
Initializes the view. |
|
abstract boolean |
isEditorShared()
Returns true, if this application shares an editor among multiple views. |
|
boolean |
isEnabled()
Returns true, if the application is globally enabled. |
|
static
|
launch(java.lang.Class<T> applicationClass,
java.lang.String[] args)
Launches the application. |
|
java.util.List<java.io.File> |
recentFiles()
Returns the recently opened files. |
|
void |
remove(DocumentView v)
Removes a view from this application. |
|
void |
removePalette(java.awt.Window w)
Removes a palette window from the application. |
|
void |
setEnabled(boolean newValue)
Globally enable/disable the application. |
|
abstract void |
show(DocumentView v)
Shows a view. |
|
void |
shutdown()
Stops the application without saving any unsaved getViews. |
|
void |
startup()
Starts the application. |
|
void |
updateName(DocumentView v)
Updates the name of the supplied view. |
|
protected void |
updateOpenRecentMenu(javax.swing.JMenu openRecentMenu)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.jhotdraw.application.DocumentOrientedApplication |
---|
addPropertyChangeListener, getComponent, removePropertyChangeListener |
Field Detail |
---|
public static final java.lang.String PROP_VIEW_COUNT
public static final java.lang.String PROP_CURRENT_VIEW
Constructor Detail |
---|
public AbstractDocumentOrientedApplication()
Method Detail |
---|
public static <T extends AbstractDocumentOrientedApplication> void launch(java.lang.Class<T> applicationClass, java.lang.String[] args)
public static void initAWT(java.lang.String[] args)
public void initialize(java.lang.String[] args)
initDefaults
.
initialize
in interface DocumentOrientedApplication
protected void initDefaults()
protected void initMainFrame()
protected void initRecentFiles()
initDefaults
.
protected void initActionMap()
initDefaults
.
protected void initLookAndFeel()
initDefaults
.
public void startup()
initialize()
must have been invoked before the application
is started.
startup
in interface DocumentOrientedApplication
public void shutdown()
initialize()
must have been invoked before the application is stopped.
shutdown
in interface DocumentOrientedApplication
protected javax.swing.ActionMap createActionMap()
public javax.swing.Action getAction(java.lang.Object key)
getAction
in interface DocumentOrientedApplication
public final DocumentView createView()
createView
in interface DocumentOrientedApplication
public abstract java.lang.Class getViewClass()
protected void initView(DocumentView v)
protected void destroyView(DocumentView v)
protected java.util.LinkedList<javax.swing.JToolBar> createToolBars(DocumentView v)
protected javax.swing.JMenuBar createMenuBar(DocumentView v, java.util.List<javax.swing.Action> toolBarActions)
protected java.util.LinkedList<javax.swing.JMenu> createMenus(DocumentView v)
protected javax.swing.JMenu createFileMenu(DocumentView v)
protected void updateOpenRecentMenu(javax.swing.JMenu openRecentMenu)
protected javax.swing.JMenu createEditMenu(DocumentView v)
protected javax.swing.JMenu createViewMenu(DocumentView v)
toolbarActions
- Toolbar actions. This value is null, if the toolbar
actions do not get into this menu.protected javax.swing.JMenu createWindowMenu(DocumentView v)
toolbarActions
- Toolbar actions. This value is null, if the toolbar
actions do not get into this menu.protected javax.swing.JMenu createHelpMenu(DocumentView v)
public void add(DocumentView v)
init
on the view.
Fires a "viewCount" property change event.
Invokes method setApplication(this) on the view object.
add
in interface DocumentOrientedApplication
public void remove(DocumentView v)
destroy
on the view.
Fires a "documentCount" property change event.
Invokes method setApplication(null) on the view object.
remove
in interface DocumentOrientedApplication
public java.util.List<DocumentView> getViews()
getViews
in interface DocumentOrientedApplication
public abstract void show(DocumentView v)
start
on the view.
show
in interface DocumentOrientedApplication
public abstract void hide(DocumentView v)
stop
on the view.
hide
in interface DocumentOrientedApplication
public abstract DocumentView getCurrentView()
This is a bound property.
getCurrentView
in interface DocumentOrientedApplication
public boolean isEnabled()
isEnabled
in interface DocumentOrientedApplication
public void setEnabled(boolean newValue)
setEnabled
in interface DocumentOrientedApplication
public abstract boolean isEditorShared()
isEditorShared
in interface DocumentOrientedApplication
public java.util.List<java.io.File> recentFiles()
recentFiles
in interface DocumentOrientedApplication
public void clearRecentFiles()
clearRecentFiles
in interface DocumentOrientedApplication
public void addRecentFile(java.io.File file)
addRecentFile
in interface DocumentOrientedApplication
public void addPalette(java.awt.Window w)
DocumentOrientedApplication
addPalette
in interface DocumentOrientedApplication
public void removePalette(java.awt.Window w)
DocumentOrientedApplication
removePalette
in interface DocumentOrientedApplication
public void updateName(DocumentView v)
protected ResourceMap getResourceMap()
protected ResourceMap getFrameworkResourceMap()
|
Copyright 1996-2007 (c) JHotDraw.org. Some rights reserved. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |