From a65f21f0464caf3a2ea567ec959bc2be78d1864c Mon Sep 17 00:00:00 2001 From: Svjatoslav Agejenko Date: Tue, 3 Mar 2015 16:01:27 +0200 Subject: [PATCH] workaround for apparent graphviz bug https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=779596 --- .../inspector/java/structure/ClassDescriptor.java | 9 ++++----- .../java/structure/example/RenderDemoClasses.java | 6 ++++-- .../java/structure/example/structure/SampleClass2.java | 5 +++++ 3 files changed, 13 insertions(+), 7 deletions(-) create mode 100644 src/test/java/eu/svjatoslav/inspector/java/structure/example/structure/SampleClass2.java diff --git a/src/main/java/eu/svjatoslav/inspector/java/structure/ClassDescriptor.java b/src/main/java/eu/svjatoslav/inspector/java/structure/ClassDescriptor.java index bdece4b..5283007 100755 --- a/src/main/java/eu/svjatoslav/inspector/java/structure/ClassDescriptor.java +++ b/src/main/java/eu/svjatoslav/inspector/java/structure/ClassDescriptor.java @@ -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; } diff --git a/src/test/java/eu/svjatoslav/inspector/java/structure/example/RenderDemoClasses.java b/src/test/java/eu/svjatoslav/inspector/java/structure/example/RenderDemoClasses.java index 9c4815a..b5a24a8 100755 --- a/src/test/java/eu/svjatoslav/inspector/java/structure/example/RenderDemoClasses.java +++ b/src/test/java/eu/svjatoslav/inspector/java/structure/example/RenderDemoClasses.java @@ -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 index 0000000..83b5205 --- /dev/null +++ b/src/test/java/eu/svjatoslav/inspector/java/structure/example/structure/SampleClass2.java @@ -0,0 +1,5 @@ +package eu.svjatoslav.inspector.java.structure.example.structure; + +public class SampleClass2 extends SampleSuperClass { + +} -- 2.20.1