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
An abstract superclass for all import plugins.
- Since:
- 2.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Apply the changes made in the configuration panel.Returns the current charset name.Returns a panel that allows to configure optional parameters of this import format.importGraph
(File f) Imports a graph from the given file.protected abstract JaxoGraph
importGraph
(InputStream inputStream) Import a graph from a Reader.importGraph
(String fileName) Imports a graph from the given file.void
setCharsetName
(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
-
Constructor Details
-
JaxoImportPlugin
public JaxoImportPlugin()
-
-
Method Details
-
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
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
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
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
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.
-