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 java.lang.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(java.util.Iterator<?> it, org.w3c.dom.Node node, org.w3c.dom.Document document)
           
private static org.w3c.dom.Document createXmlDocument(MapPNode map)
          Creates a XML Document containing all labels from the map
static org.w3c.dom.Document readXmlDocumentFromFile(java.io.File f)
           
static java.util.ArrayList<LabelDescription>[] restoreLabelsByFontSizeLevel(java.io.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(java.io.File f)
           
static boolean saveLabelsToFile(MapPNode map, java.io.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,
                                       java.io.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(java.util.Iterator<?> it,
                                   org.w3c.dom.Node node,
                                   org.w3c.dom.Document document)

createXmlDocument

private static org.w3c.dom.Document createXmlDocument(MapPNode map)
                                               throws javax.xml.parsers.ParserConfigurationException
Creates a XML Document containing all labels from the map

Throws:
javax.xml.parsers.ParserConfigurationException

readXmlDocumentFromFile

public static org.w3c.dom.Document readXmlDocumentFromFile(java.io.File f)
                                                    throws javax.xml.parsers.ParserConfigurationException,
                                                           org.xml.sax.SAXException,
                                                           java.io.IOException
Throws:
javax.xml.parsers.ParserConfigurationException
org.xml.sax.SAXException
java.io.IOException

restoreLabelsFromFile

public static edu.umd.cs.piccolo.PNode restoreLabelsFromFile(java.io.File f)
                                                      throws javax.xml.parsers.ParserConfigurationException,
                                                             org.xml.sax.SAXException,
                                                             java.io.IOException
Throws:
javax.xml.parsers.ParserConfigurationException
org.xml.sax.SAXException
java.io.IOException

restoreLabelsByFontSizeLevel

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

Throws:
javax.xml.parsers.ParserConfigurationException
org.xml.sax.SAXException
java.io.IOException