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

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

public class LabelXmlUtils
extends Object

Provides functionality to save all labels into a XML file.

Version:
$Id: LabelXmlUtils.java 3877 2010-11-02 15:43:17Z frank $
Author:
Angela Roiger

Field Summary
private static EditLabelEventListener ll
           
 
Constructor Summary
LabelXmlUtils()
           
 
Method Summary
private static void addLabelsToXml(Iterator<?> it, Node node, Document document)
           
private static Document createXmlDocument(MapPNode map)
          Creates a XML Document containing all labels from the map
static Document readXmlDocumentFromFile(File f)
           
static ArrayList<LabelDescription>[] restoreLabelsByFontSizeLevel(File f)
          Reads the labels from the given file, and groups them regarding their font size into arrays.
static edu.umd.cs.piccolo.PNode restoreLabelsFromFile(File f)
           
static boolean saveLabelsToFile(MapPNode map, File f)
          Saves the labels(cluster labels and manual labels) of the map to the file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ll

private static EditLabelEventListener ll
Constructor Detail

LabelXmlUtils

public LabelXmlUtils()
Method Detail

saveLabelsToFile

public static boolean saveLabelsToFile(MapPNode map,
                                       File f)
Saves the labels(cluster labels and manual labels) of the map to the file.

Parameters:
map - the MapPNode containing the labels
f - the File to store the labels
Returns:
returns true if saving to File was successful, false otherwise

addLabelsToXml

private static void addLabelsToXml(Iterator<?> it,
                                   Node node,
                                   Document document)

createXmlDocument

private static Document createXmlDocument(MapPNode map)
                                   throws ParserConfigurationException
Creates a XML Document containing all labels from the map

Throws:
ParserConfigurationException

readXmlDocumentFromFile

public static Document readXmlDocumentFromFile(File f)
                                        throws ParserConfigurationException,
                                               SAXException,
                                               IOException
Throws:
ParserConfigurationException
SAXException
IOException

restoreLabelsFromFile

public static edu.umd.cs.piccolo.PNode restoreLabelsFromFile(File f)
                                                      throws ParserConfigurationException,
                                                             SAXException,
                                                             IOException
Throws:
ParserConfigurationException
SAXException
IOException

restoreLabelsByFontSizeLevel

public static ArrayList<LabelDescription>[] restoreLabelsByFontSizeLevel(File f)
                                                                  throws ParserConfigurationException,
                                                                         SAXException,
                                                                         IOException
Reads the labels from the given file, and groups them regarding their font size into arrays.

Throws:
ParserConfigurationException
SAXException
IOException