|
||||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.argouml.kernel.ProjectManager
This class manages the projects loaded in argouml. Classes in Argouml can ask this class for the current project and set the current project. Since we only have one project in ArgoUML at the moment, this class does not manage a list of projects like one would expect. This could be a nice extension for the future of argouml. As soon as the current project is changed, a property changed event is fired.
Field Summary | |
---|---|
private boolean |
_creatingCurrentProject
Flag to indicate we are creating a new current project |
private static Project |
_currentProject
The project that is visible in the projectbrowser |
private java.beans.PropertyChangeEvent |
_event
The event to fire |
private static ProjectManager |
_instance
The singleton instance of this class |
private javax.swing.event.EventListenerList |
_listenerList
The listener list |
private static Logger |
cat
logger |
static java.lang.String |
CURRENT_PROJECT_PROPERTY_NAME
|
static java.lang.String |
SAVE_STATE_PROPERTY_NAME
|
Constructor Summary | |
---|---|
private |
ProjectManager()
Constructor for ProjectManager. |
Method Summary | |
---|---|
void |
addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Adds an instance implementing propertychangelistener to the listener list |
private void |
firePropertyChanged(java.lang.String propertyName,
java.lang.Object oldValue,
java.lang.Object newValue)
|
Project |
getCurrentProject()
Returns the current project. |
static ProjectManager |
getManager()
The singleton accessor method of this class |
Project |
loadProject(java.net.URL url)
This method creates a project from the specified URL Unlike the constructor which forces an .argo extension This method will attempt to load a raw XMI file This method can fail in several different ways. |
private Project |
loadProjectFromArgo(java.net.URL url)
Loads a project from an url of the argo format. |
private Project |
loadProjectFromXMI(java.net.URL url)
Reads an XMI file. |
private Project |
loadProjectFromZargo(java.net.URL url)
Reads an url of the .zargo format. |
Project |
makeEmptyProject()
Makes an empty project with two standard diagrams. |
void |
notifySavePropertyChanged(boolean newValue)
notify the gui from the project manager that the current project's save state has changed. |
void |
removeProject(Project oldProject)
prepare project for gc |
void |
removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Removes a listener from the listener list. |
void |
setCurrentProject(Project newProject)
Sets the current project (the project that is viewable in the projectbrowser). |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String CURRENT_PROJECT_PROPERTY_NAME
public static final java.lang.String SAVE_STATE_PROPERTY_NAME
private static Logger cat
private static ProjectManager _instance
private static Project _currentProject
private boolean _creatingCurrentProject
private javax.swing.event.EventListenerList _listenerList
private java.beans.PropertyChangeEvent _event
Constructor Detail |
private ProjectManager()
Method Detail |
public static ProjectManager getManager()
public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
listener
- public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
listener
- private void firePropertyChanged(java.lang.String propertyName, java.lang.Object oldValue, java.lang.Object newValue)
public void setCurrentProject(Project newProject)
If the argument is null, then the current project will be forgotten about.
newProject
- The new project.public Project getCurrentProject()
public Project makeEmptyProject()
public Project loadProject(java.net.URL url) throws java.io.IOException, IllegalFormatException, org.xml.sax.SAXException, javax.xml.parsers.ParserConfigurationException
java.io.IOException
IllegalFormatException
org.xml.sax.SAXException
javax.xml.parsers.ParserConfigurationException
private Project loadProjectFromXMI(java.net.URL url) throws java.io.IOException
This could be used to import models from other tools.
url
- is the file name of the file
java.io.IOException
- is thrown if some error occursprivate Project loadProjectFromZargo(java.net.URL url) throws java.io.IOException, org.xml.sax.SAXException, javax.xml.parsers.ParserConfigurationException
url
-
java.lang.Exception
- if there is an exception during load. Should be handled
by the GUI.
java.io.IOException
org.xml.sax.SAXException
javax.xml.parsers.ParserConfigurationException
private Project loadProjectFromArgo(java.net.URL url) throws java.io.IOException, javax.xml.parsers.ParserConfigurationException, org.xml.sax.SAXException
url
-
java.io.IOException
javax.xml.parsers.ParserConfigurationException
org.xml.sax.SAXException
public void notifySavePropertyChanged(boolean newValue)
public void removeProject(Project oldProject)
|
||||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ArgoUML © 1996-2004 (20040306) | ArgoUML Homepage | ArgoUML Developers' page | ArgoUML Cookbook |