|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.unihalle.informatik.Alida.operator.ALDOperator
de.unihalle.informatik.MiToBo.io.files.GraphvizWriter<T>
T
- Type of the nodes' data objects@ALDAOperator(genericExecutionMode=NONE, level=STANDARD) public class GraphvizWriter<T extends java.lang.Comparable<?> & java.util.Comparator<?>>
Write graph to file using the DOT-language for visualization using graphviz tools.
A main graph has to be specified whether as MTBGraph
or AdjacencyMatrix
.
Further, subgraphs can be specified which then are painted in the specified color.
If T is of type MatchingAdjacencyMatrix.NodeID
, the nodes of each partition are
drawn with same rank, i.e. they are lined up horizontally.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class de.unihalle.informatik.Alida.operator.ALDOperator |
---|
de.unihalle.informatik.Alida.operator.ALDOperator.HidingMode |
Field Summary | |
---|---|
protected AdjacencyMatrix<T> |
adjmatrix
|
private boolean |
directed
|
protected java.lang.String[] |
dotGlobalAttributes
|
protected java.lang.String |
filename
|
protected MTBGraph |
graph
|
protected double |
maxWeight
|
private java.util.HashMap<T,java.lang.String> |
nodeNames
|
private boolean |
paintZeroWeightEdges
|
private java.util.HashMap<T,java.util.TreeSet<T>> |
subgraphEdges
|
protected java.util.Vector<MTBGraph> |
subgraphs
|
protected java.util.Vector<AdjacencyMatrix<T>> |
subgraphs_adj
|
protected java.util.Vector<java.awt.Color> |
subgraphs_adj_color
|
protected java.util.Vector<java.awt.Color> |
subgraphs_color
|
protected boolean |
weightAsEdgeThickness
|
Fields inherited from class de.unihalle.informatik.Alida.operator.ALDOperator |
---|
completeDAG, name, portHashAccess, verbose, versionProvider |
Constructor Summary | |
---|---|
GraphvizWriter()
Empty constructor |
|
GraphvizWriter(AdjacencyMatrix<T> adjmatrix,
java.lang.String filename)
Constructor for specifying the graph by an adjacency matrix |
|
GraphvizWriter(MTBGraph graph,
java.lang.String filename)
Constructor for specifying the graph by MTBGraph |
Method Summary | |
---|---|
void |
addSubgraph(MTBGraph subgraph,
java.awt.Color c)
Specify a subgraph that is to be painted in the given color. |
void |
addSubgraphAdjaceny(AdjacencyMatrix<T> subgraph_adj,
java.awt.Color c)
Specify a subgraph that is to be painted in the given color. |
private void |
initNodeNames()
|
protected void |
operate()
|
void |
setAdjacencyMatrix(AdjacencyMatrix<T> adjmatrix)
Set the main graph's adjacency matrix |
void |
setDotGlobalAttributes(java.lang.String[] dotGlobalAttributes)
Set global attributes of the graph e.g. the style of the nodes etc. |
void |
setFilename(java.lang.String filename)
Set the filename for output |
void |
setGraph(MTBGraph graph)
Set the main graph using MTBGraph |
void |
setMaxWeight(double maxWeight)
Specify the maximum weight in the graph. |
void |
setWeightAsEdgeThickness(boolean weightAsEdgeThickness)
Set flag how edge weights are visualized. |
void |
validateCustom()
|
private void |
writeGlobalAttributes(java.io.BufferedWriter w)
|
private void |
writeGraph(java.io.BufferedWriter w)
|
private void |
writeNodeLabels(java.io.BufferedWriter w)
|
private void |
writePartitions(java.io.BufferedWriter w)
|
private void |
writeSubgraphs(java.io.BufferedWriter w)
|
Methods inherited from class de.unihalle.informatik.Alida.operator.ALDOperator |
---|
deserializeFromXmlFile, fieldContained, getALDPortHashAccessKey, getConstructionMode, getInInoutNames, getInInoutNames, getInNames, getInOutNames, getMissingRequiredInputs, getName, getNumParameters, getOutInoutNames, getOutNames, getParameter, getParameterDescriptor, getParameterNames, getSupplementalNames, getVerbose, getVersion, isConfigured, parametersToXmlObject, print, print, print, printInterface, printInterface, readHistory, readResolve, reinitializeParameterDescriptors, runOp, runOp, runOp, serializeToXmlFile, setConstructionMode, setName, setParameter, setParametersFromXml, setParametersFromXml, setVerbose, toStringVerbose, unconfiguredItems, validate, validateGeneric, writeHistory, writeHistory, writeHistory, writeParametersToXml |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
@Parameter(label="adjmatrix", direction=IN, required=false, description="Adjacency matrix of the input graph") protected AdjacencyMatrix<T extends java.lang.Comparable<?> & java.util.Comparator<?>> adjmatrix
private boolean directed
@Parameter(label="dotGlobalAttributes", direction=IN, required=false, description="Global attributes for graph drawing (dot commands), e.g. node/edge style, color etc.") protected java.lang.String[] dotGlobalAttributes
@Parameter(label="filename", direction=IN, required=true, description="Output file name") protected java.lang.String filename
@Parameter(label="graph", direction=IN, required=false, description="Input graph") protected MTBGraph graph
@Parameter(label="maxWeight", direction=IN, required=false, description="Maximum weight/cost in the graph, needed to limit edge thickness to 10pts if weights are visualized by edge thickness.") protected double maxWeight
private java.util.HashMap<T extends java.lang.Comparable<?> & java.util.Comparator<?>,java.lang.String> nodeNames
private boolean paintZeroWeightEdges
private java.util.HashMap<T extends java.lang.Comparable<?> & java.util.Comparator<?>,java.util.TreeSet<T extends java.lang.Comparable<?> & java.util.Comparator<?>>> subgraphEdges
protected java.util.Vector<MTBGraph> subgraphs
protected java.util.Vector<AdjacencyMatrix<T extends java.lang.Comparable<?> & java.util.Comparator<?>>> subgraphs_adj
protected java.util.Vector<java.awt.Color> subgraphs_adj_color
protected java.util.Vector<java.awt.Color> subgraphs_color
@Parameter(label="weightAsEdgeThickness", direction=IN, required=true, description="Visualize weights by edge thickness") protected boolean weightAsEdgeThickness
Constructor Detail |
---|
public GraphvizWriter() throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException
de.unihalle.informatik.Alida.exceptions.ALDOperatorException
public GraphvizWriter(AdjacencyMatrix<T> adjmatrix, java.lang.String filename) throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException
de.unihalle.informatik.Alida.exceptions.ALDOperatorException
public GraphvizWriter(MTBGraph graph, java.lang.String filename) throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException
MTBGraph
de.unihalle.informatik.Alida.exceptions.ALDOperatorException
Method Detail |
---|
public void addSubgraph(MTBGraph subgraph, java.awt.Color c)
public void addSubgraphAdjaceny(AdjacencyMatrix<T> subgraph_adj, java.awt.Color c)
private void initNodeNames()
protected void operate() throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException, de.unihalle.informatik.Alida.exceptions.ALDProcessingDAGException
operate
in class de.unihalle.informatik.Alida.operator.ALDOperator
de.unihalle.informatik.Alida.exceptions.ALDOperatorException
de.unihalle.informatik.Alida.exceptions.ALDProcessingDAGException
public void setAdjacencyMatrix(AdjacencyMatrix<T> adjmatrix)
public void setDotGlobalAttributes(java.lang.String[] dotGlobalAttributes)
public void setFilename(java.lang.String filename)
public void setGraph(MTBGraph graph)
MTBGraph
public void setMaxWeight(double maxWeight)
public void setWeightAsEdgeThickness(boolean weightAsEdgeThickness)
public void validateCustom() throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException
validateCustom
in class de.unihalle.informatik.Alida.operator.ALDOperator
de.unihalle.informatik.Alida.exceptions.ALDOperatorException
private void writeGlobalAttributes(java.io.BufferedWriter w) throws java.io.IOException
java.io.IOException
private void writeGraph(java.io.BufferedWriter w) throws java.io.IOException
java.io.IOException
private void writeNodeLabels(java.io.BufferedWriter w) throws java.io.IOException
java.io.IOException
private void writePartitions(java.io.BufferedWriter w) throws java.io.IOException
java.io.IOException
private void writeSubgraphs(java.io.BufferedWriter w) throws java.io.IOException
java.io.IOException
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |