File tree Expand file tree Collapse file tree 2 files changed +29
-2
lines changed
sdg-cli/src/main/java/es/upv/mist/slicing/cli
sdg-core/src/main/java/es/upv/mist/slicing/graphs Expand file tree Collapse file tree 2 files changed +29
-2
lines changed Original file line number Diff line number Diff line change 1+ package es .upv .mist .slicing .cli ;
2+
3+ import es .upv .mist .slicing .graphs .ClassGraph ;
4+ import org .jgrapht .nio .Attribute ;
5+ import org .jgrapht .nio .dot .DOTExporter ;
6+
7+ import java .util .Map ;
8+
9+ public class ClassGraphLog {
10+ protected DOTExporter <ClassGraph .Vertex <?>, ClassGraph .ClassArc > getDOTExporter () {
11+ DOTExporter <ClassGraph .Vertex <?>, ClassGraph .ClassArc > dot = new DOTExporter <>();
12+ dot .setVertexAttributeProvider (this ::attributes );
13+ dot .setEdgeAttributeProvider (this ::attributes );
14+ return dot ;
15+ }
16+
17+ protected Map <String , Attribute > attributes (ClassGraph .Vertex <?> vertex ) {
18+ DOTAttributes res = new DOTAttributes ();
19+ res .set ("label" , vertex .toString ());
20+ return res .build ();
21+ }
22+
23+ protected Map <String , Attribute > attributes (ClassGraph .ClassArc arc ) {
24+ DOTAttributes res = new DOTAttributes ();
25+ return res .build ();
26+ }
27+ }
Original file line number Diff line number Diff line change @@ -393,7 +393,7 @@ protected void addClassEdges(Vertex<ClassOrInterfaceDeclaration> v) {
393393
394394 /** A vertex containing the declaration it represents. It only exists because
395395 * JGraphT relies heavily on equals comparison, which may not be correct in declarations. */
396- protected static class Vertex <T extends BodyDeclaration <?>> {
396+ public static class Vertex <T extends BodyDeclaration <?>> {
397397 // First ancestor common class in the JavaParser hierarchy for
398398 // ClassOrInterfaceDeclaration, FieldDeclaration and CallableDeclaration
399399 protected final T declaration ;
@@ -423,7 +423,7 @@ public String toString() {
423423 }
424424 }
425425
426- protected static class ClassArc extends Arc {
426+ public static class ClassArc extends Arc {
427427 /** An arc that connects a class with another one that inherits from it. */
428428 protected static class Extends extends ClassArc {}
429429 /** An arc that connects an interface to a class that implements it. */
You can’t perform that action at this time.
0 commit comments