Verified Commit 99ce92ca authored by Carlos Galindo's avatar Carlos Galindo
Browse files

dependencies: update jgrapht to 1.5.0

parent 682af0ad
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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.*;
+9 −14
Original line number Diff line number Diff line
@@ -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;
@@ -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) {
@@ -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;
    }
}
+2 −2
Original line number Diff line number Diff line
@@ -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>
+3 −3
Original line number Diff line number Diff line
@@ -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;

@@ -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
+2 −2
Original line number Diff line number Diff line
@@ -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