Class JaxoExportPlugin

    • Constructor Detail

      • JaxoExportPlugin

        public JaxoExportPlugin()
    • Method Detail

      • setGraph

        public final void setGraph​(JaxoGraph newGraph)
        Sets the graph to export. Makes a backup of the original graph and breaks all groups.
        Parameters:
        newGraph - The graph to export.
      • getGraph

        public final JaxoGraph getGraph()
        Returns the current graph to export.
        Returns:
        The graph to export.
      • setCanvasSize

        @Deprecated
        public void setCanvasSize​(java.awt.Dimension value)
        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
        protected java.awt.Dimension 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

        public final void export​(java.lang.String fileName)
        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

        public void export​(JaxoGraph exportGraph,
                           java.lang.String fileName)
        Export a graph to a file.
        Parameters:
        exportGraph - The graph to export.
        fileName - Absolute path of the file to export to.
      • preview

        public void preview​(JaxoPreview p)
        Show a preview in a new window.
        Parameters:
        p - The JaxoPreview to use.
      • paintGraph

        protected void paintGraph​(java.awt.Graphics2D g2d,
                                  boolean printing)
        Paint the graph.
        Parameters:
        g2d - the graphics context to paint to.
        printing - set to true to suppress any UI-elements or aids.
      • showErrorDialog

        protected void showErrorDialog​(java.lang.String message)
        Show an error message window, unless silent.
        Parameters:
        message - The message to display.
      • errorDialogMessage

        protected java.lang.String errorDialogMessage​(java.lang.String fileName)
        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

        public java.lang.String getLaTeXTextWarning()
        Returns an internationalized warning when latex texts are present in the graph.
        Returns:
        A translated warning.
      • getPSTextWarning

        public java.lang.String getPSTextWarning()
        Returns an internationalized warning when postscript texts are present in the graph.
        Returns:
        A translated warning.
      • getPSTextWarningForLaTeX

        public java.lang.String getPSTextWarningForLaTeX()
        Returns an internationalized warning when postscript texts are present in the graph.
        Returns:
        A translated warning.
      • getColorSpaceWarningForLaTeX

        public java.lang.String 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

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

        protected abstract void exportTo​(java.lang.String fileName)
                                  throws JaxoPluginExecutionException
        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

        public abstract void preview​(JaxoPreview p,
                                     boolean sameWindow)
        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

        public abstract java.lang.String 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.