org.jhotdraw.app
Class MDIApplication
- java.lang.Object
-
- org.jhotdraw.beans.AbstractBean
-
- org.jhotdraw.app.AbstractApplication
-
- org.jhotdraw.app.MDIApplication
-
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Cloneable, Application
public class MDIApplication extends AbstractApplication
MDIApplicationhandles the lifecycle of multipleViews 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
JFramewhich holds aJDesktopPane. The views reside inJInternalFrames inside of theJDesktopPane. 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 parentJFramequits the application. The parent frame has the following standard menus:File Edit Window Help
The 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 (
The menus provided by theAboutAction.ID)ApplicationModelare 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.- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class org.jhotdraw.app.AbstractApplication
VIEW_COUNT_PROPERTY
-
Fields inherited from interface org.jhotdraw.app.Application
ACTIVE_VIEW_PROPERTY, RECENT_URIS_PROPERTY
-
-
Constructor Summary
Constructors Constructor and Description MDIApplication()Creates a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidconfigure(java.lang.String[] args)Configures the application using the provided arguments array.javax.swing.JMenucreateEditMenu(View view)Creates an edit menu for the specified view or for the entire application.javax.swing.JMenucreateFileMenu(View view)Creates a file menu for the specified view or for the entire application.javax.swing.JMenucreateHelpMenu(View view)Creates a help menu for the specified view of for the entire application.javax.swing.JMenucreateViewMenu(View view)Creates a view menu for the specified view or for the entire application.javax.swing.JMenucreateWindowMenu(View view)Creates a window menu for the specified view or for the entire application.java.awt.ComponentgetComponent()Returns the application component.voidhide(View v)Hides a view.voidinit()Initializes the application.booleanisSharingToolsAmongViews()Returns true, if this application shares tools among multiple views.voidlaunch(java.lang.String[] args)Launches the application.voidshow(View v)Shows a view.-
Methods inherited from class org.jhotdraw.app.AbstractApplication
add, addPalette, addRecentURI, addWindow, clearRecentURIs, createContainer, createView, destroy, dispose, getActionMap, getActiveView, getCopyright, getExportChooser, getImportChooser, getModel, getName, getOpenChooser, getRecentURIs, getSaveChooser, getVersion, isEnabled, remove, removePalette, removeWindow, setActionMap, setActiveView, setEnabled, setModel, start, stop, views
-
Methods inherited from class org.jhotdraw.beans.AbstractBean
addPropertyChangeListener, addPropertyChangeListener, clone, getPropertyChangeListeners, removePropertyChangeListener, removePropertyChangeListener
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.jhotdraw.app.Application
addPropertyChangeListener, removePropertyChangeListener
-
-
-
-
Method Detail
-
init
public void init()
Description copied from interface:ApplicationInitializes the application.configure()should have been invoked before the application is inited. Alternatively an application can be configured using setter methods.- Specified by:
initin interfaceApplication- Overrides:
initin classAbstractApplication
-
launch
public void launch(java.lang.String[] args)
Description copied from class:AbstractApplicationLaunches the application.- Specified by:
launchin interfaceApplication- Overrides:
launchin classAbstractApplication- Parameters:
args- This implementation supports the command-line parameter "-open" which can be followed by one or more filenames or URI's.
-
configure
public void configure(java.lang.String[] args)
Description copied from interface:ApplicationConfigures the application using the provided arguments array.- Specified by:
configurein interfaceApplication- Overrides:
configurein classAbstractApplication
-
show
public void show(View v)
Description copied from interface:ApplicationShows a view.
-
hide
public void hide(View v)
Description copied from interface:ApplicationHides a view.
-
isSharingToolsAmongViews
public boolean isSharingToolsAmongViews()
Description copied from interface:ApplicationReturns true, if this application shares tools among multiple views.
-
getComponent
public java.awt.Component getComponent()
Description copied from interface:ApplicationReturns the application component. This may return null, if the application is not represented by a component of its own on the user interface.
-
createFileMenu
@Nullable public javax.swing.JMenu createFileMenu(View view)
Description copied from interface:ApplicationCreates a file menu for the specified view or for the entire application.- Parameters:
view- A view or null.- Returns:
- A JMenu or null, if the menu is empty.
-
createViewMenu
@Nullable public javax.swing.JMenu createViewMenu(View view)
Description copied from interface:ApplicationCreates a view menu for the specified view or for the entire application.- Parameters:
view- A view or null.- Returns:
- A JMenu or null, if the menu is empty.
-
createWindowMenu
@Nullable public javax.swing.JMenu createWindowMenu(View view)
Description copied from interface:ApplicationCreates a window menu for the specified view or for the entire application.- Parameters:
view- A view or null.- Returns:
- A JMenu or null, if the menu is empty.
-
createEditMenu
@Nullable public javax.swing.JMenu createEditMenu(View view)
Description copied from interface:ApplicationCreates an edit menu for the specified view or for the entire application.- Parameters:
view- A view or null.- Returns:
- A JMenu or null, if the menu is empty.
-
createHelpMenu
public javax.swing.JMenu createHelpMenu(View view)
Description copied from interface:ApplicationCreates a help menu for the specified view of for the entire application.- Parameters:
view- A view or null.- Returns:
- A JMenu or null, if the menu is empty.
-
-
DataMelt 3.0 © DataMelt by jWork.ORG