Package com.mxgraph.io
Class mxGraphMlCodec
java.lang.Object
com.mxgraph.io.mxGraphMlCodec
Parses a GraphML .graphml file and imports it in the given graph.
See wikipedia.org/wiki/GraphML for more on GraphML. This class depends from the classes contained in com.mxgraph.io.gmlImplements.
See wikipedia.org/wiki/GraphML for more on GraphML. This class depends from the classes contained in com.mxgraph.io.gmlImplements.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddEdgeData(mxGraphMlEdge gmlEdge, mxCell v) Add the edge data in the gmlEdge.static voidaddNodeData(mxGraphMlNode gmlNode, mxCell v) Add the node data in the gmlNode.static voidReceives a GraphMl document and parses it generating a new graph that is inserted in graph.static mxGraphMlGraphdecodeGraph(mxGraph graph, Object parent, mxGraphMlGraph gmlGraph) Returns a Gml graph with the data of the vertexes and edges in the graph.static DocumentGenerates a Xml document with the cells in the graph.static DocumentencodeXML(mxGraphMlGraph gmlGraph) Generates a Xml document with the gmlGraph.
-
Constructor Details
-
mxGraphMlCodec
public mxGraphMlCodec()
-
-
Method Details
-
decode
Receives a GraphMl document and parses it generating a new graph that is inserted in graph.- Parameters:
document- XML to be parsedgraph- Graph where the parsed graph is included.
-
encodeXML
Generates a Xml document with the gmlGraph.- Parameters:
gmlGraph- Graph model.- Returns:
- The Xml document generated.
-
encode
Generates a Xml document with the cells in the graph.- Parameters:
graph- Graph with the cells.- Returns:
- The Xml document generated.
-
decodeGraph
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
Add the node data in the gmlNode.- Parameters:
gmlNode- Gml node where the data add.v- mxCell where data are obtained.
-
addEdgeData
Add the edge data in the gmlEdge.- Parameters:
gmlEdge- Gml edge where the data add.v- mxCell where data are obtained.
-