Package com.mxgraph.io.graphml
Class mxGraphMlGraph
java.lang.Object
com.mxgraph.io.graphml.mxGraphMlGraph
Represents a Graph element in the GML Structure.
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs an empty graph.mxGraphMlGraph
(String id, String edgedefault) Constructs a graph with id and edge default direction.mxGraphMlGraph
(Element graphElement) Constructs a graph from a xml graph element. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds the elements represented for this graph model into the given graph.static mxGraphMlData
dataEdgeKey
(mxGraphMlEdge edge) Returns the data element inside the edge that references to the key element with name = KEY_EDGE_NAME.static mxGraphMlData
dataNodeKey
(mxGraphMlNode node) Returns the data element inside the node that references to the key element with name = KEY_NODE_NAME.generateElement
(Document document) Generates a Key Element from this class.getEdges()
getId()
getNodes()
static boolean
hasData
(mxGraphMlNode node) Checks if the node has data elements inside.boolean
isEmpty()
Checks if the graph has child nodes or edges.void
setEdgedefault
(String edgedefault) void
setEdges
(List<mxGraphMlEdge> edge) void
void
setNodes
(List<mxGraphMlNode> node)
-
Constructor Details
-
mxGraphMlGraph
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
Constructs a graph from a xml graph element.- Parameters:
graphElement
- Xml graph element.
-
-
Method Details
-
addGraph
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
Checks if the node has data elements inside.- Parameters:
node
- Gml node element.- Returns:
- Returns
true
if the node has data elements inside.
-
dataNodeKey
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
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
-
setEdgedefault
-
getId
-
setId
-
getNodes
-
setNodes
-
getEdges
-
setEdges
-
isEmpty
public boolean isEmpty()Checks if the graph has child nodes or edges.- Returns:
- Returns
true
if the graph hasn't child nodes or edges.
-
generateElement
Generates a Key Element from this class.- Parameters:
document
- Document where the key Element will be inserted.- Returns:
- Returns the generated Elements.
-