public class MDIApplication extends AbstractApplication
MDIApplication handles the lifecycle of multiple Views
using a Windows multiple document interface (MDI).
This user interface created by this application follows the guidelines given in the Windows User Experience Interaction Guidelines.
An application consists of a parent JFrame which holds a JDesktopPane.
The views reside in JInternalFrames inside of the JDesktopPane.
The parent frame also contains a menu bar, toolbars and palette windows for
the views.
The life cycle of the application is tied to the parent JFrame.
Closing the parent JFrame quits the application.
The parent frame has the following standard menus:
File Edit Window HelpThe file menu has the following standard menu items:
Clear (The edit menu has the following standard menu items:ClearFileAction.ID}) New (NewFileAction.ID}) New Window (NewWindowAction.ID}) Load... (LoadFileAction.ID}) Open... (OpenFileAction.ID}) Load Directory... (LoadDirectoryAction.ID}) Open Directory... (OpenDirectoryAction.ID}) Load Recent > "Filename" (LoadRecentFileAction.ID) Open Recent > "Filename" (OpenRecentFileAction.ID) - Close (CloseFileAction.ID) Save (SaveFileAction.ID) Save As... (SaveFileAsAction.ID) Export... (ExportFileAction.ID) Print... (PrintFileAction.ID) - Exit (ExitAction.ID)
Undo (The window menu has the following standard menu items:UndoAction.ID}) Redo (RedoAction.ID}) - Cut (CutAction.ID}) Copy (CopyAction.ID}) Paste (PasteAction.ID}) Duplicate (DuplicateAction.ID}) Delete... (DeleteAction.ID}) - Select All (SelectAllAction.ID}) Clear Selection (ClearSelectionAction.ID}) - Find (AbstractFindAction.ID}) - Settings (AbstractPreferencesAction.ID)
Arrange Cascade (The help menu has the following standard menu items:ArrangeWindowsAction.CASCADE_ID) Arrange Vertical (ArrangeWindowsAction.VERTICAL_ID) Arrange Horizontal (ArrangeWindowsAction.HORIZONTAL_ID) - "Filename" (FocusWindowAction) - "Toolbar" (ToggleToolBarAction)
About (AboutAction.ID)
The menus provided by the ApplicationModel are inserted between
the file menu and the window menu. In case the application model supplies
a menu with the title "Edit" or "Help", the standard menu items are added
with a seperator to the end of the menu.labels, model, VIEW_COUNT_PROPERTYpropertySupportACTIVE_VIEW_PROPERTY, RECENT_URIS_PROPERTY| Constructor and Description |
|---|
MDIApplication()
Creates a new instance.
|
| Modifier and Type | Method and Description |
|---|---|
void |
configure(java.lang.String[] args)
Configures the application using the provided arguments array.
|
javax.swing.JMenu |
createEditMenu(View view)
Creates an edit menu for the specified view or for the entire application.
|
javax.swing.JMenu |
createFileMenu(View view)
Creates a file menu for the specified view or for the entire application.
|
javax.swing.JMenu |
createHelpMenu(View view)
Creates a help menu for the specified view of for the entire application.
|
protected javax.swing.JMenuBar |
createMenuBar(View v)
Creates a menu bar.
|
protected javax.swing.ActionMap |
createModelActionMap(ApplicationModel mo) |
protected javax.swing.ActionMap |
createViewActionMap(View v) |
javax.swing.JMenu |
createViewMenu(View view)
Creates a view menu for the specified view or for the entire application.
|
javax.swing.JMenu |
createWindowMenu(View view)
Creates a window menu for the specified view or for the entire application.
|
java.awt.Component |
getComponent()
Returns the application component.
|
void |
hide(View v)
Hides a view.
|
void |
init()
Initializes the application.
|
protected void |
initLookAndFeel() |
boolean |
isSharingToolsAmongViews()
Returns true, if this application shares tools among multiple views.
|
void |
launch(java.lang.String[] args)
Launches the application.
|
void |
show(View v)
Shows a view.
|
protected void |
updateViewTitle(View v,
javax.swing.JInternalFrame f)
Updates the title of a view and displays it in the given frame.
|
protected java.awt.Component |
wrapDesktopPane(java.awt.Component c,
java.util.LinkedList<javax.swing.Action> toolBarActions)
Returns the wrapped desktop pane.
|
add, addAction, addAction, addMenuItem, addPalette, addRecentURI, addWindow, basicCreateView, clearRecentURIs, createContainer, createOpenRecentFileMenu, createView, destroy, dispose, getAction, getActionMap, getActiveView, getCopyright, getExportChooser, getImportChooser, getModel, getName, getOpenChooser, getOpenURIsFromMainArgs, getRecentURIs, getSaveChooser, getVersion, initLabels, isEnabled, maybeAddSeparator, remove, removePalette, removeWindow, setActionMap, setActiveView, setEnabled, setModel, start, stop, viewsaddPropertyChangeListener, addPropertyChangeListener, clone, firePropertyChange, firePropertyChange, firePropertyChange, getPropertyChangeListeners, removePropertyChangeListener, removePropertyChangeListenerequals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddPropertyChangeListener, removePropertyChangeListenerpublic void init()
Applicationconfigure() should have been invoked before the application
is inited. Alternatively an application can be configured using setter
methods.init in interface Applicationinit in class AbstractApplicationprotected javax.swing.ActionMap createModelActionMap(ApplicationModel mo)
protected javax.swing.ActionMap createViewActionMap(View v)
createViewActionMap in class AbstractApplicationpublic void launch(java.lang.String[] args)
AbstractApplicationlaunch in interface Applicationlaunch in class AbstractApplicationargs - This implementation supports the command-line parameter "-open"
which can be followed by one or more filenames or URI's.public void configure(java.lang.String[] args)
Applicationconfigure in interface Applicationconfigure in class AbstractApplicationprotected void initLookAndFeel()
public void show(View v)
Applicationpublic void hide(View v)
Applicationpublic boolean isSharingToolsAmongViews()
Applicationpublic java.awt.Component getComponent()
Applicationprotected java.awt.Component wrapDesktopPane(java.awt.Component c,
java.util.LinkedList<javax.swing.Action> toolBarActions)
protected javax.swing.JMenuBar createMenuBar(View v)
public javax.swing.JMenu createFileMenu(View view)
Applicationview - A view or null.protected void updateViewTitle(View v, javax.swing.JInternalFrame f)
v - The view.f - The frame.public javax.swing.JMenu createViewMenu(View view)
Applicationview - A view or null.public javax.swing.JMenu createWindowMenu(View view)
Applicationview - A view or null.public javax.swing.JMenu createEditMenu(View view)
Applicationview - A view or null.public javax.swing.JMenu createHelpMenu(View view)
Applicationview - A view or null.