sb.append(getNodeLabel(node));
int inputsNo = node.getInputPorts().size();
sb.append("\t[label=\"{{");
for (int i = 0; i < inputsNo; i++)
{
Port p = node.getInputPorts().get(i);
sb.append("<" + getPortLabel(p) + ">");
sb.append(p.getName());
if (i < inputsNo - 1)
{
sb.append('|');
}
else
{
sb.append("}|{");
}
}
sb.append(node.getName());
if (node.getResource() != null)
{
sb.append("\\n" + node.getResource());
}
sb.append("}");
int outputsNo = node.getOutputPorts().size();
if (outputsNo > 0)
{
sb.append("|{");
}
for (int i = 0; i < outputsNo; i++)
{
Port p = node.getOutputPorts().get(i);
sb.append("<" + getPortLabel(p) + ">");
sb.append(p.getName());
if (i < outputsNo - 1)
{
sb.append('|');
}
else
{
sb.append('}');
}
}
sb.append("}\", tooltip=\"" + node.getInstanceName() + "\"];\n");
for (Port p : node.getOutputPorts())
{
for (Port connPort : p.getConnected())
{
sb.append(getNodeLabel(p.getParentNode()) + ":"
+ getPortLabel(p));
sb.append(" -> ");
sb.append(getNodeLabel(connPort.getParentNode()) + ":"
+ getPortLabel(connPort));
boolean renderBlockStatistics =
p.getBlocksRead() != -1 && p.getBlocksWritten() != -1;
boolean renderLink = p.getUrl() != null;
if (renderBlockStatistics || renderLink)
{
sb.append(" [");
if (renderBlockStatistics)
{
sb.append("label = \"").append(p.getBlocksRead());
sb.append("/").append(p.getBlocksWritten());
sb.append("\" ");
}
if (renderLink)
{
sb.append("href=\"").append(p.getUrl()).append("\"");
}
sb.append("]");
}
if (p instanceof AnnotatedPort) {
AnnotatedPort ap = (AnnotatedPort) p;
sb.append(" [");
sb.append("id = \"" + ap.getPipeName(connPort) +"\"");
sb.append("]");
}
sb.append(";\n");
}
}
for (Port p : node.getInputPorts())
{
if (p.getConnected().size() == 0)
{
sb.append(getPortLabel(p));
sb.append(" [fillcolor=bisque, style=\"filled\", shape=box, label=\""
+ formatLiteral(p.getLiteralValue()) + "\"];\n");
sb.append(getPortLabel(p) + " -> "
+ getNodeLabel(p.getParentNode()) + ":"
+ getPortLabel(p) + ";\n");
}
}
}
sb.append('}');