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
  • Field Details

  • Constructor Details

    • DefaultIOManager

      public DefaultIOManager()
      Constructs a new io manager.
  • Method Details

    • getFileChooser

      public JFileChooser getFileChooser()
    • addInputSerializer

      public void addInputSerializer​(InputSerializer is)
      Description copied from interface: IOManager
      Registers the given input serializer.
      Specified by:
      addInputSerializer in interface IOManager
      Parameters:
      is - the new serializer to add.
    • addListener

      public void addListener​(IOManager.IOManagerListener ioManagerListener)
      Description copied from interface: IOManager
      Adds the given IOManagerListener to the list of io manager listeners.
      Specified by:
      addListener in interface IOManager
      Parameters:
      ioManagerListener - the listener to add.
    • addOutputSerializer

      public void addOutputSerializer​(OutputSerializer os)
      Description copied from interface: IOManager
      Registers the given output serializer.
      Specified by:
      addOutputSerializer in interface IOManager
      Parameters:
      os - the new serializer to add.
    • createInputSerializer

      public InputSerializer createInputSerializer​(InputStream in, String extSearch) throws FileNotFoundException
      Description copied from interface: IOManager
      Creates an instance of an input serializer from the given extension.
      Specified by:
      createInputSerializer in interface IOManager
      Returns:
      DOCUMENT ME!
      Throws:
      FileNotFoundException
    • getGraphFileExtensions

      public Set<String> getGraphFileExtensions()
      Specified by:
      getGraphFileExtensions in interface IOManager
    • createOpenFileChooser

      public JFileChooser createOpenFileChooser()
      Description copied from interface: IOManager
      Modifies the given file chooser by registering file extensions from the input serializers.
      Specified by:
      createOpenFileChooser in interface IOManager
      Returns:
      DOCUMENT ME!
    • createOutputSerializer

      public OutputSerializer createOutputSerializer​(String extSearch)
      Description copied from interface: IOManager
      Creates an instance of an output serializer from the given extension.
      Specified by:
      createOutputSerializer in interface IOManager
      Returns:
      DOCUMENT ME!
    • createOutputSerializer

      public OutputSerializer createOutputSerializer​(String extSearch, String fileTypeDescription)
      Description copied from interface: IOManager
      Creates an instance of an output serializer from the given extension and file type description.
      Specified by:
      createOutputSerializer in interface IOManager
      Returns:
      the output serializer
    • createSaveFileChooser

      public JFileChooser 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 interface IOManager
      Returns:
      DOCUMENT ME!
    • createSaveFileChooser

      public JFileChooser createSaveFileChooser​(Graph g)
      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 interface IOManager
      Parameters:
      g - The graph to test for output serializer compatibility
      Returns:
      the FilechooserDialog object
    • hasInputSerializer

      public boolean hasInputSerializer()
      Description copied from interface: IOManager
      Returns true, if the io manager has a registered input manager.
      Specified by:
      hasInputSerializer in interface IOManager
      Returns:
      true, if the io manager has a registered input manager.
    • hasOutputSerializer

      public boolean hasOutputSerializer()
      Description copied from interface: IOManager
      Returns true, if the io manager has a registered output manager.
      Specified by:
      hasOutputSerializer in interface IOManager
      Returns:
      true, if the io manager has a registered output manager.
    • pluginAdded

      public void pluginAdded​(GenericPlugin plugin, PluginDescription desc)
      Description copied from interface: PluginManagerListener
      Called by the plugin manager, iff a plugin has been added.
      Specified by:
      pluginAdded in interface PluginManagerListener
      Parameters:
      plugin - the added plugin.
      desc - the description of the new plugin.
    • removeListener

      public boolean removeListener​(IOManager.IOManagerListener l)
      Description copied from interface: IOManager
      Returns true, if the given io manager listener was in the list of listeners and could be removed.
      Specified by:
      removeListener in interface IOManager
      Parameters:
      l - the io manager listener to remove.
      Returns:
      DOCUMENT ME!
    • toString

      public String toString()
      Returns a string representation of the io manager. Useful for debugging.
      Overrides:
      toString in class Object
      See Also:
      Object.toString()