Package org.graffiti.managers
Class DefaultIOManager
java.lang.Object
org.graffiti.managers.DefaultIOManager
- All Implemented Interfaces:
IOManager
,PluginManagerListener
public class DefaultIOManager extends Object implements IOManager
Handles the editor's IO serializers.
- Version:
- $Revision: 1.20.4.1.2.1 $
- Recent revisions:
- 2.7.0 Standard save format
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.graffiti.managers.IOManager
IOManager.IOManagerListener
-
Field Summary
Fields Modifier and Type Field Description static String
STANDARD_SAVE_FORMAT
-
Constructor Summary
Constructors Constructor Description DefaultIOManager()
Constructs a new io manager. -
Method Summary
Modifier and Type Method Description void
addInputSerializer(InputSerializer is)
Registers the given input serializer.void
addListener(IOManager.IOManagerListener ioManagerListener)
Adds the givenIOManagerListener
to the list of io manager listeners.void
addOutputSerializer(OutputSerializer os)
Registers the given output serializer.InputSerializer
createInputSerializer(InputStream in, String extSearch)
Creates an instance of an input serializer from the given extension.JFileChooser
createOpenFileChooser()
Modifies the given file chooser by registering file extensions from the input serializers.OutputSerializer
createOutputSerializer(String extSearch)
Creates an instance of an output serializer from the given extension.OutputSerializer
createOutputSerializer(String extSearch, String fileTypeDescription)
Creates an instance of an output serializer from the given extension and file type description.JFileChooser
createSaveFileChooser()
Creates and returns a file open chooser dialog with the registered file extensions from the output serializers.JFileChooser
createSaveFileChooser(Graph g)
Creates and returns a file open chooser dialog with the registered file extensions from the output serializers and checking, if output serializer is capable of writing the graph.JFileChooser
getFileChooser()
Set<String>
getGraphFileExtensions()
boolean
hasInputSerializer()
Returnstrue
, if the io manager has a registered input manager.boolean
hasOutputSerializer()
Returnstrue
, if the io manager has a registered output manager.void
pluginAdded(GenericPlugin plugin, PluginDescription desc)
Called by the plugin manager, iff a plugin has been added.boolean
removeListener(IOManager.IOManagerListener l)
Returnstrue
, if the given io manager listener was in the list of listeners and could be removed.String
toString()
Returns a string representation of the io manager.
-
Field Details
-
STANDARD_SAVE_FORMAT
- See Also:
- Constant Field Values
-
-
Constructor Details
-
DefaultIOManager
public DefaultIOManager()Constructs a new io manager.
-
-
Method Details
-
getFileChooser
-
addInputSerializer
Description copied from interface:IOManager
Registers the given input serializer.- Specified by:
addInputSerializer
in interfaceIOManager
- Parameters:
is
- the new serializer to add.
-
addListener
Description copied from interface:IOManager
Adds the givenIOManagerListener
to the list of io manager listeners.- Specified by:
addListener
in interfaceIOManager
- Parameters:
ioManagerListener
- the listener to add.
-
addOutputSerializer
Description copied from interface:IOManager
Registers the given output serializer.- Specified by:
addOutputSerializer
in interfaceIOManager
- Parameters:
os
- the new serializer to add.
-
createInputSerializer
public InputSerializer createInputSerializer(InputStream in, String extSearch) throws FileNotFoundExceptionDescription copied from interface:IOManager
Creates an instance of an input serializer from the given extension.- Specified by:
createInputSerializer
in interfaceIOManager
- Returns:
- DOCUMENT ME!
- Throws:
FileNotFoundException
-
getGraphFileExtensions
- Specified by:
getGraphFileExtensions
in interfaceIOManager
-
createOpenFileChooser
Description copied from interface:IOManager
Modifies the given file chooser by registering file extensions from the input serializers.- Specified by:
createOpenFileChooser
in interfaceIOManager
- Returns:
- DOCUMENT ME!
-
createOutputSerializer
Description copied from interface:IOManager
Creates an instance of an output serializer from the given extension.- Specified by:
createOutputSerializer
in interfaceIOManager
- Returns:
- DOCUMENT ME!
-
createOutputSerializer
Description copied from interface:IOManager
Creates an instance of an output serializer from the given extension and file type description.- Specified by:
createOutputSerializer
in interfaceIOManager
- Returns:
- the output serializer
-
createSaveFileChooser
Description copied from interface:IOManager
Creates and returns a file open chooser dialog with the registered file extensions from the output serializers. Returns all available output serializers, not checking, if output serializer is capable of writing the graph- Specified by:
createSaveFileChooser
in interfaceIOManager
- Returns:
- DOCUMENT ME!
-
createSaveFileChooser
Description copied from interface:IOManager
Creates and returns a file open chooser dialog with the registered file extensions from the output serializers and checking, if output serializer is capable of writing the graph.- Specified by:
createSaveFileChooser
in interfaceIOManager
- Parameters:
g
- The graph to test for output serializer compatibility- Returns:
- the FilechooserDialog object
-
hasInputSerializer
public boolean hasInputSerializer()Description copied from interface:IOManager
Returnstrue
, if the io manager has a registered input manager.- Specified by:
hasInputSerializer
in interfaceIOManager
- Returns:
true
, if the io manager has a registered input manager.
-
hasOutputSerializer
public boolean hasOutputSerializer()Description copied from interface:IOManager
Returnstrue
, if the io manager has a registered output manager.- Specified by:
hasOutputSerializer
in interfaceIOManager
- Returns:
true
, if the io manager has a registered output manager.
-
pluginAdded
Description copied from interface:PluginManagerListener
Called by the plugin manager, iff a plugin has been added.- Specified by:
pluginAdded
in interfacePluginManagerListener
- Parameters:
plugin
- the added plugin.desc
- the description of the new plugin.
-
removeListener
Description copied from interface:IOManager
Returnstrue
, if the given io manager listener was in the list of listeners and could be removed.- Specified by:
removeListener
in interfaceIOManager
- Parameters:
l
- the io manager listener to remove.- Returns:
- DOCUMENT ME!
-
toString
Returns a string representation of the io manager. Useful for debugging.- Overrides:
toString
in classObject
- See Also:
Object.toString()
-