Class SDIApplication
- java.lang.Object
-
- org.jhotdraw.beans.AbstractBean
-
- org.jhotdraw.app.AbstractApplication
-
- org.jhotdraw.app.SDIApplication
-
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Cloneable, Application
public class SDIApplication extends AbstractApplication
SDIApplicationhandles the lifecycle of multipleViews using a Windows single document interface (SDI).This user interface created by this application follows the guidelines given in the Windows User Experience Interaction Guidelines.
An application of this type can open multiple
Views. Each view is shown in a separateJFrame.Each JFrame contains a menu bar, toolbars and palette bars for the views.
The life cycle of the application is tied to the
JFrames. Closing the lastJFramequits the application. SDIApplication handles the life cycle of a single document window being presented in a JFrame. The JFrame provides all the functionality needed to work with the document, such as a menu bar, tool bars and palette windows.The life cycle of the application is tied to the JFrame. Closing the JFrame quits the application.
The menu bar of a JFrame has the following standard menus:
File Edit View 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) - Save (SaveFileAction.ID) Save As... (SaveFileAsAction.ID) Export... (ExportFileAction.ID) Print... (PrintFileAction.ID) - Close (CloseFileAction.ID)Undo (
The view 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}) - Preferences... (AbstractPreferencesAction.ID)"Toolbar" (
The view menu has the following standard menu items:ToggleVisibleAction)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 "Help", it is inserted after the window 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 SDIApplication()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 p)Creates a help menu for the specified view of for the entire application.javax.swing.JMenucreateViewMenu(View view)Creates the view menu.javax.swing.JMenucreateWindowMenu(View view)Creates a window menu for the specified view or for the entire application.voiddispose(View p)This is a convenience method for removing a view and disposing it.java.awt.ComponentgetComponent()Returns the application component.voidhide(View p)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.voidremove(View p)Removes a view from this application and removes it from the users view.voidshow(View view)Shows a view.-
Methods inherited from class org.jhotdraw.app.AbstractApplication
add, addPalette, addRecentURI, addWindow, clearRecentURIs, createContainer, createView, destroy, getActionMap, getActiveView, getCopyright, getExportChooser, getImportChooser, getModel, getName, getOpenChooser, getRecentURIs, getSaveChooser, getVersion, isEnabled, 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
-
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.
-
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
-
remove
public void remove(View p)
Description copied from interface:ApplicationRemoves a view from this application and removes it from the users view. Fires a "documentCount" property change event. Invokes method setApplication(null) on the view object.- Specified by:
removein interfaceApplication- Overrides:
removein classAbstractApplication
-
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 view)
Description copied from interface:ApplicationShows a view.
-
hide
public void hide(View p)
Description copied from interface:ApplicationHides a view.
-
dispose
public void dispose(View p)
Description copied from interface:ApplicationThis is a convenience method for removing a view and disposing it.- Specified by:
disposein interfaceApplication- Overrides:
disposein classAbstractApplication
-
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.
-
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.
-
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.
-
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.
-
createViewMenu
public javax.swing.JMenu createViewMenu(View view)
Creates the view menu.- Parameters:
view- The View- Returns:
- A JMenu or null, if the menu doesn't have any items.
-
createHelpMenu
public javax.swing.JMenu createHelpMenu(View p)
Description copied from interface:ApplicationCreates a help menu for the specified view of for the entire application.- Parameters:
p- A view or null.- Returns:
- A JMenu or null, if the menu is empty.
-
-
DataMelt 3.0 © DataMelt by jWork.ORG