JHotDraw 7.0.9

org.jhotdraw.application
Class AbstractSDIApplication

java.lang.Object
  extended by application.Application
      extended by org.jhotdraw.application.AbstractDocumentOrientedApplication
          extended by org.jhotdraw.application.AbstractSDIApplication
All Implemented Interfaces:
DocumentOrientedApplication
Direct Known Subclasses:
TeddySDIApplication

public abstract class AbstractSDIApplication
extends AbstractDocumentOrientedApplication

A AbstractSDIApplication can handle 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.

Version:
1.4 2007-01-11 Removed method addStandardActionsTo.
1.3 2006-05-03 Show asterisk in window title, when documentView has unsaved changes.
1.2.1 2006-02-28 Stop application when last documentView is closed.
1.2 2006-02-06 Support for multiple open id added.
1.1 2006-02-06 Revised.
1.0 October 16, 2005 Created.
Author:
Werner Randelshofer

Field Summary
 
Fields inherited from class org.jhotdraw.application.AbstractDocumentOrientedApplication
PROP_CURRENT_VIEW, PROP_VIEW_COUNT
 
Constructor Summary
AbstractSDIApplication()
           
 
Method Summary
protected  javax.swing.ActionMap createActionMap()
          Creates an action map for actions which haven not been defined using the
protected  javax.swing.JMenu createFileMenu(DocumentView p)
          Creates the file menu.
protected  javax.swing.JMenu createHelpMenu(DocumentView p)
          Creates the help menu.
protected  javax.swing.JMenu createViewMenu(DocumentView p, java.util.List<javax.swing.Action> toolBarActions)
           
 java.awt.Component getComponent()
          Returns the application component.
 DocumentView getCurrentView()
          Returns the current view.
 void hide(DocumentView p)
          Hides a view.
static void initAWT(java.lang.String[] args)
           
protected  void initLookAndFeel()
          Initializes the look and feel of the application.
 boolean isEditorShared()
          Returns true, if this application shares an editor among multiple views.
 void remove(DocumentView p)
          Removes a view from this application.
 void setCurrentView(DocumentView newValue)
           
 void show(DocumentView p)
          Shows a view.
protected  java.awt.Component wrapProjectComponent(DocumentView p)
          Returns the documentView component.
 
Methods inherited from class org.jhotdraw.application.AbstractDocumentOrientedApplication
add, addPalette, addRecentFile, clearRecentFiles, createEditMenu, createMenuBar, createMenus, createToolBars, createView, createViewMenu, createWindowMenu, destroyView, getAction, getFrameworkResourceMap, getResourceMap, getViewClass, getViews, initActionMap, initDefaults, initialize, initMainFrame, initRecentFiles, initView, isEnabled, launch, recentFiles, removePalette, setEnabled, shutdown, startup, updateName, updateOpenRecentMenu
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jhotdraw.application.DocumentOrientedApplication
addPropertyChangeListener, removePropertyChangeListener
 

Constructor Detail

AbstractSDIApplication

public AbstractSDIApplication()
Method Detail

remove

public void remove(DocumentView p)
Description copied from class: AbstractDocumentOrientedApplication
Removes a view from this application. Calls destroy on the view. Fires a "documentCount" property change event. Invokes method setApplication(null) on the view object.

Specified by:
remove in interface DocumentOrientedApplication
Overrides:
remove in class AbstractDocumentOrientedApplication

initAWT

public static void initAWT(java.lang.String[] args)

initLookAndFeel

protected void initLookAndFeel()
Description copied from class: AbstractDocumentOrientedApplication
Initializes the look and feel of the application. This method is called by initDefaults.

Overrides:
initLookAndFeel in class AbstractDocumentOrientedApplication

createActionMap

protected javax.swing.ActionMap createActionMap()
Description copied from class: AbstractDocumentOrientedApplication
Creates an action map for actions which haven not been defined using the

Overrides:
createActionMap in class AbstractDocumentOrientedApplication

show

public void show(DocumentView p)
Description copied from class: AbstractDocumentOrientedApplication
Shows a view. Calls start on the view.

Specified by:
show in interface DocumentOrientedApplication
Specified by:
show in class AbstractDocumentOrientedApplication

wrapProjectComponent

protected java.awt.Component wrapProjectComponent(DocumentView p)
Returns the documentView component. Eventually wraps it into another component in order to provide additional functionality.


hide

public void hide(DocumentView p)
Description copied from class: AbstractDocumentOrientedApplication
Hides a view. Calls stop on the view.

Specified by:
hide in interface DocumentOrientedApplication
Specified by:
hide in class AbstractDocumentOrientedApplication

getCurrentView

public DocumentView getCurrentView()
Description copied from class: AbstractDocumentOrientedApplication
Returns the current view. This is used by Actions which act on the current DocumentView. Current view is null, if the application has no visible view.

This is a bound property.

Specified by:
getCurrentView in interface DocumentOrientedApplication
Specified by:
getCurrentView in class AbstractDocumentOrientedApplication

setCurrentView

public void setCurrentView(DocumentView newValue)

createFileMenu

protected javax.swing.JMenu createFileMenu(DocumentView p)
Description copied from class: AbstractDocumentOrientedApplication
Creates the file menu. Return null, if you don't want this menu.

Overrides:
createFileMenu in class AbstractDocumentOrientedApplication

isEditorShared

public boolean isEditorShared()
Description copied from class: AbstractDocumentOrientedApplication
Returns true, if this application shares an editor among multiple views. This is true for MDI and OSX applications. This is false for SDI applications.

Specified by:
isEditorShared in interface DocumentOrientedApplication
Specified by:
isEditorShared in class AbstractDocumentOrientedApplication

getComponent

public java.awt.Component getComponent()
Description copied from interface: DocumentOrientedApplication
Returns the application component. This may return null, if the application is not represented by a component of its own on the user interface.


createViewMenu

protected javax.swing.JMenu createViewMenu(DocumentView p,
                                           java.util.List<javax.swing.Action> toolBarActions)

createHelpMenu

protected javax.swing.JMenu createHelpMenu(DocumentView p)
Description copied from class: AbstractDocumentOrientedApplication
Creates the help menu. Return null, if you don't want this menu.

Overrides:
createHelpMenu in class AbstractDocumentOrientedApplication

Copyright 1996-2007 (c) JHotDraw.org.
Some rights reserved.