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 StringSTANDARD_SAVE_FORMAT -
Constructor Summary
Constructors Constructor Description DefaultIOManager()Constructs a new io manager. -
Method Summary
Modifier and Type Method Description voidaddInputSerializer(InputSerializer is)Registers the given input serializer.voidaddListener(IOManager.IOManagerListener ioManagerListener)Adds the givenIOManagerListenerto the list of io manager listeners.voidaddOutputSerializer(OutputSerializer os)Registers the given output serializer.InputSerializercreateInputSerializer(InputStream in, String extSearch)Creates an instance of an input serializer from the given extension.JFileChoosercreateOpenFileChooser()Modifies the given file chooser by registering file extensions from the input serializers.OutputSerializercreateOutputSerializer(String extSearch)Creates an instance of an output serializer from the given extension.OutputSerializercreateOutputSerializer(String extSearch, String fileTypeDescription)Creates an instance of an output serializer from the given extension and file type description.JFileChoosercreateSaveFileChooser()Creates and returns a file open chooser dialog with the registered file extensions from the output serializers.JFileChoosercreateSaveFileChooser(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.JFileChoosergetFileChooser()Set<String>getGraphFileExtensions()booleanhasInputSerializer()Returnstrue, if the io manager has a registered input manager.booleanhasOutputSerializer()Returnstrue, if the io manager has a registered output manager.voidpluginAdded(GenericPlugin plugin, PluginDescription desc)Called by the plugin manager, iff a plugin has been added.booleanremoveListener(IOManager.IOManagerListener l)Returnstrue, if the given io manager listener was in the list of listeners and could be removed.StringtoString()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:IOManagerRegisters the given input serializer.- Specified by:
addInputSerializerin interfaceIOManager- Parameters:
is- the new serializer to add.
-
addListener
Description copied from interface:IOManagerAdds the givenIOManagerListenerto the list of io manager listeners.- Specified by:
addListenerin interfaceIOManager- Parameters:
ioManagerListener- the listener to add.
-
addOutputSerializer
Description copied from interface:IOManagerRegisters the given output serializer.- Specified by:
addOutputSerializerin interfaceIOManager- Parameters:
os- the new serializer to add.
-
createInputSerializer
public InputSerializer createInputSerializer(InputStream in, String extSearch) throws FileNotFoundExceptionDescription copied from interface:IOManagerCreates an instance of an input serializer from the given extension.- Specified by:
createInputSerializerin interfaceIOManager- Returns:
- DOCUMENT ME!
- Throws:
FileNotFoundException
-
getGraphFileExtensions
- Specified by:
getGraphFileExtensionsin interfaceIOManager
-
createOpenFileChooser
Description copied from interface:IOManagerModifies the given file chooser by registering file extensions from the input serializers.- Specified by:
createOpenFileChooserin interfaceIOManager- Returns:
- DOCUMENT ME!
-
createOutputSerializer
Description copied from interface:IOManagerCreates an instance of an output serializer from the given extension.- Specified by:
createOutputSerializerin interfaceIOManager- Returns:
- DOCUMENT ME!
-
createOutputSerializer
Description copied from interface:IOManagerCreates an instance of an output serializer from the given extension and file type description.- Specified by:
createOutputSerializerin interfaceIOManager- Returns:
- the output serializer
-
createSaveFileChooser
Description copied from interface:IOManagerCreates 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:
createSaveFileChooserin interfaceIOManager- Returns:
- DOCUMENT ME!
-
createSaveFileChooser
Description copied from interface:IOManagerCreates 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:
createSaveFileChooserin interfaceIOManager- Parameters:
g- The graph to test for output serializer compatibility- Returns:
- the FilechooserDialog object
-
hasInputSerializer
public boolean hasInputSerializer()Description copied from interface:IOManagerReturnstrue, if the io manager has a registered input manager.- Specified by:
hasInputSerializerin interfaceIOManager- Returns:
true, if the io manager has a registered input manager.
-
hasOutputSerializer
public boolean hasOutputSerializer()Description copied from interface:IOManagerReturnstrue, if the io manager has a registered output manager.- Specified by:
hasOutputSerializerin interfaceIOManager- Returns:
true, if the io manager has a registered output manager.
-
pluginAdded
Description copied from interface:PluginManagerListenerCalled by the plugin manager, iff a plugin has been added.- Specified by:
pluginAddedin interfacePluginManagerListener- Parameters:
plugin- the added plugin.desc- the description of the new plugin.
-
removeListener
Description copied from interface:IOManagerReturnstrue, if the given io manager listener was in the list of listeners and could be removed.- Specified by:
removeListenerin 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:
toStringin classObject- See Also:
Object.toString()
-