workaround for apparent graphviz bug
authorSvjatoslav Agejenko <svjatoslav@svjatoslav.eu>
Tue, 3 Mar 2015 14:01:27 +0000 (16:01 +0200)
committerSvjatoslav Agejenko <svjatoslav@svjatoslav.eu>
Tue, 3 Mar 2015 14:01:27 +0000 (16:01 +0200)
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=779596

src/main/java/eu/svjatoslav/inspector/java/structure/ClassDescriptor.java
src/test/java/eu/svjatoslav/inspector/java/structure/example/RenderDemoClasses.java
src/test/java/eu/svjatoslav/inspector/java/structure/example/structure/SampleClass2.java [new file with mode: 0644]

index bdece4b..5283007 100755 (executable)
@@ -153,9 +153,9 @@ public class ClassDescriptor implements GraphElement {
                                continue;
 
                        result.append("    " + interfaceDescriptor.getGraphId() + " -> "
-                                       + getGraphId() + "[style=\"dotted, tapered\", color=\""
+                                       + getGraphId() + "[style=\"dotted\", color=\""
                                        + interfaceDescriptor.getInterfaceColor()
-                                       + "\", penwidth=20, dir=\"forward\"];\n");
+                                       + "\", penwidth=10, dir=\"forward\"];\n");
                }
        }
 
@@ -196,8 +196,7 @@ public class ClassDescriptor implements GraphElement {
                                + "\n");
 
                result.append("    " + superClass.getGraphId() + " -> " + getGraphId()
-                               + "[style=\"tapered\", color=\""
-                               + superClass.getSuperClassColor()
+                               + "[ color=\"" + superClass.getSuperClassColor()
                                + "\", penwidth=10, dir=\"forward\"];\n");
        }
 
@@ -348,7 +347,7 @@ public class ClassDescriptor implements GraphElement {
 
        public String getInterfaceColor() {
                if (interfaceColor == null)
-                       interfaceColor = Utils.getNextLightColor();
+                       interfaceColor = Utils.getNextDarkColor();
 
                return interfaceColor;
        }
index 9c4815a..b5a24a8 100755 (executable)
@@ -1,7 +1,7 @@
 /*
  * JavaInspect - Utility to visualize java software
  * Copyright (C) 2013-2015, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
- * 
+ *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of version 3 of the GNU Lesser General Public License
  * or later as published by the Free Software Foundation.
@@ -11,6 +11,7 @@ package eu.svjatoslav.inspector.java.structure.example;
 
 import eu.svjatoslav.inspector.java.structure.ClassGraph;
 import eu.svjatoslav.inspector.java.structure.example.structure.SampleClass;
+import eu.svjatoslav.inspector.java.structure.example.structure.SampleClass2;
 
 public class RenderDemoClasses {
 
@@ -18,8 +19,9 @@ public class RenderDemoClasses {
                final ClassGraph graph = new ClassGraph();
 
                graph.addClass(SampleClass.class);
+               graph.addClass(SampleClass2.class);
 
-               graph.generateGraph("example");
+               graph.generateGraph("example", false);
        }
 
 }
diff --git a/src/test/java/eu/svjatoslav/inspector/java/structure/example/structure/SampleClass2.java b/src/test/java/eu/svjatoslav/inspector/java/structure/example/structure/SampleClass2.java
new file mode 100644 (file)
index 0000000..83b5205
--- /dev/null
@@ -0,0 +1,5 @@
+package eu.svjatoslav.inspector.java.structure.example.structure;
+
+public class SampleClass2 extends SampleSuperClass {
+
+}