Commit 96cdbae9 authored by Carlos Galindo's avatar Carlos Galindo
Browse files

Better printing of graphs.

parent 8bad6135
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -40,10 +40,14 @@ public class SlicedSDGLog extends SDGLog {
        Map<String, Attribute> map = new HashMap<>();
        if (slice.contains(node) && node.equals(sc))
            map.put("style", DefaultAttribute.createAttribute("filled,bold"));
        else if (slice.contains(node) && node.isImplicitInstruction())
            map.put("style", DefaultAttribute.createAttribute("filled,dashed"));
        else if (slice.contains(node))
            map.put("style", DefaultAttribute.createAttribute("filled"));
        else if (node.equals(sc))
            map.put("style", DefaultAttribute.createAttribute("bold"));
        else if (node.isImplicitInstruction())
            map.put("style", DefaultAttribute.createAttribute("dashed"));
        map.put("label", DefaultAttribute.createAttribute(node.getLongLabel()));
        return map;
    }
+2 −2
Original line number Diff line number Diff line
@@ -89,9 +89,9 @@ public class GraphNode<N extends Node> implements Comparable<GraphNode<?>> {

    /** The node's long-form label, including its id and information on variables. */
    public String getLongLabel() {
        String label = getId() + ": " + getLabel();
        String label = getId() + ": " + getLabel().replace("\\", "\\\\");
        if (!getVariableActions().isEmpty())
            label += "\n" + getVariableActions().stream().map(Object::toString).reduce((a, b) -> a + "," + b).orElse("--");
            label += "\\n" + getVariableActions().stream().map(Object::toString).reduce((a, b) -> a + "," + b).orElse("--");
        return label;
    }