JGraph X 1.4.1.0


com.mxgraph.io
Class mxGmlCodec

java.lang.Object
  extended by com.mxgraph.io.mxGmlCodec

public class mxGmlCodec
extends Object

Parses a GraphML .graphml file and imports it in the given graph.
This class depends from the classes contained in com.mxgraph.io.gmlImplements.


Constructor Summary
mxGmlCodec()
           
 
Method Summary
static void addEdgeData(mxGmlEdge gmlEdge, mxCell v)
          Add the edge data in the gmlEdge.
static void addNodeData(mxGmlNode gmlNode, mxCell v)
          Add the node data in the gmlNode.
static void decode(Document document, mxGraph graph)
          Receives a GraphMl document and parses it generating a new graph that is inserted in graph.
static mxGmlGraph decodeGraph(mxGraph graph, Object parent, mxGmlGraph gmlGraph)
          Returns a Gml graph with the data of the vertexes and edges in the graph.
static Document encode(mxGraph graph)
          Generates a Xml document with the cells in the graph.
static Document encodeXML(mxGmlGraph gmlGraph)
          Generates a Xml document with the gmlGraph.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

mxGmlCodec

public mxGmlCodec()
Method Detail

decode

public static void decode(Document document,
                          mxGraph graph)
Receives a GraphMl document and parses it generating a new graph that is inserted in graph.

Parameters:
document - XML to be parsed
graph - Graph where the parsed graph is included.

encodeXML

public static Document encodeXML(mxGmlGraph gmlGraph)
Generates a Xml document with the gmlGraph.

Parameters:
gmlGraph - Graph model.
Returns:
The Xml document generated.

encode

public static Document encode(mxGraph graph)
Generates a Xml document with the cells in the graph.

Parameters:
graph - Graph with the cells.
Returns:
The Xml document generated.

decodeGraph

public static mxGmlGraph decodeGraph(mxGraph graph,
                                     Object parent,
                                     mxGmlGraph gmlGraph)
Returns a Gml graph with the data of the vertexes and edges in the graph.

Parameters:
gmlGraph - Gml document where the elements are put.
parent - Parent cell of the vertexes and edges to be added.
graph - Graph that contains the vertexes and edges.
Returns:
Returns the document with the elements added.

addNodeData

public static void addNodeData(mxGmlNode gmlNode,
                               mxCell v)
Add the node data in the gmlNode.

Parameters:
gmlNode - Gml node where the data add.
v - mxCell where data are obtained.

addEdgeData

public static void addEdgeData(mxGmlEdge gmlEdge,
                               mxCell v)
Add the edge data in the gmlEdge.

Parameters:
gmlEdge - Gml edge where the data add.
v - mxCell where data are obtained.

JGraph X 1.4.1.0


Copyright (c) 2010 Gaudenz Alder. All rights reserved.