|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectkaapo.filemanager.FileManager
public class FileManager
Class that implements FileManager interface. Includes file system operations like saving, loading and exporting projects and is to be used by the GUI subsystem.
This class doesn't handle exceptions but throws them up to GUI to handle and inform user about.
Project
Constructor Summary | |
---|---|
FileManager()
Creates a new FileManager . |
Method Summary | |
---|---|
void |
exportProject(Project project,
DiagramWrapper visibleDiagram,
ExportPlugin exportPlugin,
File file,
Component component)
Exports a Project object to disk using the export plugin given as a parameter. |
List<ExportPlugin> |
getExportPlugins()
Not implemented yet. |
Project |
readProject(File file)
Reads a Project object from a file. |
void |
writeProject(Project project,
File file)
Writes a Project object to a file. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FileManager()
FileManager
.
Method Detail |
---|
public void writeProject(Project project, File file) throws IOException
project
- the project to savefile
- the file to be opened for writing
IOException
- if an I/O error occurspublic Project readProject(File file) throws IOException, ClassNotFoundException, ClassCastException
file
- the file to be opened for reading
IOException
- if an I/O error occurs
ClassNotFoundException
- if some of the classes used in project is
missing from system
ClassCastException
- if the object contained in file is not a Project objectpublic void exportProject(Project project, DiagramWrapper visibleDiagram, ExportPlugin exportPlugin, File file, Component component) throws IOException, ComponentNotSupportedException
Throws an IOException
if writing fails. The
ExportPlugin
may choose to throw a
ComponentNotSupportedException
if it cannot
handle a project component in the given project.
project
- the project to exportvisibleDiagram
- the current visible diagramexportPlugin
- the export plugin used for exportingfile
- the file to be opened for writingcomponent
- the component to show message dialogs on
IOException
- if an I/O error occurs
ComponentNotSupportedException
- ExportPlugin may throw this
exception if it cannot handle some object included in the projectpublic List<ExportPlugin> getExportPlugins()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |