com.jgoodies.skeleton.model
Class MainModel

java.lang.Object
  extended by com.jgoodies.skeleton.domain.Model
      extended by com.jgoodies.skeleton.model.MainModel
All Implemented Interfaces:
Serializable

public final class MainModel
extends Model

References all application-level data or submodels and provides convenience accessors.

Version:
$Revision: 1.18 $
Author:
Karsten Lentzsch
See Also:
Serialized Form

Field Summary
static String PROPERTYNAME_PROJECT
           
 
Constructor Summary
MainModel()
          Constructs a MainModel that has no project set, no selection and no tree model.
 
Method Summary
 void aboutToExitApplication(Object eventSource)
          Leaves the application if nobody vetos against the close request.
 EditorModel getEditorModel()
          Returns the editor submodel.
 Action getExitAction()
           
 NavigationModel getNavigationModel()
          Returns the navigation submodel.
 Action getNewProjectAction()
           
 Action getOpenAboutDialogAction()
           
 Action getOpenPrintDialogAction()
           
 Action getOpenProjectAction()
           
 Action getPrintAction()
           
 Project getProject()
          Returns the current project.
 Action getSaveAction()
           
 Action getSaveAsAction()
           
 boolean hasProject()
          Checks and answers if a project is loaded.
 boolean isProjectFilePathValid()
          Checks and answers whether the project's file path is valid.
 void setDefaultParentFrame(Frame defaultParentFrame)
          Sets a frame as the default parent for this controller's dialogs.
 void setProject(Project newProject)
          Sets a new project.
 
Methods inherited from class com.jgoodies.skeleton.domain.Model
addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, addVetoableChangeListener, equals, fireMultiplePropertiesChanged, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, getPropertyChangeListeners, getPropertyChangeListeners, getVetoableChangeListeners, getVetoableChangeListeners, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, removeVetoableChangeListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROPERTYNAME_PROJECT

public static final String PROPERTYNAME_PROJECT
See Also:
Constant Field Values
Constructor Detail

MainModel

public MainModel()
Constructs a MainModel that has no project set, no selection and no tree model.

Method Detail

getNavigationModel

public NavigationModel getNavigationModel()
Returns the navigation submodel.

Returns:
the navigation submodel.

getEditorModel

public EditorModel getEditorModel()
Returns the editor submodel.

Returns:
the editor submodel.

getProject

public Project getProject()
Returns the current project.

Returns:
the current project.

setProject

public void setProject(Project newProject)
Sets a new project.

Parameters:
newProject - the project to set
Throws:
NullPointerException - if the new project is null

hasProject

public boolean hasProject()
Checks and answers if a project is loaded.

Returns:
true if a project is loaded.

isProjectFilePathValid

public boolean isProjectFilePathValid()
Checks and answers whether the project's file path is valid.

Returns:
true if the project's file path is valid.

aboutToExitApplication

public void aboutToExitApplication(Object eventSource)
Leaves the application if nobody vetos against the close request.


setDefaultParentFrame

public void setDefaultParentFrame(Frame defaultParentFrame)
Sets a frame as the default parent for this controller's dialogs.

Parameters:
defaultParentFrame - the default parent

getNewProjectAction

public Action getNewProjectAction()

getOpenProjectAction

public Action getOpenProjectAction()

getSaveAction

public Action getSaveAction()

getSaveAsAction

public Action getSaveAsAction()

getPrintAction

public Action getPrintAction()

getOpenPrintDialogAction

public Action getOpenPrintDialogAction()

getExitAction

public Action getExitAction()

getOpenAboutDialogAction

public Action getOpenAboutDialogAction()


Copyright © 2002-2008 JGoodies Karsten Lentzsch. All Rights Reserved.