org.jhotdraw.samples.net
Class NetApplicationModel

java.lang.Object
  extended by org.jhotdraw.beans.AbstractBean
      extended by org.jhotdraw.app.DefaultApplicationModel
          extended by org.jhotdraw.samples.net.NetApplicationModel
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, ApplicationModel

public class NetApplicationModel
extends DefaultApplicationModel

NetApplicationModel.

Version:
$Id: NetApplicationModel.java 527 2009-06-07 14:28:19Z rawcoder $
Author:
Werner Randelshofer.
See Also:
Serialized Form

Nested Class Summary
private static class NetApplicationModel.ToolButtonListener
           
 
Field Summary
private  java.util.HashMap<java.lang.String,javax.swing.Action> actions
           
private static double[] scaleFactors
           
private  DefaultDrawingEditor sharedEditor
          This editor is shared by all views.
 
Fields inherited from class org.jhotdraw.app.DefaultApplicationModel
COPYRIGHT_PROPERTY, NAME_PROPERTY, VERSION_PROPERTY, VIEW_CLASS_NAME_PROPERTY, VIEW_CLASS_PROPERTY
 
Fields inherited from class org.jhotdraw.beans.AbstractBean
propertySupport
 
Constructor Summary
NetApplicationModel()
          Creates a new instance.
 
Method Summary
private  void addCreationButtonsTo(javax.swing.JToolBar tb, DrawingEditor editor)
           
 java.util.List<javax.swing.JMenu> createMenus(Application a, View pr)
          Creates menus.
 java.util.List<javax.swing.JToolBar> createToolBars(Application a, View pr)
          Creates toolbars for the application.
 DefaultDrawingEditor getSharedEditor()
           
 void initApplication(Application a)
          Inits the application model.
 void initView(Application a, View p)
          Inits the supplied view for the application.
 
Methods inherited from class org.jhotdraw.app.DefaultApplicationModel
createEditMenu, createView, getAction, getCopyright, getName, getVersion, getViewClass, putAction, setCopyright, setName, setVersion, setViewClass, setViewClassName
 
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
 

Field Detail

scaleFactors

private static final double[] scaleFactors

sharedEditor

private DefaultDrawingEditor sharedEditor
This editor is shared by all views.


actions

private java.util.HashMap<java.lang.String,javax.swing.Action> actions
Constructor Detail

NetApplicationModel

public NetApplicationModel()
Creates a new instance.

Method Detail

initApplication

public void initApplication(Application a)
Description copied from interface: ApplicationModel
Inits the application model.

Typically, the application model creates a number of AbstractApplicationAction objects, which can later be retrieved using getAction, and which are linked to menu items and toolbars created by the application model.

Specified by:
initApplication in interface ApplicationModel
Overrides:
initApplication in class DefaultApplicationModel

getSharedEditor

public DefaultDrawingEditor getSharedEditor()

initView

public void initView(Application a,
                     View p)
Description copied from interface: ApplicationModel
Inits the supplied view for the application.

Specified by:
initView in interface ApplicationModel
Overrides:
initView in class DefaultApplicationModel

addCreationButtonsTo

private void addCreationButtonsTo(javax.swing.JToolBar tb,
                                  DrawingEditor editor)

createToolBars

public java.util.List<javax.swing.JToolBar> createToolBars(Application a,
                                                           View pr)
Creates toolbars for the application. This class always returns an empty list. Subclasses may return other values.

Specified by:
createToolBars in interface ApplicationModel
Overrides:
createToolBars in class DefaultApplicationModel
Parameters:
a - Application.
pr - The view for which the toolbars need to be created, or null if the toolbars are shared by multiple views.

createMenus

public java.util.List<javax.swing.JMenu> createMenus(Application a,
                                                     View pr)
Description copied from interface: ApplicationModel
Creates menus.

Depending on the document interface of the application, this method may be invoked only once for the application, or for each opened view.

Specified by:
createMenus in interface ApplicationModel
Overrides:
createMenus in class DefaultApplicationModel
Parameters:
a - Application.
pr - The view for which the toolbars need to be created, or null if the menus are shared by multiple views.