Package net.sf.jaxodraw.io.exports
Class JaxoExportImg
- java.lang.Object
-
- net.sf.jaxodraw.plugin.AbstractJaxoPlugin
-
- net.sf.jaxodraw.plugin.JaxoExportPlugin
-
- net.sf.jaxodraw.io.exports.JaxoExport
-
- net.sf.jaxodraw.io.exports.JaxoExportImg
-
- All Implemented Interfaces:
JaxoPlugin,JaxoLocalized
public class JaxoExportImg extends JaxoExport
The class that is responsible for exporting to image formats: jpg, or png are currently possible options. Asks for an export file name.- Since:
- 2.0
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classJaxoExportImg.FormatThe export modes supported by this JaxoExport.
-
Constructor Summary
Constructors Constructor Description JaxoExportImg(JaxoExportImg.Format exportMode)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcommitConfiguration()Apply the changes made in the configuration panel.java.lang.Stringdescription()Return a short description (preferably internationalized) of what this plugin does.protected voidexportTo(java.lang.String fileName)Export the graph to the given nonempty file name.javax.swing.JComponentgetConfigurationPanel()Returns a panel that allows to configure optional parameters of this export format.java.lang.StringgetFileExtension()Extension to be used for plugin files.java.lang.StringgetFileExtensionDescription()Description to be used for plugin file extensions.java.lang.StringgetFormatName()The name of the plugin (export or import) format.JaxoExportImg.FormatgetMode()Returns the current export mode.floatgetResolution()Resolution of produces images in dots-per-inch.java.lang.StringgetShortName()Return a short name for this plugin.booleanisAntialiasing()Returns the current antialias setting.java.lang.StringpluginId()This must return the class name of the plugin (MyPlugin.class.getName()).voidpreview(JaxoPreview p, boolean sameWindow)Show a preview.voidsetAntialiasing(boolean value)Sets the antialias setting.voidsetResolution(float value)Sets the resolution of the img export.voidupdateLanguage()Updates the component with the current language as set in the preferences (JaxoPrefs.PREF_LANGUAGE).-
Methods inherited from class net.sf.jaxodraw.io.exports.JaxoExport
getBuiltInFormats, getWarningForGraph, makeAvailableAtRuntime, version
-
Methods inherited from class net.sf.jaxodraw.plugin.JaxoExportPlugin
errorDialogMessage, export, export, getCanvasSize, getColorSpaceWarningForLaTeX, getGraph, getLaTeXTextWarning, getPSTextWarning, getPSTextWarningForLaTeX, paintGraph, preview, setCanvasSize, setGraph, showErrorDialog
-
Methods inherited from class net.sf.jaxodraw.plugin.AbstractJaxoPlugin
close, getClassName, getFailure, getLang, getLog, getParentComponent, getProperties, getProperty, getProperty, getShortGraphName, hasFailed, isSilent, loadProperties, pluginName, registerDictionary, setFailure, setParentComponent, setProperty, setShortGraphName, setSilent, storeProperties
-
-
-
-
Constructor Detail
-
JaxoExportImg
public JaxoExportImg(JaxoExportImg.Format exportMode)
Constructor.- Parameters:
exportMode- The export mode.
-
-
Method Detail
-
getResolution
public final float getResolution()
Resolution of produces images in dots-per-inch. The default is 72, corresponding to the default coordinate system.- Returns:
- The resolution.
-
setResolution
public final void setResolution(float value)
Sets the resolution of the img export.- Parameters:
value- The desired resolution.
-
getMode
public final JaxoExportImg.Format getMode()
Returns the current export mode.- Returns:
- The export mode.
-
setAntialiasing
public final void setAntialiasing(boolean value)
Sets the antialias setting.- Parameters:
value- The new antialias setting
-
isAntialiasing
public final boolean isAntialiasing()
Returns the current antialias setting.- Returns:
- The current antialias setting.
-
getFormatName
public final java.lang.String getFormatName()
The name of the plugin (export or import) format.- Specified by:
getFormatNamein classAbstractJaxoPlugin- Returns:
- An (internationalized) name of the plugin format.
-
getFileExtension
public final java.lang.String getFileExtension()
Extension to be used for plugin files.- Specified by:
getFileExtensionin classAbstractJaxoPlugin- Returns:
- The file extension.
-
getFileExtensionDescription
public final java.lang.String getFileExtensionDescription()
Description to be used for plugin file extensions.- Specified by:
getFileExtensionDescriptionin classAbstractJaxoPlugin- Returns:
- An (internationalized) description of the file extension.
-
description
public java.lang.String description()
Return a short description (preferably internationalized) of what this plugin does.- Returns:
- a description.
-
pluginId
public java.lang.String pluginId()
This must return the class name of the plugin (MyPlugin.class.getName()). It is used to uniquely identify the plugin.- Returns:
- the class name of the plugins' main class.
-
getShortName
public java.lang.String getShortName()
Return a short name for this plugin. This is used to construct names of output files, eg to get a "jaxodraw-pdf-plugin.properties" file, the short name should just be "pdf".- Returns:
- The short name of this plugin.
-
exportTo
protected void exportTo(java.lang.String fileName) throws JaxoPluginExecutionExceptionExport the graph to the given nonempty file name.- Specified by:
exportToin classJaxoExportPlugin- 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
public void preview(JaxoPreview p, boolean sameWindow)
Show a preview.- Specified by:
previewin classJaxoExportPlugin- 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.
-
commitConfiguration
public void commitConfiguration()
Apply the changes made in the configuration panel.- Specified by:
commitConfigurationin classJaxoExportPlugin
-
getConfigurationPanel
public javax.swing.JComponent getConfigurationPanel()
Returns a panel that allows to configure optional parameters of this export format.- Specified by:
getConfigurationPanelin classJaxoExportPlugin- Returns:
- A panel to configure background color, antialiasing and resolution.
-
updateLanguage
public final void updateLanguage()
Updates the component with the current language as set in the preferences (JaxoPrefs.PREF_LANGUAGE).
-
-