at.tuwien.ifs.somtoolbox.apps.viewer.fileutils
Class ExportUtils

java.lang.Object
  extended by at.tuwien.ifs.somtoolbox.apps.viewer.fileutils.ExportUtils

public class ExportUtils
extends Object

This class provides methods to export visualisations as images and complete maps as HTML.

Version:
$Id: ExportUtils.java 3590 2010-05-21 10:43:45Z mayer $
Author:
Rudolf Mayer

Field Summary
static String DATA_ITEM_SEPERATOR
           
static String RESOURCE_PATH_CSS
           
static String RESOURCE_PATH_ICONS
           
static String RESOURCE_PATH_XHTML
           
 
Constructor Summary
ExportUtils()
           
 
Method Summary
static void copyData(String fileNamePrefix, String dataDir, String styleSheetLink, String[] dataNames)
           
static void drawClassInfo(GrowingLayer growingLayer, MapPNode mapPnode, double unitWidth, Graphics2D graphics)
           
static void drawLinkInfo(GrowingLayer growingLayer, MapPNode mapPnode, double unitWidth, Graphics2D graphics, String dataFilesPrefix)
           
static JFileChooser getFileChooser(Component parent, JFileChooser fileChooser, JComponent accessory)
           
static File getFilePath(Component parent, JFileChooser fileChooser, String title)
           
static File getFilePath(Component parent, JFileChooser fileChooser, String title, FileFilter filter)
           
static BufferedImage getVisualization(AbstractBackgroundImageVisualizer abiv, int currentVariant, GrowingSOM gsom, int unitWidth)
           
static BufferedImage getVisualization(CommonSOMViewerStateData state, int unitWidth)
           
private static JFileChooser initFileChooser(JFileChooser fileChooser, FileFilter filter)
           
 void saveImageMap(GrowingLayer layer, int unitWidth, String fullPath, String baseFileName, String[][] visualisations, boolean isAudioSOM, SOMLibClassInformation classInfo, Color[] colors, Properties cleanDataNamesMapping, String inputDataFilesPrefix, String outputDataFilesPrefix, String htmlTemplatesDir, String imageMapTitle, boolean generateRhythmPatterns, boolean forceLinkGeneration)
           
static void saveMapPaneAsImage(Container container, JFileChooser fileChooser, GenericPNodeScrollPane mapPane, String title)
           
static void saveMapPaneAsImage(GenericPNodeScrollPane mapPane, String imagePath, boolean autoCrop)
           
static void saveRhythmPatternsOfWeightVectors(String basefileName, GrowingLayer layer)
           
static void saveVisualizationAsImage(CommonSOMViewerStateData state, int unitWidth, String imagePath)
           
static BufferedImage scaleBackgroundImage(CommonSOMViewerStateData state, int width)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DATA_ITEM_SEPERATOR

public static final String DATA_ITEM_SEPERATOR
See Also:
Constant Field Values

RESOURCE_PATH_XHTML

public static final String RESOURCE_PATH_XHTML
See Also:
Constant Field Values

RESOURCE_PATH_ICONS

public static final String RESOURCE_PATH_ICONS
See Also:
Constant Field Values

RESOURCE_PATH_CSS

public static final String RESOURCE_PATH_CSS
See Also:
Constant Field Values
Constructor Detail

ExportUtils

public ExportUtils()
Method Detail

scaleBackgroundImage

public static BufferedImage scaleBackgroundImage(CommonSOMViewerStateData state,
                                                 int width)
                                          throws SOMToolboxException
Throws:
SOMToolboxException

drawClassInfo

public static void drawClassInfo(GrowingLayer growingLayer,
                                 MapPNode mapPnode,
                                 double unitWidth,
                                 Graphics2D graphics)

drawLinkInfo

public static void drawLinkInfo(GrowingLayer growingLayer,
                                MapPNode mapPnode,
                                double unitWidth,
                                Graphics2D graphics,
                                String dataFilesPrefix)

saveImageMap

public void saveImageMap(GrowingLayer layer,
                         int unitWidth,
                         String fullPath,
                         String baseFileName,
                         String[][] visualisations,
                         boolean isAudioSOM,
                         SOMLibClassInformation classInfo,
                         Color[] colors,
                         Properties cleanDataNamesMapping,
                         String inputDataFilesPrefix,
                         String outputDataFilesPrefix,
                         String htmlTemplatesDir,
                         String imageMapTitle,
                         boolean generateRhythmPatterns,
                         boolean forceLinkGeneration)
                  throws SOMToolboxException
Throws:
SOMToolboxException

saveRhythmPatternsOfWeightVectors

public static void saveRhythmPatternsOfWeightVectors(String basefileName,
                                                     GrowingLayer layer)
                                              throws SOMToolboxException
Throws:
SOMToolboxException

saveVisualizationAsImage

public static void saveVisualizationAsImage(CommonSOMViewerStateData state,
                                            int unitWidth,
                                            String imagePath)
                                     throws SOMToolboxException
Throws:
SOMToolboxException

saveMapPaneAsImage

public static void saveMapPaneAsImage(Container container,
                                      JFileChooser fileChooser,
                                      GenericPNodeScrollPane mapPane,
                                      String title)

saveMapPaneAsImage

public static void saveMapPaneAsImage(GenericPNodeScrollPane mapPane,
                                      String imagePath,
                                      boolean autoCrop)
                               throws SOMToolboxException
Throws:
SOMToolboxException

getVisualization

public static BufferedImage getVisualization(CommonSOMViewerStateData state,
                                             int unitWidth)
                                      throws SOMToolboxException
Throws:
SOMToolboxException

getVisualization

public static BufferedImage getVisualization(AbstractBackgroundImageVisualizer abiv,
                                             int currentVariant,
                                             GrowingSOM gsom,
                                             int unitWidth)
                                      throws SOMToolboxException
Throws:
SOMToolboxException

getFileChooser

public static JFileChooser getFileChooser(Component parent,
                                          JFileChooser fileChooser,
                                          JComponent accessory)

getFilePath

public static File getFilePath(Component parent,
                               JFileChooser fileChooser,
                               String title)

getFilePath

public static File getFilePath(Component parent,
                               JFileChooser fileChooser,
                               String title,
                               FileFilter filter)

initFileChooser

private static JFileChooser initFileChooser(JFileChooser fileChooser,
                                            FileFilter filter)

copyData

public static void copyData(String fileNamePrefix,
                            String dataDir,
                            String styleSheetLink,
                            String[] dataNames)
                     throws FileNotFoundException,
                            IOException
Throws:
FileNotFoundException
IOException