Package net.sf.jaxodraw.plugin
Class JaxoExportPlugin
java.lang.Object
net.sf.jaxodraw.plugin.AbstractJaxoPlugin
net.sf.jaxodraw.plugin.JaxoExportPlugin
- All Implemented Interfaces:
JaxoPlugin
,JaxoLocalized
- Direct Known Subclasses:
JaxoExport
An abstract superclass for all export plugins.
- Since:
- 2.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract void
Apply the changes made in the configuration panel.protected String
errorDialogMessage
(String fileName) Returns a default error message for exporting to 'fileName'.final void
Export the current graph to the given nonempty file name.void
Export a graph to a file.protected abstract void
Export the graph to the given nonempty file name.protected Dimension
Deprecated.this is not used, exports should not depend on the canvas size!Returns an internationalized warning when the color space is the complete one.abstract JComponent
Returns a panel that allows to configure optional parameters of this export format.final JaxoGraph
getGraph()
Returns the current graph to export.Returns an internationalized warning when latex texts are present in the graph.Returns an internationalized warning when postscript texts are present in the graph.Returns an internationalized warning when postscript texts are present in the graph.abstract String
Returns a warning, eg if a part of the graph cannot be exported to the current format.protected void
paintGraph
(Graphics2D g2d, boolean printing) Paint the graph.void
Show a preview in a new window.abstract void
preview
(JaxoPreview p, boolean sameWindow) Show a preview.void
setCanvasSize
(Dimension value) Deprecated.this is not used, exports should not depend on the canvas size!final void
Sets the graph to export.protected void
showErrorDialog
(String message) Show an error message window, unless silent.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
-
JaxoExportPlugin
public JaxoExportPlugin()
-
-
Method Details
-
setGraph
Sets the graph to export. Makes a backup of the original graph and breaks all groups.- Parameters:
newGraph
- The graph to export.
-
getGraph
Returns the current graph to export.- Returns:
- The graph to export.
-
setCanvasSize
Deprecated.this is not used, exports should not depend on the canvas size!Set the canvas size. In general, the canvas size is not needed.- Parameters:
value
- The canvas size.
-
getCanvasSize
Deprecated.this is not used, exports should not depend on the canvas size!Returns the canvas size.- Returns:
- The canvas size, or null, if it hasn't been set.
-
export
Export the current graph to the given nonempty file name. Checks if fileName is empty, if yes, does nothing.- Parameters:
fileName
- The file to export to.
-
export
Export a graph to a file.- Parameters:
exportGraph
- The graph to export.fileName
- Absolute path of the file to export to.
-
preview
Show a preview in a new window.- Parameters:
p
- The JaxoPreview to use.
-
paintGraph
Paint the graph.- Parameters:
g2d
- the graphics context to paint to.printing
- set to true to suppress any UI-elements or aids.
-
showErrorDialog
Show an error message window, unless silent.- Parameters:
message
- The message to display.
-
errorDialogMessage
Returns a default error message for exporting to 'fileName'.- Parameters:
fileName
- The file name to insert in the message.- Returns:
- a default error message.
-
getLaTeXTextWarning
Returns an internationalized warning when latex texts are present in the graph.- Returns:
- A translated warning.
-
getPSTextWarning
Returns an internationalized warning when postscript texts are present in the graph.- Returns:
- A translated warning.
-
getPSTextWarningForLaTeX
Returns an internationalized warning when postscript texts are present in the graph.- Returns:
- A translated warning.
-
getColorSpaceWarningForLaTeX
Returns an internationalized warning when the color space is the complete one.- Returns:
- A translated warning.
-
commitConfiguration
public abstract void commitConfiguration()Apply the changes made in the configuration panel. -
getConfigurationPanel
Returns a panel that allows to configure optional parameters of this export format.- Returns:
- Null by default, no options to configure.
-
exportTo
Export the graph to the given nonempty file name.- Parameters:
fileName
- The file to export to.- Throws:
JaxoPluginExecutionException
- if exporting fails. The exception message sould be displayable in error dialogs, so it should be an internationalized string.
-
preview
Show a preview.- Parameters:
p
- The JaxoPreview to show.sameWindow
- If false, a new window will be opened for the preview. If true, and if a preview window for the current format is open already, the same window will be used for the preview. Not all implementations may support this feature.
-
getWarningForGraph
Returns a warning, eg if a part of the graph cannot be exported to the current format.- Returns:
- An (internationalized) String, or null for no warning.
-