Class JaxoExportLatex

  • All Implemented Interfaces:
    JaxoPlugin, JaxoLocalized

    public class JaxoExportLatex
    extends JaxoExport
    The class that is responsible for creating LaTex source files that may be used to produce a postscript file that is (should be) equivalent to the one produced by JaxoDraw. Not that you need J. Vermaseren's axodraw package to process the LaTex source.
    Since:
    2.0
    • Constructor Detail

      • JaxoExportLatex

        public JaxoExportLatex()
    • Method Detail

      • getFormatName

        public final java.lang.String getFormatName()
        The name of the plugin (export or import) format.
        Specified by:
        getFormatName in class AbstractJaxoPlugin
        Returns:
        An (internationalized) name of the plugin format.
      • getFileExtension

        public final java.lang.String getFileExtension()
        Extension to be used for plugin files.
        Specified by:
        getFileExtension in class AbstractJaxoPlugin
        Returns:
        The file extension.
      • getFileExtensionDescription

        public final java.lang.String getFileExtensionDescription()
        Description to be used for plugin file extensions.
        Specified by:
        getFileExtensionDescription in class AbstractJaxoPlugin
        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.
      • getWarningForGraph

        public java.lang.String getWarningForGraph()
        Returns a warning if the current graph contains a LaTeX text.
        Overrides:
        getWarningForGraph in class JaxoExport
        Returns:
        An (internationalized) warning.
      • exportTo

        protected final void exportTo​(java.lang.String fileName)
                               throws JaxoPluginExecutionException
        Export the graph to the given nonempty file name.
        Specified by:
        exportTo in class JaxoExportPlugin
        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.
      • latexFileAsString

        public final java.lang.String latexFileAsString()
        Returns the exported latex file as a String.
        Returns:
        the LaTeX file as a String.
      • exportTo

        protected final void exportTo​(java.lang.String fileName,
                                      boolean rescale)
                               throws JaxoPluginExecutionException
        Export the graph to the given nonempty file name.
        Parameters:
        fileName - The file to export to.
        rescale - true if the graph should be rescaled to fit on a page before experting, false otherwise.
        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:
        preview in class JaxoExportPlugin
        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.
      • getConfigurationPanel

        public javax.swing.JComponent getConfigurationPanel()
        Returns a panel that allows to configure optional parameters of this export format.
        Specified by:
        getConfigurationPanel in class JaxoExportPlugin
        Returns:
        Null by default, no options to configure.
      • updateLanguage

        public final void updateLanguage()
        Updates the component with the current language as set in the preferences (JaxoPrefs.PREF_LANGUAGE).