Loading sdg-cli/src/main/java/es/upv/mist/slicing/cli/GraphLog.java +1 −1 Original line number Diff line number Diff line Loading @@ -4,7 +4,7 @@ import es.upv.mist.slicing.arcs.Arc; import es.upv.mist.slicing.graphs.Graph; import es.upv.mist.slicing.nodes.GraphNode; import es.upv.mist.slicing.utils.Logger; import org.jgrapht.io.DOTExporter; import org.jgrapht.nio.dot.DOTExporter; import java.awt.*; import java.io.*; Loading sdg-cli/src/main/java/es/upv/mist/slicing/cli/SlicedSDGLog.java +9 −14 Original line number Diff line number Diff line Loading @@ -5,9 +5,9 @@ import es.upv.mist.slicing.graphs.sdg.SDG; import es.upv.mist.slicing.nodes.GraphNode; import es.upv.mist.slicing.slicing.Slice; import es.upv.mist.slicing.slicing.SlicingCriterion; import org.jgrapht.io.Attribute; import org.jgrapht.io.DOTExporter; import org.jgrapht.io.DefaultAttribute; import org.jgrapht.nio.Attribute; import org.jgrapht.nio.DefaultAttribute; import org.jgrapht.nio.dot.DOTExporter; import java.util.HashMap; import java.util.Map; Loading @@ -29,17 +29,11 @@ public class SlicedSDGLog extends SDGLog { @Override protected DOTExporter<GraphNode<?>, Arc> getDOTExporter(SDG graph) { return new DOTExporter<>( n -> String.valueOf(n.getId()), n -> { String s = n.getId() + ": " + n.getLabel(); if (!n.getVariableActions().isEmpty()) s += "\n" + n.getVariableActions().stream().map(Object::toString).reduce((a, b) -> a + "," + b).orElse("--"); return s; }, Arc::getLabel, this::vertexAttributes, Arc::getDotAttributes); DOTExporter<GraphNode<?>, Arc> dot = new DOTExporter<>(); dot.setVertexIdProvider(n -> String.valueOf(n.getId())); dot.setVertexAttributeProvider(this::vertexAttributes); dot.setEdgeAttributeProvider(Arc::getDotAttributes); return dot; } protected Map<String, Attribute> vertexAttributes(GraphNode<?> node) { Loading @@ -50,6 +44,7 @@ public class SlicedSDGLog extends SDGLog { map.put("style", DefaultAttribute.createAttribute("filled")); else if (node.equals(sc)) map.put("style", DefaultAttribute.createAttribute("bold")); map.put("label", DefaultAttribute.createAttribute(node.getLongLabel())); return map; } } sdg-core/pom.xml +2 −2 Original line number Diff line number Diff line Loading @@ -31,12 +31,12 @@ <dependency> <groupId>org.jgrapht</groupId> <artifactId>jgrapht-core</artifactId> <version>1.3.0</version> <version>1.5.0</version> </dependency> <dependency> <groupId>org.jgrapht</groupId> <artifactId>jgrapht-io</artifactId> <version>1.3.0</version> <version>1.5.0</version> </dependency> <dependency> <groupId>org.junit.jupiter</groupId> Loading sdg-core/src/main/java/es/upv/mist/slicing/arcs/Arc.java +3 −3 Original line number Diff line number Diff line Loading @@ -11,10 +11,10 @@ import es.upv.mist.slicing.graphs.cfg.CFG; import es.upv.mist.slicing.graphs.pdg.PDG; import es.upv.mist.slicing.graphs.sdg.SDG; import es.upv.mist.slicing.nodes.GraphNode; import es.upv.mist.slicing.utils.Utils; import org.jgrapht.graph.DefaultEdge; import org.jgrapht.io.Attribute; import org.jgrapht.nio.Attribute; import java.util.HashMap; import java.util.Map; import java.util.Objects; Loading Loading @@ -139,7 +139,7 @@ public abstract class Arc extends DefaultEdge { /** A map of DOT attributes that define the style of this arc. */ public Map<String, Attribute> getDotAttributes() { return new HashMap<>(); return Utils.dotLabel(getLabel()); } @Override Loading sdg-core/src/main/java/es/upv/mist/slicing/arcs/cfg/ControlFlowArc.java +2 −2 Original line number Diff line number Diff line Loading @@ -3,8 +3,8 @@ package es.upv.mist.slicing.arcs.cfg; import es.upv.mist.slicing.arcs.Arc; import es.upv.mist.slicing.graphs.augmented.ACFG; import es.upv.mist.slicing.graphs.cfg.CFG; import org.jgrapht.io.Attribute; import org.jgrapht.io.DefaultAttribute; import org.jgrapht.nio.Attribute; import org.jgrapht.nio.DefaultAttribute; import java.util.Map; Loading Loading
sdg-cli/src/main/java/es/upv/mist/slicing/cli/GraphLog.java +1 −1 Original line number Diff line number Diff line Loading @@ -4,7 +4,7 @@ import es.upv.mist.slicing.arcs.Arc; import es.upv.mist.slicing.graphs.Graph; import es.upv.mist.slicing.nodes.GraphNode; import es.upv.mist.slicing.utils.Logger; import org.jgrapht.io.DOTExporter; import org.jgrapht.nio.dot.DOTExporter; import java.awt.*; import java.io.*; Loading
sdg-cli/src/main/java/es/upv/mist/slicing/cli/SlicedSDGLog.java +9 −14 Original line number Diff line number Diff line Loading @@ -5,9 +5,9 @@ import es.upv.mist.slicing.graphs.sdg.SDG; import es.upv.mist.slicing.nodes.GraphNode; import es.upv.mist.slicing.slicing.Slice; import es.upv.mist.slicing.slicing.SlicingCriterion; import org.jgrapht.io.Attribute; import org.jgrapht.io.DOTExporter; import org.jgrapht.io.DefaultAttribute; import org.jgrapht.nio.Attribute; import org.jgrapht.nio.DefaultAttribute; import org.jgrapht.nio.dot.DOTExporter; import java.util.HashMap; import java.util.Map; Loading @@ -29,17 +29,11 @@ public class SlicedSDGLog extends SDGLog { @Override protected DOTExporter<GraphNode<?>, Arc> getDOTExporter(SDG graph) { return new DOTExporter<>( n -> String.valueOf(n.getId()), n -> { String s = n.getId() + ": " + n.getLabel(); if (!n.getVariableActions().isEmpty()) s += "\n" + n.getVariableActions().stream().map(Object::toString).reduce((a, b) -> a + "," + b).orElse("--"); return s; }, Arc::getLabel, this::vertexAttributes, Arc::getDotAttributes); DOTExporter<GraphNode<?>, Arc> dot = new DOTExporter<>(); dot.setVertexIdProvider(n -> String.valueOf(n.getId())); dot.setVertexAttributeProvider(this::vertexAttributes); dot.setEdgeAttributeProvider(Arc::getDotAttributes); return dot; } protected Map<String, Attribute> vertexAttributes(GraphNode<?> node) { Loading @@ -50,6 +44,7 @@ public class SlicedSDGLog extends SDGLog { map.put("style", DefaultAttribute.createAttribute("filled")); else if (node.equals(sc)) map.put("style", DefaultAttribute.createAttribute("bold")); map.put("label", DefaultAttribute.createAttribute(node.getLongLabel())); return map; } }
sdg-core/pom.xml +2 −2 Original line number Diff line number Diff line Loading @@ -31,12 +31,12 @@ <dependency> <groupId>org.jgrapht</groupId> <artifactId>jgrapht-core</artifactId> <version>1.3.0</version> <version>1.5.0</version> </dependency> <dependency> <groupId>org.jgrapht</groupId> <artifactId>jgrapht-io</artifactId> <version>1.3.0</version> <version>1.5.0</version> </dependency> <dependency> <groupId>org.junit.jupiter</groupId> Loading
sdg-core/src/main/java/es/upv/mist/slicing/arcs/Arc.java +3 −3 Original line number Diff line number Diff line Loading @@ -11,10 +11,10 @@ import es.upv.mist.slicing.graphs.cfg.CFG; import es.upv.mist.slicing.graphs.pdg.PDG; import es.upv.mist.slicing.graphs.sdg.SDG; import es.upv.mist.slicing.nodes.GraphNode; import es.upv.mist.slicing.utils.Utils; import org.jgrapht.graph.DefaultEdge; import org.jgrapht.io.Attribute; import org.jgrapht.nio.Attribute; import java.util.HashMap; import java.util.Map; import java.util.Objects; Loading Loading @@ -139,7 +139,7 @@ public abstract class Arc extends DefaultEdge { /** A map of DOT attributes that define the style of this arc. */ public Map<String, Attribute> getDotAttributes() { return new HashMap<>(); return Utils.dotLabel(getLabel()); } @Override Loading
sdg-core/src/main/java/es/upv/mist/slicing/arcs/cfg/ControlFlowArc.java +2 −2 Original line number Diff line number Diff line Loading @@ -3,8 +3,8 @@ package es.upv.mist.slicing.arcs.cfg; import es.upv.mist.slicing.arcs.Arc; import es.upv.mist.slicing.graphs.augmented.ACFG; import es.upv.mist.slicing.graphs.cfg.CFG; import org.jgrapht.io.Attribute; import org.jgrapht.io.DefaultAttribute; import org.jgrapht.nio.Attribute; import org.jgrapht.nio.DefaultAttribute; import java.util.Map; Loading