- java.lang.Object
-
- org.jgrapht.nio.dot.DOTSubgraph<V,E>
-
- Type Parameters:
V- the vertex typeE- the edge type
public class DOTSubgraph<V,E> extends Object
A DOTSubgraph is a container class for a subgraph and its attributes. It may be used in DOT export and can be parametrized to export or not vertices and/or edges.For example, for a subgraph named "subg" with DefaultEdges (1, 2) and (2, 3) between Integer vertices 1, 2, and 3, with the subgraph attribute
pencolorset totransparent, and the cluster attributeshapeset topoint, the DOT export of the subgraph will be:subgraph subg { subg [ shape="point" ] pencolor=transparent; 1; 2; 3; 1 -- 2; 2 -- 3; }- Author:
- Nicolas Rol <nicolas.rol at rte-france.com>
- See Also:
AsSubgraph,DOTExporter
-
-
Constructor Summary
Constructors Constructor Description DOTSubgraph(AsSubgraph<V,E> subgraph, Map<String,Attribute> subgraphAttributes, Map<String,Attribute> clusterAttributes)Constructs a new DOTSubgraph with specified subgraph, attributes.DOTSubgraph(AsSubgraph<V,E> subgraph, Map<String,Attribute> subgraphAttributes, Map<String,Attribute> clusterAttributes, boolean exportVertices, boolean exportEdges)Constructs a new DOTSubgraph with specified subgraph, attributes, and export options.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Set<E>edgeSet()Get the edges of the subgraph.Map<String,Attribute>getClusterAttributes()Get the cluster attributes in a preserved order.AsSubgraph<V,E>getSubgraph()Get the subgraph.Map<String,Attribute>getSubgraphAttributes()Get the subgraph attributes in a preserved order.booleanisExportEdges()Whether to export the subgraph edges in the DOT export.booleanisExportVertices()Whether to export the subgraph vertices in the DOT export.Set<V>vertexSet()Get the vertices of the subgraph.
-
-
-
Constructor Detail
-
DOTSubgraph
public DOTSubgraph(AsSubgraph<V,E> subgraph, Map<String,Attribute> subgraphAttributes, Map<String,Attribute> clusterAttributes, boolean exportVertices, boolean exportEdges)
Constructs a new DOTSubgraph with specified subgraph, attributes, and export options.- Parameters:
subgraph- the subgraph to be exportedsubgraphAttributes- attributes for the subgraphclusterAttributes- attributes for the clusterexportVertices- whether to export verticesexportEdges- whether to export edges
-
DOTSubgraph
public DOTSubgraph(AsSubgraph<V,E> subgraph, Map<String,Attribute> subgraphAttributes, Map<String,Attribute> clusterAttributes)
Constructs a new DOTSubgraph with specified subgraph, attributes.- Parameters:
subgraph- the subgraph to be exportedsubgraphAttributes- attributes for the subgraphclusterAttributes- attributes for the cluster
-
-
Method Detail
-
getSubgraph
public AsSubgraph<V,E> getSubgraph()
Get the subgraph.- Returns:
- the subgraph
-
getSubgraphAttributes
public Map<String,Attribute> getSubgraphAttributes()
Get the subgraph attributes in a preserved order.- Returns:
- the subgraph attributes.
-
getClusterAttributes
public Map<String,Attribute> getClusterAttributes()
Get the cluster attributes in a preserved order.- Returns:
- the cluster attributes.
-
vertexSet
public Set<V> vertexSet()
Get the vertices of the subgraph.- Returns:
- the vertices of the subgraph
-
isExportVertices
public boolean isExportVertices()
Whether to export the subgraph vertices in the DOT export.If
true, vertices will be included in the DOT export by writing their identifiers one by one on successive lines, with the same formalism as the main graph's vertices.For example, for a subgraph with DefaultEdges (1, 2) and (2, 3) between Integer vertices 1, 2, and 3, the DOT export of the vertices will be:
1; 2; 3;- Returns:
trueif vertices should be exported,falseotherwise.
-
isExportEdges
public boolean isExportEdges()
Whether to export the subgraph edges in the DOT export.If
true, edges will be included in the DOT export by writing the identifiers of their respective source and target vertices on successive lines, with the same formalism as the main graph's edges.For example, for a subgraph with DefaultEdges (1, 2) and (2, 3) between Integer vertices 1, 2, and 3, the DOT export of the edges will be:
1 -- 2; 2 -- 3;- Returns:
trueif edges should be exported,falseotherwise.
-
-