Class JaxoImportPlugin

java.lang.Object
net.sf.jaxodraw.plugin.AbstractJaxoPlugin
net.sf.jaxodraw.plugin.JaxoImportPlugin
All Implemented Interfaces:
JaxoPlugin, JaxoLocalized
Direct Known Subclasses:
JaxoImport

public abstract class JaxoImportPlugin extends AbstractJaxoPlugin
An abstract superclass for all import plugins.
Since:
2.0
  • Constructor Details

    • JaxoImportPlugin

      public JaxoImportPlugin()
  • Method Details

    • getCharsetName

      public String getCharsetName()
      Returns the current charset name. Defaults to null, which means the system default encoding will be used for reading files.
      Returns:
      The current charset name.
    • setCharsetName

      public void setCharsetName(String name)
      Sets the charset name.
      Parameters:
      name - The charset to use. No check is done here whether the given charset name is valid or the corresponding Charset is supported. Set this to null to use the system default encoding.
    • importGraph

      public JaxoGraph importGraph(String fileName)
      Imports a graph from the given file.
      Parameters:
      fileName - The absolute path to the file to be imported
      Returns:
      The imported JaxoGraph or null, if no file was imported
    • importGraph

      public JaxoGraph importGraph(File f)
      Imports a graph from the given file.
      Parameters:
      f - The file to be imported
      Returns:
      The imported JaxoGraph or null, if no file was imported
    • getConfigurationPanel

      public JComponent getConfigurationPanel()
      Returns a panel that allows to configure optional parameters of this import format. By default, an empty component is returned, implementing classes should override this to provide a custom component.
      Returns:
      an empty component by default.
    • commitConfiguration

      public void commitConfiguration()
      Apply the changes made in the configuration panel. By default does nothing, implementing classes should override this to provide a custom behavior.
    • importGraph

      protected abstract JaxoGraph importGraph(InputStream inputStream) throws JaxoPluginExecutionException
      Import a graph from a Reader.
      Parameters:
      inputStream - An InputStream to supply the input data.
      Returns:
      The imported JaxoGraph or null, if importing failed.
      Throws:
      JaxoPluginExecutionException - if the graph could not be imported. Note that the message of the Exception should be an internationalized String.