Loading sdg-cli/src/main/java/es/upv/mist/slicing/cli/ClassGraphLog.java 0 → 100644 +27 −0 Original line number Diff line number Diff line package es.upv.mist.slicing.cli; import es.upv.mist.slicing.graphs.ClassGraph; import org.jgrapht.nio.Attribute; import org.jgrapht.nio.dot.DOTExporter; import java.util.Map; public class ClassGraphLog { protected DOTExporter<ClassGraph.Vertex<?>, ClassGraph.ClassArc> getDOTExporter() { DOTExporter<ClassGraph.Vertex<?>, ClassGraph.ClassArc> dot = new DOTExporter<>(); dot.setVertexAttributeProvider(this::attributes); dot.setEdgeAttributeProvider(this::attributes); return dot; } protected Map<String, Attribute> attributes(ClassGraph.Vertex<?> vertex) { DOTAttributes res = new DOTAttributes(); res.set("label", vertex.toString()); return res.build(); } protected Map<String, Attribute> attributes(ClassGraph.ClassArc arc) { DOTAttributes res = new DOTAttributes(); return res.build(); } } sdg-core/src/main/java/es/upv/mist/slicing/graphs/ClassGraph.java +2 −2 Original line number Diff line number Diff line Loading @@ -393,7 +393,7 @@ public class ClassGraph extends DirectedPseudograph<ClassGraph.Vertex<?>, ClassG /** A vertex containing the declaration it represents. It only exists because * JGraphT relies heavily on equals comparison, which may not be correct in declarations. */ protected static class Vertex<T extends BodyDeclaration<?>> { public static class Vertex<T extends BodyDeclaration<?>> { // First ancestor common class in the JavaParser hierarchy for // ClassOrInterfaceDeclaration, FieldDeclaration and CallableDeclaration protected final T declaration; Loading Loading @@ -423,7 +423,7 @@ public class ClassGraph extends DirectedPseudograph<ClassGraph.Vertex<?>, ClassG } } protected static class ClassArc extends Arc { public static class ClassArc extends Arc { /** An arc that connects a class with another one that inherits from it. */ protected static class Extends extends ClassArc {} /** An arc that connects an interface to a class that implements it. */ Loading Loading
sdg-cli/src/main/java/es/upv/mist/slicing/cli/ClassGraphLog.java 0 → 100644 +27 −0 Original line number Diff line number Diff line package es.upv.mist.slicing.cli; import es.upv.mist.slicing.graphs.ClassGraph; import org.jgrapht.nio.Attribute; import org.jgrapht.nio.dot.DOTExporter; import java.util.Map; public class ClassGraphLog { protected DOTExporter<ClassGraph.Vertex<?>, ClassGraph.ClassArc> getDOTExporter() { DOTExporter<ClassGraph.Vertex<?>, ClassGraph.ClassArc> dot = new DOTExporter<>(); dot.setVertexAttributeProvider(this::attributes); dot.setEdgeAttributeProvider(this::attributes); return dot; } protected Map<String, Attribute> attributes(ClassGraph.Vertex<?> vertex) { DOTAttributes res = new DOTAttributes(); res.set("label", vertex.toString()); return res.build(); } protected Map<String, Attribute> attributes(ClassGraph.ClassArc arc) { DOTAttributes res = new DOTAttributes(); return res.build(); } }
sdg-core/src/main/java/es/upv/mist/slicing/graphs/ClassGraph.java +2 −2 Original line number Diff line number Diff line Loading @@ -393,7 +393,7 @@ public class ClassGraph extends DirectedPseudograph<ClassGraph.Vertex<?>, ClassG /** A vertex containing the declaration it represents. It only exists because * JGraphT relies heavily on equals comparison, which may not be correct in declarations. */ protected static class Vertex<T extends BodyDeclaration<?>> { public static class Vertex<T extends BodyDeclaration<?>> { // First ancestor common class in the JavaParser hierarchy for // ClassOrInterfaceDeclaration, FieldDeclaration and CallableDeclaration protected final T declaration; Loading Loading @@ -423,7 +423,7 @@ public class ClassGraph extends DirectedPseudograph<ClassGraph.Vertex<?>, ClassG } } protected static class ClassArc extends Arc { public static class ClassArc extends Arc { /** An arc that connects a class with another one that inherits from it. */ protected static class Extends extends ClassArc {} /** An arc that connects an interface to a class that implements it. */ Loading