fdda.plugins
Interface SystemWriter

All Superinterfaces:
Plugin
All Known Implementing Classes:
ProjectWriter

public interface SystemWriter
extends Plugin

Interface for plug-ins that store projects.

Author:
Jörg Rüdenauer

Field Summary
 
Fields inherited from interface fdda.plugins.Plugin
ALGORITHM_READER, SYSTEM_READER, SYSTEM_WRITER
 
Method Summary
 ProjectInformation[] getLastSavedProjectsInformation()
          Returns information about the last stored projects.
 boolean performUI()
          Interacts with the user to define options for the save operation.
 boolean setSystemLocation(String location)
          Defines where the project shall be saved (alternative to performUI).
 void useGraphic(String component)
          Tells the plug-in that the specified graphics component is used and it should store its information.
 void writeProject(Project project, ErrorHandler errorHandler)
          Stores a project in a persistent storage.
 
Methods inherited from interface fdda.plugins.Plugin
configure, getName, getType, hasOptions, useDialog
 

Method Detail

useGraphic

public void useGraphic(String component)
                throws ComponentNotSupportedException
Tells the plug-in that the specified graphics component is used and it should store its information.

Parameters:
component - identifier of the graphics component (e.g. "java2d")
Throws:
ComponentNotSupportedException - if the plug-in doesn't support the storage of the data for this component

performUI

public boolean performUI()
Interacts with the user to define options for the save operation. E.g., a dialog to select a file name could be shown. Either this operation or setSystemLocation must be called before calling writeProject. The operation returns false if the user canceled the operation; writeProject mustn't be called in this case.

Returns:
false, iff the user canceled the saving

setSystemLocation

public boolean setSystemLocation(String location)
Defines where the project shall be saved (alternative to performUI). If the given location (e.g. a file path) can't be used, false is returned.

Parameters:
location - the location
Returns:
whether the location can be used.

getLastSavedProjectsInformation

public ProjectInformation[] getLastSavedProjectsInformation()
Returns information about the last stored projects. The size of the array may vary with each plugin.

Returns:
information about last stored projects

writeProject

public void writeProject(Project project,
                         ErrorHandler errorHandler)
                  throws MissingOptionsException
Stores a project in a persistent storage. If an error occurs, the appropriate method of the error handler is called. To integrate into fdda, the method should perform several other tasks: Maybe change the project name through the ProjectManager Call project.setChanged(false) Set the preference userRoot.fdda.lastProjectLocation to the location of the stored project

Parameters:
project - the project
errorHandler - the error handler
Throws:
MissingOptionsException - if no location was specified


API documentation for FDDA version 0.9. Generated on 17/02/2004 14:12.