Directories are automatically created.
Note that there is no single project file, just a project directory into
which application components should write their relevant files.
There is a concurrency weakness if listeners are added
or removed during an open or close, so don't do that.
Suggested usage is to have a single instance in your
application and to pass it into the constructor of application
components. Those components should then typically create a private
ProjectListener instance and add and remove it as appropriate.
When the current project is changed,
if there is an existing current project, it is closed,
the new current project is opened.
When a project is opened the open() method of all ProjectListeners is called.
Similarly their close() methods are called when a project is closed.
No arguments are passed to the ProjectListeners, they should call
getCurrentProjectName() and/or getCurrentProjectPath() as appropriate.
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SingleProject
public SingleProject()
SingleProject
public SingleProject(java.lang.String appDir)
SingleProject
public SingleProject(java.io.File appPath)
openProject
public void openProject(java.lang.String name)
saveProject
public void saveProject()
saveAsProject
public void saveAsProject(java.lang.String name)
importProject
public void importProject(java.lang.String name,
java.io.File file)
- Import the named project from the specified file.
i.e. project is uncompressed from file.
exportProject
public void exportProject(java.lang.String name)
- Export the named project to the specified file.
i.e. project is compressed to file.
canOpenProject
public boolean canOpenProject()
canSaveProject
public boolean canSaveProject()
getApplicationPath
public java.io.File getApplicationPath()
getCurrentProjectTitle
public java.lang.String getCurrentProjectTitle()
getCurrentProjectArtist
public java.lang.String getCurrentProjectArtist()
getCurrentProjectPath
public java.io.File getCurrentProjectPath()
setProjectsRoot
public void setProjectsRoot(java.lang.String path)
getProjectsRoot
public java.io.File getProjectsRoot()
addProjectListener
public void addProjectListener(ProjectListener listener)
removeProjectListener
public void removeProjectListener(ProjectListener listener)
Copyright © 2004, 2005, 2006, 2007 Steve Taylor. All Rights Reserved.