|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Project manager interface. Only one instance exists. Generates events for each (important) action; listeners can register for these events according to the observer pattern. All manipulations concerning whole projects run through this class. The manager also keeps track of whether a project is currently being demonstrated. Only one project can be in demonstration mode at each point of time.
Method Summary | |
void |
addProjectListener(ProjectListener listener)
Adds a project listener. |
void |
changeProjectName(Project project,
String name)
Changes the name of a project. |
boolean |
closeAll()
Closes all projects. |
boolean |
closeProject(Project project)
Closes a project. |
Project |
getActiveProject()
Returns the currently active project (the user activates projects by selecting the frame). |
int |
getNrOfProjects()
Returns the number of projects that are open. |
boolean |
isInDemoState()
Returns whether a project is currently being demonstrated. |
Project |
newProject()
Creates a new project. |
Project |
openProject(String location)
Opens a project from a certain location. |
Iterator |
projects()
Returns an iterator over the open projects. |
void |
removeProjectListener(ProjectListener listener)
Removes a project listener. |
void |
saveProject(Project project,
boolean newName)
Saves a project. |
void |
setActiveProject(Project project)
Sets the currently active project. |
void |
setDemoStateForActiveProject()
Turns the currently active project into demo state. |
void |
setModState()
Returns to the modelling state. |
Method Detail |
public Project newProject()
public Project openProject(String location)
location
- storage location of the project, e.g. a file path
public void saveProject(Project project, boolean newName)
project
- the project to be savednewName
- whether the project shall be saved in a new location
('save as')public boolean closeProject(Project project)
project
- the project to be closed
public boolean closeAll()
public void changeProjectName(Project project, String name)
project
- the projectname
- the new namepublic Project getActiveProject()
public void setActiveProject(Project project)
project
- the project that is active nowpublic int getNrOfProjects()
public Iterator projects()
public void setModState()
public boolean isInDemoState()
public void setDemoStateForActiveProject()
public void addProjectListener(ProjectListener listener)
listener
- the listenerpublic void removeProjectListener(ProjectListener listener)
listener
- the listener
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |