|
JHotDraw 7.1 | ||||||||
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
A DefaultOSXApplication can handle the life cycle of multiple document windows each being presented in a JFrame of its own. The application provides all the functionality needed to work with the document, such as a menu bar, tool bars and palette windows.
OSX stands for Mac OS X Application Document Interface. An OSX application can handle multiple View's at the same time. Each view gets a JFrame of its own. An OSX application has one menu bar, attached to the top of the screen. This 'screen menu bar' is shared by all View's.
DefaultOSXApplication is designed for Mac OS X. It will not work on other platforms.
The screen menu bar has the following standard menus:
"Application-Name" File Edit Window HelpThe first menu, is the application menu. It has the following standard menu items. DefaultOSXApplication wires the menu items to the action objects specified in brackets. The preferences menu item is only displayed, if the application has an action with PreferencesAction.ID. The other menu items are always displayed. Menu items without action wiring are generated by Mac OS X and can not be changed.
About "Application-Name" (AboutAction.ID) - Preferences... (PreferencesAction.ID) - Services - Hide "Application-Name" Hide Others Show All - Quit "Application-Name" (ExitAction.ID)The file menu has the following standard menu items. DefaultOSXApplication wires the menu items to the action objects specified in brackets. If the application hasn't an action with the specified ID, the menu item is not displayed. Menu items without action wiring are generated by this class, and can be changed by subclasses.
New (NewAction.ID) Open... (OpenAction.ID) Open Recent > - Close (CloseAction.ID) Save (SaveAction.ID) Save As... (SaveAsAction.ID) Save All Revert to Saved (RevertToSavedAction.ID) - Page Setup... (PrintPageSetupAction.ID) Print... (PrintAction.ID)The edit menu has the following standard menu items. DefaultOSXApplication wires the menu items to the action objects specified in brackets. If the application hasn't an action with the specified ID, the menu item is not displayed. Menu items without action wiring are generated by this class, and can be changed by subclasses.
Undo (UndoAction.ID) Redo (RedoAction.ID) - Cut (CutAction.ID) Copy (CopyAction.ID) Paste (PasteAction.ID) Delete (DeleteAction.ID) Select All (SelectAllAction.ID)
Field Summary |
---|
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. |
protected void |
addViewWindowMenuItems(javax.swing.JMenu m,
View p)
|
void |
addWindow(java.awt.Window window,
View p)
Adds a (regular) window to the application. |
void |
configure(java.lang.String[] args)
Configures the application using the provided arguments array. |
protected javax.swing.JMenu |
createFileMenu(View p)
|
protected javax.swing.JMenuBar |
createMenuBar(View p)
Creates a menu bar. |
protected javax.swing.JMenu |
createWindowMenu(View p)
|
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 (regular) window from the application. |
void |
show(View p)
Shows a view. |
protected void |
updateOpenRecentMenu(javax.swing.JMenu openRecentMenu)
|
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, dispose, 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, 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 |
Constructor Detail |
---|
public DefaultOSXApplication()
Method Detail |
---|
public void init()
Application
configure()
should have been invoked before the application
is inited. Alternatively an application can be configured using setter
methods.
init
in interface Application
init
in class AbstractApplication
public void launch(java.lang.String[] args)
Application
launch
in interface Application
launch
in class AbstractApplication
public void configure(java.lang.String[] args)
Application
configure
in interface Application
configure
in class AbstractApplication
protected void initLookAndFeel()
protected void initApplicationActions()
protected void initViewActions(View p)
initViewActions
in class AbstractApplication
public void addPalette(java.awt.Window palette)
Application
addPalette
in interface Application
addPalette
in class AbstractApplication
public void removePalette(java.awt.Window palette)
Application
removePalette
in interface Application
removePalette
in class AbstractApplication
public void addWindow(java.awt.Window window, View p)
Application
addWindow
in interface Application
addWindow
in class AbstractApplication
window
- The window.p
- 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 Application
removeWindow
in class AbstractApplication
public void show(View p)
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 p)
protected void addViewWindowMenuItems(javax.swing.JMenu m, View p)
protected void updateOpenRecentMenu(javax.swing.JMenu openRecentMenu)
protected javax.swing.JMenu createFileMenu(View p)
protected void initScreenMenuBar()
protected void initPalettes(java.util.LinkedList<javax.swing.Action> paletteActions)
public boolean isSharingToolsAmongViews()
Application
public java.awt.Component getComponent()
Application
|
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 |