Commit 499da150 authored by Carlos Galindo's avatar Carlos Galindo
Browse files

reorganized arc colors, added TotalDefinitionDep.Arc

parent e7d95501
Loading
Loading
Loading
Loading
+16 −0
Original line number Diff line number Diff line
package es.upv.mist.slicing.arcs.pdg;

import es.upv.mist.slicing.arcs.Arc;
import org.jgrapht.nio.Attribute;
import org.jgrapht.nio.DefaultAttribute;

import java.util.Map;

public class TotalDefinitionDependenceArc extends Arc {
    @Override
    public Map<String, Attribute> getDotAttributes() {
        Map<String, Attribute> map = super.getDotAttributes();
        map.put("color", DefaultAttribute.createAttribute("pink"));
        return map;
    }
}
+0 −12
Original line number Diff line number Diff line
package es.upv.mist.slicing.arcs.sdg;

import org.jgrapht.nio.Attribute;
import org.jgrapht.nio.DefaultAttribute;

import java.util.Map;

/**
 * An interprocedural arc that connects a call site with its
 * corresponding declaration. It is considered an interprocedural input.
 */
public class CallArc extends InterproceduralArc {
    @Override
    public Map<String, Attribute> getDotAttributes() {
        Map<String, Attribute> map = super.getDotAttributes();
        map.put("style", DefaultAttribute.createAttribute("dashed"));
        return map;
    }

    @Override
    public boolean isInterproceduralInputArc() {
        return true;
+2 −3
Original line number Diff line number Diff line
@@ -17,12 +17,11 @@ public abstract class InterproceduralArc extends Arc {
    public Map<String, Attribute> getDotAttributes() {
        var map = super.getDotAttributes();
        map.put("penwidth", DefaultAttribute.createAttribute("3"));
        map.put("style", DefaultAttribute.createAttribute("dashed"));
        if (isInterproceduralInputArc())
            map.put("color", DefaultAttribute.createAttribute("orange"));
            map.put("color", DefaultAttribute.createAttribute("darkgreen"));
        else if (isInterproceduralOutputArc())
            map.put("color", DefaultAttribute.createAttribute("blue"));
        else
            map.put("color", DefaultAttribute.createAttribute("green"));
        return map;
    }

+0 −7
Original line number Diff line number Diff line
@@ -14,13 +14,6 @@ import java.util.Map;
/** An interprocedural arc connecting {@link ActualIONode actual} and {@link FormalIONode formal}
 * nodes. The source and target must match: both must either be inputs or outputs. This arc may be an input or output. */
public class ParameterInOutArc extends InterproceduralArc {
    @Override
    public Map<String, Attribute> getDotAttributes() {
        Map<String, Attribute> map = super.getDotAttributes();
        map.put("style", DefaultAttribute.createAttribute("dashed"));
        return map;
    }

    @Override
    public boolean isInterproceduralInputArc() {
        GraphNode<?> source = getNodeCommon(getSource());
+1 −0
Original line number Diff line number Diff line
@@ -14,6 +14,7 @@ public class SummaryArc extends Arc {
    public Map<String, Attribute> getDotAttributes() {
        Map<String, Attribute> map = super.getDotAttributes();
        map.put("style", DefaultAttribute.createAttribute("bold"));
        map.put("color", DefaultAttribute.createAttribute("#a01210")); // rojo oscuro
        return map;
    }
}