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 voidApply the changes made in the configuration panel.protected StringerrorDialogMessage(String fileName) Returns a default error message for exporting to 'fileName'.final voidExport the current graph to the given nonempty file name.voidExport a graph to a file.protected abstract voidExport the graph to the given nonempty file name.protected DimensionDeprecated.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 JComponentReturns a panel that allows to configure optional parameters of this export format.final JaxoGraphgetGraph()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 StringReturns a warning, eg if a part of the graph cannot be exported to the current format.protected voidpaintGraph(Graphics2D g2d, boolean printing) Paint the graph.voidShow a preview in a new window.abstract voidpreview(JaxoPreview p, boolean sameWindow) Show a preview.voidsetCanvasSize(Dimension value) Deprecated.this is not used, exports should not depend on the canvas size!final voidSets the graph to export.protected voidshowErrorDialog(String message) Show an error message window, unless silent.Methods inherited from class AbstractJaxoPlugin
close, getClassName, getFailure, getFileExtension, getFileExtensionDescription, getFormatName, getLang, getLog, getParentComponent, getProperties, getProperty, getProperty, getShortGraphName, hasFailed, isSilent, loadProperties, pluginName, registerDictionary, setFailure, setParentComponent, setProperty, setShortGraphName, setSilent, storePropertiesMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface JaxoLocalized
updateLanguageMethods inherited from interface 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
-
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
-
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.
-