Package com.mxgraph.io.graphml
Class mxGraphMlGraph
- java.lang.Object
-
- com.mxgraph.io.graphml.mxGraphMlGraph
-
public class mxGraphMlGraph extends java.lang.ObjectRepresents a Graph element in the GML Structure.
-
-
Constructor Summary
Constructors Constructor Description mxGraphMlGraph()Constructs an empty graph.mxGraphMlGraph(java.lang.String id, java.lang.String edgedefault)Constructs a graph with id and edge default direction.mxGraphMlGraph(org.w3c.dom.Element graphElement)Constructs a graph from a xml graph element.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddGraph(mxGraph graph, java.lang.Object parent)Adds the elements represented for this graph model into the given graph.static mxGraphMlDatadataEdgeKey(mxGraphMlEdge edge)Returns the data element inside the edge that references to the key element with name = KEY_EDGE_NAME.static mxGraphMlDatadataNodeKey(mxGraphMlNode node)Returns the data element inside the node that references to the key element with name = KEY_NODE_NAME.org.w3c.dom.ElementgenerateElement(org.w3c.dom.Document document)Generates a Key Element from this class.java.lang.StringgetEdgedefault()java.util.List<mxGraphMlEdge>getEdges()java.lang.StringgetId()java.util.List<mxGraphMlNode>getNodes()static booleanhasData(mxGraphMlNode node)Checks if the node has data elements inside.booleanisEmpty()Checks if the graph has child nodes or edges.voidsetEdgedefault(java.lang.String edgedefault)voidsetEdges(java.util.List<mxGraphMlEdge> edge)voidsetId(java.lang.String id)voidsetNodes(java.util.List<mxGraphMlNode> node)
-
-
-
Constructor Detail
-
mxGraphMlGraph
public mxGraphMlGraph(java.lang.String id, java.lang.String edgedefault)Constructs a graph with id and edge default direction.- Parameters:
id- Graph's IDedgedefault- Edge Default direction.("directed" or "undirected")
-
mxGraphMlGraph
public mxGraphMlGraph()
Constructs an empty graph.
-
mxGraphMlGraph
public mxGraphMlGraph(org.w3c.dom.Element graphElement)
Constructs a graph from a xml graph element.- Parameters:
graphElement- Xml graph element.
-
-
Method Detail
-
addGraph
public void addGraph(mxGraph graph, java.lang.Object parent)
Adds the elements represented for this graph model into the given graph.- Parameters:
graph- Graph where the elements will be locatedparent- Parent of the cells to be added.
-
hasData
public static boolean hasData(mxGraphMlNode node)
Checks if the node has data elements inside.- Parameters:
node- Gml node element.- Returns:
- Returns
trueif the node has data elements inside.
-
dataNodeKey
public static mxGraphMlData dataNodeKey(mxGraphMlNode node)
Returns the data element inside the node that references to the key element with name = KEY_NODE_NAME.- Parameters:
node- Gml Node element.- Returns:
- The required data. null if not found.
-
dataEdgeKey
public static mxGraphMlData dataEdgeKey(mxGraphMlEdge edge)
Returns the data element inside the edge that references to the key element with name = KEY_EDGE_NAME.- Parameters:
edge- Gml Edge element.- Returns:
- The required data. null if not found.
-
getEdgedefault
public java.lang.String getEdgedefault()
-
setEdgedefault
public void setEdgedefault(java.lang.String edgedefault)
-
getId
public java.lang.String getId()
-
setId
public void setId(java.lang.String id)
-
getNodes
public java.util.List<mxGraphMlNode> getNodes()
-
setNodes
public void setNodes(java.util.List<mxGraphMlNode> node)
-
getEdges
public java.util.List<mxGraphMlEdge> getEdges()
-
setEdges
public void setEdges(java.util.List<mxGraphMlEdge> edge)
-
isEmpty
public boolean isEmpty()
Checks if the graph has child nodes or edges.- Returns:
- Returns
trueif the graph hasn't child nodes or edges.
-
generateElement
public org.w3c.dom.Element generateElement(org.w3c.dom.Document document)
Generates a Key Element from this class.- Parameters:
document- Document where the key Element will be inserted.- Returns:
- Returns the generated Elements.
-
-