Search this API

y.io.graphml.graph2d
Class GraphicsSerializationToolkit

java.lang.Object
  extended by y.io.graphml.graph2d.GraphicsSerializationToolkit

public class GraphicsSerializationToolkit
extends Object

Collection of utilities for handling GraphML.


Method Summary
static boolean getBooleanDeserializationProperty(GraphMLParseContext context, Object key)
           
static boolean getBooleanSerializationProperty(GraphMLWriteContext context, Object key)
           
static String getInnerText(Node node)
          Returns the concatenation of the contents of the child text and CDATA nodes of the given node.
static Color parseColor(String colorString)
          Decodes a color string produced by valueOf(java.awt.Color).
static void parseNodeLayout(Node root, NodeLayout nl)
          Configure nl from the data in root.
static void parsePath(Node root, EdgeLayout el)
          Configure el from the data in root.
static String parseText(Node text)
          Concatenates the first adjacent text node children of text.
static Image readSharedImageReference(String refid, GraphMLParseContext context)
           
static Object readSharedReference(String refid, GraphMLParseContext context, Class targetType)
           
static String valueOf(Color c)
          Gets the standard string representation of a java color.
static void writeNodeLayout(XmlWriter writer, NodeLayout nl)
          Writes the layout for a NodeLayout.
static void writePath(XmlWriter writer, EdgeLayout layout)
          Writes the path of an EdgeLayout.
static void writeSharedImageReference(Image ser, XmlWriter writer, String refIdAttrName, GraphMLWriteContext context)
           
static void writeSharedReference(Object ser, XmlWriter writer, String refIdAttrName, GraphMLWriteContext context)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

writePath

public static void writePath(XmlWriter writer,
                             EdgeLayout layout)
Writes the path of an EdgeLayout.


writeNodeLayout

public static void writeNodeLayout(XmlWriter writer,
                                   NodeLayout nl)
Writes the layout for a NodeLayout.


valueOf

public static String valueOf(Color c)
Gets the standard string representation of a java color.


parseText

public static String parseText(Node text)
Concatenates the first adjacent text node children of text.

Parameters:
text - The parent node whose text content is evaluated.
Returns:
The concatenated content of the first adjacent text node children of text.

parseNodeLayout

public static void parseNodeLayout(Node root,
                                   NodeLayout nl)
Configure nl from the data in root.

Parameters:
root - The layout data
nl - The NodeLayout to configure.

parsePath

public static void parsePath(Node root,
                             EdgeLayout el)
Configure el from the data in root.

Parameters:
root - The layout data
el - The EdgeLayout to configure.

parseColor

public static Color parseColor(String colorString)
Decodes a color string produced by valueOf(java.awt.Color).

Parameters:
colorString - the color string
Returns:
an opaque color if the color string is of the form #RRGGBB and a transparent color if the input string is of the form #RRGGBBAA, where AA denotes the alpha component of the color.

writeSharedReference

public static void writeSharedReference(Object ser,
                                        XmlWriter writer,
                                        String refIdAttrName,
                                        GraphMLWriteContext context)

writeSharedImageReference

public static void writeSharedImageReference(Image ser,
                                             XmlWriter writer,
                                             String refIdAttrName,
                                             GraphMLWriteContext context)

readSharedReference

public static Object readSharedReference(String refid,
                                         GraphMLParseContext context,
                                         Class targetType)
                                  throws GraphMLParseException
Throws:
GraphMLParseException

readSharedImageReference

public static Image readSharedImageReference(String refid,
                                             GraphMLParseContext context)
                                      throws GraphMLParseException
Throws:
GraphMLParseException

getBooleanSerializationProperty

public static boolean getBooleanSerializationProperty(GraphMLWriteContext context,
                                                      Object key)

getBooleanDeserializationProperty

public static boolean getBooleanDeserializationProperty(GraphMLParseContext context,
                                                        Object key)

getInnerText

public static String getInnerText(Node node)
Returns the concatenation of the contents of the child text and CDATA nodes of the given node.

Parameters:
node - a node
Returns:
the text and CDATA contents

© Copyright 2000-2013,
yWorks GmbH.
All rights reserved.