|
JHotDraw 7.1 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Application
An Application handles the lifecycle of View
s and provides windows
to present them on screen. Depending on the document interface style
used by the Application, the Application can handle multiple Views
at the same time, or only one.
Typical document interface styles are the Single Document Interface (SDI), the Multiple Document Interface (MDI) and the Mac OS X Application Document Interface (OSX).
Typical usage of this class:
public class MyMainClass { public static void main(String[] args) { Application app = new DefaultADIApplication(); DefaultApplicationModel model = new DefaultApplicationModel(); model.setName("MyAppliciation"); model.setVersion("1.0"); model.setCopyright("Copyright 2006 (c) Werner Randelshofer. All Rights Reserved."); model.setViewClassName("org.jhotdraw.myapplication.MyView"); app.setModel(model); app.launch(args); }
Field Summary | |
---|---|
static java.lang.String |
ACTIVE_VIEW_PROPERTY
The property name of the activeView property. |
Method Summary | |
---|---|
void |
add(View p)
Adds a view to this application. |
void |
addPalette(java.awt.Window palette)
Adds a palette window to the application. |
void |
addPropertyChangeListener(java.beans.PropertyChangeListener l)
Adds a property change listener. |
void |
addRecentFile(java.io.File file)
Appends a file to the list of recent files. |
void |
addWindow(java.awt.Window window,
View view)
Adds a (regular) window to the application. |
void |
clearRecentFiles()
Clears the list of recent files. |
void |
configure(java.lang.String[] args)
Configures the application using the provided arguments array. |
View |
createView()
Creates a new view for this application. |
void |
dispose(View p)
This is a convenience method for removing a view and disposing it. |
View |
getActiveView()
Returns the active view. |
java.awt.Component |
getComponent()
Returns the application component. |
java.lang.String |
getCopyright()
Returns the copyright of the application. |
ApplicationModel |
getModel()
Returns the application model. |
java.lang.String |
getName()
Returns the name of the application. |
java.lang.String |
getVersion()
Returns the version of the application. |
void |
hide(View p)
Hides a view. |
void |
init()
Initializes the application. |
boolean |
isEnabled()
Returns the enabled state of the application. |
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. |
java.util.List<java.io.File> |
recentFiles()
Returns the recently opened files. |
void |
remove(View p)
Removes a view from this application and removes it from the users view. |
void |
removePalette(java.awt.Window palette)
Removes a palette window from the application. |
void |
removePropertyChangeListener(java.beans.PropertyChangeListener l)
Removes a property change listener. |
void |
removeWindow(java.awt.Window window)
Removes a (regular) window from the application. |
void |
setEnabled(boolean newValue)
Sets the enabled state of the application. |
void |
setModel(ApplicationModel newValue)
Sets the application model. |
void |
show(View p)
Shows a view. |
void |
start()
Starts the application. |
void |
stop()
Stops the application without saving any unsaved views. |
java.util.Collection<View> |
views()
Returns a read only collection view of the views of this application. |
Field Detail |
---|
static final java.lang.String ACTIVE_VIEW_PROPERTY
Method Detail |
---|
void launch(java.lang.String[] args)
void configure(java.lang.String[] args)
void init()
configure()
should have been invoked before the application
is inited. Alternatively an application can be configured using setter
methods.
void start()
init()
must have been invoked before the application is started.
void stop()
init()
must have been invoked before the application is stopped.
View createView()
void add(View p)
void remove(View p)
void show(View p)
void hide(View p)
void dispose(View p)
java.util.Collection<View> views()
View getActiveView()
This is a bound property.
boolean isEnabled()
void setEnabled(boolean newValue)
void addPropertyChangeListener(java.beans.PropertyChangeListener l)
void removePropertyChangeListener(java.beans.PropertyChangeListener l)
java.lang.String getName()
java.lang.String getVersion()
java.lang.String getCopyright()
void setModel(ApplicationModel newValue)
ApplicationModel getModel()
boolean isSharingToolsAmongViews()
java.awt.Component getComponent()
java.util.List<java.io.File> recentFiles()
void addRecentFile(java.io.File file)
void clearRecentFiles()
void addPalette(java.awt.Window palette)
void removePalette(java.awt.Window palette)
void addWindow(java.awt.Window window, View view)
window
- The window.view
- The View to which this window is associated, or null,
if the window is associated to the application.void removeWindow(java.awt.Window window)
|
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 |