|
|||||||||
| 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
org.jhotdraw.app.DefaultOSXApplication
public class DefaultOSXApplication
DefaultOSXApplication handles the lifecycle of Views using a
Mac OS X document interface.
An application consists of a screen menu bar and JFrames for the
Views. The application also provides floating toolbars and palette
windows for the views.
The life cycle of the application is tied to the screen menu bar. Choosing the quit action in the screen menu bar quits the application.
The screen menu bar has the following standard menus:
"Application-Name" File WindowThe first menu, is the application menu. It has the following standard menu items:
About "Application-Name" (The file menu has the following standard menu items:AboutAction.ID) - Preferences... (AbstractPreferencesAction.ID) - Services - Hide "Application-Name" Hide Others Show All - Quit "Application-Name" (ExitAction.ID)
New (The window menu has the following standard menu items:NewAction.ID}) Open... (OpenAction.ID}) Open Recent > "Filename" (OpenRecentAction.ID) - Close (CloseAction.ID) Save (SaveAction.ID) Save As... (SaveAsAction.ID) - Print... (PrintAction.ID)
Minimize (The menus provided by theMinimizeAction.ID) Zoom (MaximizeAction.ID) - "Filename" (FocusAction.ID)
ApplicationModel are 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.
| Nested Class Summary | |
|---|---|
private class |
DefaultOSXApplication.FrameHandler
Updates the modifedState of the frame. |
private class |
DefaultOSXApplication.OpenRecentMenuHandler
Updates the menu items in the "Open Recent" file menu. |
private class |
DefaultOSXApplication.WindowMenuHandler
Updates the menu items in the "Open Recent" file menu. |
| Field Summary | |
|---|---|
private java.util.LinkedList<javax.swing.Action> |
paletteActions
|
private OSXPaletteHandler |
paletteHandler
|
private java.util.prefs.Preferences |
prefs
|
| Fields inherited from class org.jhotdraw.app.AbstractApplication |
|---|
labels, VIEW_COUNT_PROPERTY |
| Fields inherited from class org.jhotdraw.beans.AbstractBean |
|---|
propertySupport |
| Fields inherited from interface org.jhotdraw.app.Application |
|---|
ACTIVE_VIEW_PROPERTY |
| Constructor Summary | |
|---|---|
DefaultOSXApplication()
Creates a new instance. |
|
| Method Summary | |
|---|---|
void |
addPalette(java.awt.Window palette)
Adds a palette window to the application. |
void |
addWindow(java.awt.Window window,
View view)
Adds a (non-palette) window to the application. |
void |
configure(java.lang.String[] args)
Configures the application using the provided arguments array. |
protected javax.swing.JMenu |
createFileMenu(View view)
|
protected javax.swing.JMenuBar |
createMenuBar(View p)
Creates a menu bar. |
protected javax.swing.JMenu |
createWindowMenu(View view)
|
void |
dispose(View p)
This is a convenience method for removing a view and disposing it. |
java.awt.Component |
getComponent()
Returns the application component. |
void |
hide(View p)
Hides a view. |
void |
init()
Initializes the application. |
protected void |
initApplicationActions()
|
protected void |
initLookAndFeel()
|
protected void |
initPalettes(java.util.LinkedList<javax.swing.Action> paletteActions)
|
protected void |
initScreenMenuBar()
|
protected void |
initViewActions(View p)
|
boolean |
isSharingToolsAmongViews()
Returns true, if this application shares tools among multiple views. |
void |
launch(java.lang.String[] args)
Launches the application from the main method. |
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 |
show(View view)
Shows a view. |
protected void |
updateViewTitle(View p,
javax.swing.JFrame f)
Updates the title of a view and displays it in the given frame. |
| Methods inherited from class org.jhotdraw.app.AbstractApplication |
|---|
add, addRecentFile, basicCreateView, clearRecentFiles, createContainer, createView, getActiveView, getCopyright, getModel, getName, getVersion, initLabels, isEnabled, recentFiles, remove, setActiveView, setEnabled, setModel, start, stop, views |
| 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, removePropertyChangeListener |
| Field Detail |
|---|
private OSXPaletteHandler paletteHandler
private java.util.prefs.Preferences prefs
private java.util.LinkedList<javax.swing.Action> paletteActions
| Constructor Detail |
|---|
public DefaultOSXApplication()
| Method Detail |
|---|
public 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 AbstractApplicationpublic void launch(java.lang.String[] args)
Application
launch in interface Applicationlaunch in class AbstractApplicationpublic void configure(java.lang.String[] args)
Application
configure in interface Applicationconfigure in class AbstractApplicationprotected void initLookAndFeel()
protected void initApplicationActions()
protected void initViewActions(View p)
initViewActions in class AbstractApplicationpublic void dispose(View p)
Application
dispose in interface Applicationdispose in class AbstractApplicationpublic void addPalette(java.awt.Window palette)
Application
addPalette in interface ApplicationaddPalette in class AbstractApplicationpublic void removePalette(java.awt.Window palette)
Application
removePalette in interface ApplicationremovePalette in class AbstractApplication
public void addWindow(java.awt.Window window,
View view)
Application
addWindow in interface ApplicationaddWindow in class AbstractApplicationwindow - The window.view - The View to which this window is associated, or null,
if the window is associated to the application.public void removeWindow(java.awt.Window window)
Application
removeWindow in interface ApplicationremoveWindow in class AbstractApplicationpublic void show(View view)
Application
protected void updateViewTitle(View p,
javax.swing.JFrame f)
p - The view.f - The frame.public void hide(View p)
Application
protected javax.swing.JMenuBar createMenuBar(View p)
p - The view for which the menu bar is created. This may be
null if the menu bar is attached to an application
component, such as the screen menu bar or a floating palette window.protected javax.swing.JMenu createWindowMenu(View view)
protected javax.swing.JMenu createFileMenu(View view)
protected void initScreenMenuBar()
protected void initPalettes(java.util.LinkedList<javax.swing.Action> paletteActions)
public boolean isSharingToolsAmongViews()
Application
public java.awt.Component getComponent()
Application
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||