Environment for
DeveLoping
KDD-Applications
Supported by Index-Structures

de.lmu.ifi.dbs.elki.visualization.savedialog
Class SVGSaveDialog

java.lang.Object
  extended by de.lmu.ifi.dbs.elki.visualization.savedialog.SVGSaveDialog

public class SVGSaveDialog
extends Object

A save dialog to save/export a SVG image to a file. Supported formats:

Author:
Simon Mittermüller

Field Summary
(package private) static String automagic_format
          Automagic file format
static String DEFAULT_TITLE
          The default title.
(package private) static String[] formats
          Supported file format (extensions)
private static Logging logger
          Static logger reference
(package private) static String[] visibleformats
          Visible file formats
 
Constructor Summary
SVGSaveDialog()
           
 
Method Summary
static String[] getFormats()
           
static String[] getVisibleFormats()
           
static String guessFormat(String name)
          Guess a supported format from the file name.
private static void showError(Component parent, String title, String msg)
          Helper method to show a error message as "popup".
static int showSaveDialog(SVGPlot plot, int width, int height)
          Show a "Save as" dialog.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_TITLE

public static final String DEFAULT_TITLE
The default title. "Save as ...".

See Also:
Constant Field Values

logger

private static final Logging logger
Static logger reference


automagic_format

static final String automagic_format
Automagic file format

See Also:
Constant Field Values

formats

static final String[] formats
Supported file format (extensions)


visibleformats

static final String[] visibleformats
Visible file formats

Constructor Detail

SVGSaveDialog

public SVGSaveDialog()
Method Detail

showSaveDialog

public static int showSaveDialog(SVGPlot plot,
                                 int width,
                                 int height)
Show a "Save as" dialog.

Parameters:
plot - The plot to be exported.
width - The width of the exported image (when export to JPEG/PNG).
height - The height of the exported image (when export to JPEG/PNG).
Returns:
Result from JFileChooser.showSaveDialog(java.awt.Component)

guessFormat

public static String guessFormat(String name)
Guess a supported format from the file name. For "auto" format handling.

Parameters:
name - File name
Returns:
format or "null"

getFormats

public static String[] getFormats()
Returns:
the formats

getVisibleFormats

public static String[] getVisibleFormats()
Returns:
the visibleformats

showError

private static void showError(Component parent,
                              String title,
                              String msg)
Helper method to show a error message as "popup". Calls JOptionPane.showMessageDialog(java.awt.Component, Object).

Parameters:
parent - The parent component for the popup.
msg - The message to be displayed.

Release 0.2.1 (2009-07-13_1605)