X-Git-Url: http://www2.svjatoslav.eu/gitweb/?a=blobdiff_plain;f=src%2Ftest%2Fjava%2Feu%2Fsvjatoslav%2Finspector%2Fjava%2Fstructure%2Fexample%2FRenderJavaInspect.java;h=132276aa865f37c0e02ed73d86aeebbb788619ad;hb=dda66ce5668b5e27e696759ef5c895d044a572bc;hp=7d9eb807b030dc4b9a550eb747aa65c72f189f09;hpb=94b2a818903a8ec1579dce828b47076c53f435ab;p=javainspect.git diff --git a/src/test/java/eu/svjatoslav/inspector/java/structure/example/RenderJavaInspect.java b/src/test/java/eu/svjatoslav/inspector/java/structure/example/RenderJavaInspect.java index 7d9eb80..132276a 100755 --- a/src/test/java/eu/svjatoslav/inspector/java/structure/example/RenderJavaInspect.java +++ b/src/test/java/eu/svjatoslav/inspector/java/structure/example/RenderJavaInspect.java @@ -17,6 +17,7 @@ import eu.svjatoslav.inspector.java.structure.Utils; public class RenderJavaInspect { private static void fullProjectExample() { + // Create graph final ClassGraph graph = new ClassGraph(); // Recursively scan current directory for Java source code and attempt @@ -24,8 +25,7 @@ public class RenderJavaInspect { graph.addProject("."); // Blacklist example classes from being shown on the graph - graph.getFilter().blacklistClassPattern( - "eu.svjatoslav.inspector.java.structure.example.*"); + graph.blacklistClassPattern("eu.svjatoslav.inspector.java.structure.example.*"); // do not show single classes with no relationships on the graph graph.hideOrphanedClasses(); @@ -38,25 +38,25 @@ public class RenderJavaInspect { private static void handpickClassesExample() { /* * This example demonstrates generating of class graph from hand picked - * classes. + * classes and visualizing GraphViz itself. */ // Create graph final ClassGraph graph = new ClassGraph(); - // While classes and objects can be immediately passed to ClassGraph - // constructor as arguments, it is also possible to add then one by one - // as in the following example. - - // Add some object to the graph. + // Add some random object to the graph. GraphViz will detect Class from + // the object. graph.add(graph); - // Add some class to the graph. + // Also add some random class to the graph. graph.add(Utils.class); + // Keep intermediary GraphViz DOT file for reference. + graph.setKeepDotFile(true); + // Produce bitmap image titled "JavaInspect.png" to the user Desktop - // directory and keep intermediary GraphViz DOT file for reference. - graph.generateGraph("JavaInspect", true); + // directory + graph.generateGraph("JavaInspect"); } public static void main(final String[] args) throws FileNotFoundException {