Package net.sf.jaxodraw.plugin
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 Summary
Constructors Constructor Description JaxoImportPlugin()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
commitConfiguration()
Apply the changes made in the configuration panel.java.lang.String
getCharsetName()
Returns the current charset name.javax.swing.JComponent
getConfigurationPanel()
Returns a panel that allows to configure optional parameters of this import format.JaxoGraph
importGraph(java.io.File f)
Imports a graph from the given file.protected abstract JaxoGraph
importGraph(java.io.InputStream inputStream)
Import a graph from a Reader.JaxoGraph
importGraph(java.lang.String fileName)
Imports a graph from the given file.void
setCharsetName(java.lang.String name)
Sets the charset name.-
Methods inherited from class net.sf.jaxodraw.plugin.AbstractJaxoPlugin
close, getClassName, getFailure, getFileExtension, getFileExtensionDescription, getFormatName, getLang, getLog, getParentComponent, getProperties, getProperty, getProperty, getShortGraphName, hasFailed, isSilent, loadProperties, pluginName, registerDictionary, setFailure, setParentComponent, setProperty, setShortGraphName, setSilent, storeProperties
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.sf.jaxodraw.util.JaxoLocalized
updateLanguage
-
Methods inherited from interface net.sf.jaxodraw.plugin.JaxoPlugin
description, getShortName, makeAvailableAtRuntime, pluginId, version
-
-
-
-
Method Detail
-
getCharsetName
public java.lang.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(java.lang.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(java.lang.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(java.io.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 javax.swing.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(java.io.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.
-
-