|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.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 |
static String |
CURRENT_PROJECT_PROPERTY_NAME
The name of the property that defines the current project. |
private static Project |
currentProject
The project that is visible in the projectbrowser |
private PropertyChangeEvent |
event
The event to fire. |
private static ProjectManager |
instance
The singleton instance of this class |
private EventListenerList |
listenerList
The listener list |
private static Logger |
LOG
logger |
static String |
NO_PROJECT
The name of the property that there is no project. |
static String |
SAVE_STATE_PROPERTY_NAME
The name of the property that defines the save state. |
Constructor Summary | |
private |
ProjectManager()
Constructor for ProjectManager. |
Method Summary | |
void |
addPropertyChangeListener(PropertyChangeListener listener)
Adds a listener to the listener list. |
private void |
firePropertyChanged(String propertyName,
Object oldValue,
Object newValue)
Fire an event to all members of the listener list. |
Project |
getCurrentProject()
Returns the current project. |
static ProjectManager |
getManager()
The singleton accessor method of this class. |
Project |
makeEmptyProject()
Makes an empty project with two standard diagrams. |
boolean |
needsSave()
Test if the model needs to be saved. |
void |
propertyChange(PropertyChangeEvent pce)
React to PropertyChangeEvents, e.g. |
void |
removeProject(Project oldProject)
Remove the project. |
void |
removePropertyChangeListener(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). |
void |
setNeedsSave(boolean newValue)
Notify the gui that the current project's save state has changed. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final String CURRENT_PROJECT_PROPERTY_NAME
public static final String NO_PROJECT
public static final String SAVE_STATE_PROPERTY_NAME
private static final Logger LOG
private static ProjectManager instance
private static Project currentProject
private boolean creatingCurrentProject
private EventListenerList listenerList
private PropertyChangeEvent event
firePropertyChanged(String, Object, Object)
fire the old
event again if the previous invocation resulted in an exception?
If so, please document why. If not, fix it.
Constructor Detail |
private ProjectManager()
Method Detail |
public static ProjectManager getManager()
public void addPropertyChangeListener(PropertyChangeListener listener)
listener
- The listener to add.public void removePropertyChangeListener(PropertyChangeListener listener)
listener
- The listener to remove.private void firePropertyChanged(String propertyName, Object oldValue, Object newValue)
propertyName
- The name of the event.oldValue
- The old value.newValue
- The new value.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()
If there is no project, a new one is created.
public Project makeEmptyProject()
public boolean needsSave()
public void setNeedsSave(boolean newValue)
newValue
- The new state.public void removeProject(Project oldProject)
oldProject
- The project to be removed.public void propertyChange(PropertyChangeEvent pce)
propertyChange
in interface PropertyChangeListener
PropertyChangeListener.propertyChange(java.beans.PropertyChangeEvent)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ArgoUML © 1996-2004 (20050222) | ArgoUML Homepage | ArgoUML Developers' page | ArgoUML Cookbook |