T
- Type of the nodes' data objects@ALDAOperator(genericExecutionMode=NONE,
level=STANDARD)
public class GraphvizWriter<T extends Comparable<?> & Comparator<?>>
extends de.unihalle.informatik.Alida.operator.ALDOperator
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.Modifier and Type | Field and Description |
---|---|
protected AdjacencyMatrix<T> |
adjmatrix |
private boolean |
directed |
protected String[] |
dotGlobalAttributes |
protected String |
filename |
protected MTBGraph |
graph |
protected double |
maxWeight |
private HashMap<T,String> |
nodeNames |
private boolean |
paintZeroWeightEdges |
private HashMap<T,TreeSet<T>> |
subgraphEdges |
protected Vector<MTBGraph> |
subgraphs |
protected Vector<AdjacencyMatrix<T>> |
subgraphs_adj |
protected Vector<Color> |
subgraphs_adj_color |
protected Vector<Color> |
subgraphs_color |
protected boolean |
weightAsEdgeThickness |
Constructor and Description |
---|
GraphvizWriter()
Empty constructor
|
GraphvizWriter(AdjacencyMatrix<T> adjmatrix,
String filename)
Constructor for specifying the graph by an adjacency matrix
|
GraphvizWriter(MTBGraph graph,
String filename)
Constructor for specifying the graph by
MTBGraph |
Modifier and Type | Method and Description |
---|---|
void |
addSubgraph(MTBGraph subgraph,
Color c)
Specify a subgraph that is to be painted in the given color.
|
void |
addSubgraphAdjaceny(AdjacencyMatrix<T> subgraph_adj,
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(String[] dotGlobalAttributes)
Set global attributes of the graph e.g. the style of the nodes etc.
|
void |
setFilename(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(BufferedWriter w) |
private void |
writeGraph(BufferedWriter w) |
private void |
writeNodeLabels(BufferedWriter w) |
private void |
writePartitions(BufferedWriter w) |
private void |
writeSubgraphs(BufferedWriter w) |
addOperatorExecutionProgressEventListener, addParameter, addParameter, addParameterUnconditioned, fieldContained, fireOperatorExecutionProgressEvent, getALDPortHashAccessKey, getConstructionMode, getDocumentation, getHidingMode, getInactiveParameterNames, getInInoutNames, getInInoutNames, getInNames, getInOutNames, getMissingRequiredInputs, getName, getNumParameters, getOutInoutNames, getOutNames, getParameter, getParameterDescriptor, getParameterDescriptorUnconditioned, getParameterNames, getParameterUnconditioned, getSupplementalNames, getVerbose, getVersion, handleOperatorExecutionProgressEvent, hasInOutParameters, hasParameter, isAnnotatedParameter, isConfigured, print, print, print, printInterface, printInterface, readHistory, readResolve, reinitializeParameterDescriptors, removeOperatorExecutionProgressEventListener, removeParameter, runOp, runOp, runOp, setConstructionMode, setConstructionMode, setConstructionMode, setHidingMode, setName, setParameter, setParameterUnconditioned, setVerbose, toStringVerbose, unconfiguredItems, validate, validateGeneric, writeHistory, writeHistory, writeHistory
@Parameter(label="adjmatrix", direction=IN, required=false, description="Adjacency matrix of the input graph") protected AdjacencyMatrix<T extends Comparable<?> & Comparator<?>> adjmatrix
@Parameter(label="graph", direction=IN, required=false, description="Input graph") protected MTBGraph graph
@Parameter(label="filename", direction=IN, required=true, description="Output file name") protected String filename
@Parameter(label="weightAsEdgeThickness", direction=IN, required=true, description="Visualize weights by edge thickness") protected boolean weightAsEdgeThickness
@Parameter(label="dotGlobalAttributes", direction=IN, required=false, description="Global attributes for graph drawing (dot commands), e.g. node/edge style, color etc.") protected String[] dotGlobalAttributes
@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
protected Vector<AdjacencyMatrix<T extends Comparable<?> & Comparator<?>>> subgraphs_adj
private boolean paintZeroWeightEdges
private HashMap<T extends Comparable<?> & Comparator<?>,String> nodeNames
private HashMap<T extends Comparable<?> & Comparator<?>,TreeSet<T extends Comparable<?> & Comparator<?>>> subgraphEdges
private boolean directed
public GraphvizWriter() throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException
de.unihalle.informatik.Alida.exceptions.ALDOperatorException
public GraphvizWriter(AdjacencyMatrix<T> adjmatrix, String filename) throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException
de.unihalle.informatik.Alida.exceptions.ALDOperatorException
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
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 setGraph(MTBGraph graph)
MTBGraph
public void setFilename(String filename)
public void setWeightAsEdgeThickness(boolean weightAsEdgeThickness)
public void setDotGlobalAttributes(String[] dotGlobalAttributes)
public void setMaxWeight(double maxWeight)
public void addSubgraph(MTBGraph subgraph, Color c)
public void addSubgraphAdjaceny(AdjacencyMatrix<T> subgraph_adj, Color c)
private void initNodeNames()
private void writeGlobalAttributes(BufferedWriter w) throws IOException
IOException
private void writeNodeLabels(BufferedWriter w) throws IOException
IOException
private void writeSubgraphs(BufferedWriter w) throws IOException
IOException
private void writePartitions(BufferedWriter w) throws IOException
IOException
private void writeGraph(BufferedWriter w) throws IOException
IOException
Copyright © 2010–2020 Martin Luther University Halle-Wittenberg, Institute of Computer Science, Pattern Recognition and Bioinformatics. All rights reserved.