Changed license to LGPLv3.
[javainspect.git] / doc / index.html
old mode 100644 (file)
new mode 100755 (executable)
index 9028b5c..82116d1
     Homepage: <a href="http://svjatoslav.eu">http://svjatoslav.eu</a>\r
     Email: <a href="mailto:svjatoslav@svjatoslav.eu">svjatoslav@svjatoslav.eu</a>\r
 \r
-This software is distributed under <a\r
-                       href="http://www.gnu.org/licenses/gpl-2.0.html">GNU GENERAL PUBLIC LICENSE Version 2</a>.\r
+This software is distributed under <a href="http://www.gnu.org/copyleft/lesser.html">GNU LESSER GENERAL PUBLIC LICENSE version 3 or later</a>.\r
 \r
 </pre>\r
 \r
        <h2>General</h2>\r
 \r
+       Goal: simplify/speed up understanding the computer program code by\r
+       automatically visualizing its structure.\r
+         \r
+       <br/><br/>\r
        JavaInspect is a Java library that you can embed into your Java project\r
        with a few lines of Maven configuration and then visualize any part of\r
        your Java program structure with few simple JavaInspect API calls at\r
@@ -66,24 +69,31 @@ This software is distributed under <a
        <img src="legend.png" />\r
 \r
 \r
-       <h2>Usage example</h2>\r
+       <h2>Usage example 1</h2>\r
 \r
-       Following example produces graph for JavaInspect itself:\r
-\r
-       <pre>\r
+<pre>\r
 <code>\r
-// Create graph\r
-final Graph graph = new Graph();\r
+               /*\r
+                * This example demonstrates generating of class graph from hand picked\r
+                * classes.\r
+                */\r
+\r
+               // Create graph\r
+               final ClassGraph graph = new ClassGraph();\r
 \r
-// Add some object to the graph.\r
-graph.addObject(graph);\r
+               // While classes and objects can be immediately passed to ClassGraph\r
+               // constructor as arguments, it is also possible to add then one by one\r
+               // as in the following example.\r
 \r
-// Add some class to the graph.\r
-graph.addClass(Utils.class);\r
+               // Add some object to the graph.\r
+               graph.addObject(graph);\r
 \r
-// Produce bitmap image titled "JavaInspect.png" to the user Desktop\r
-// directory.\r
-graph.generateGraph("JavaInspect", true);\r
+               // Add some class to the graph.\r
+               graph.addClass(Utils.class);\r
+\r
+               // Produce bitmap image titled "JavaInspect.png" to the user Desktop\r
+               // directory and keep intermediary GraphViz DOT file for reference.\r
+               graph.generateGraph("JavaInspect", true);\r
 </code>\r
 \r
 \r
@@ -94,6 +104,33 @@ Result:
 </pre>\r
 \r
 \r
+       <h2>Usage example 2</h2>\r
+\r
+<pre>\r
+<code>\r
+               // Recursively scan current directory for Java source code and attempt\r
+               // to detect class names from there to be added to the graph.\r
+               graph.addProject(".");\r
+\r
+               // Blacklist example classes from being shown on the graph\r
+               graph.getFilter().blacklistClassPattern(\r
+                               "eu.svjatoslav.inspector.java.structure.example.*");\r
+\r
+               // do not show single classes with no relationships on the graph\r
+               graph.hideOrphanedClasses();\r
+\r
+               // Produce bitmap image titled "JavaInspect full project.png" to the\r
+               // user Desktop directory.\r
+               graph.generateGraph("JavaInspect full project");\r
+</code>\r
+\r
+\r
+Result:\r
+    Generated PNG image: <a href="JavaInspect full project.png">JavaInspect full project.png</a>\r
+\r
+</pre>\r
+\r
+\r
 \r
        <h2>Embedding JavaInspect in your project</h2>\r
        <pre>\r
@@ -107,7 +144,7 @@ Declare JavaInspect as dependency:
         &lt;dependency&gt;\r
             &lt;groupId&gt;eu.svjatoslav&lt;/groupId&gt;\r
             &lt;artifactId&gt;javainspect&lt;/artifactId&gt;\r
-            &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;\r
+            &lt;version&gt;1.3&lt;/version&gt;\r
         &lt;/dependency&gt;\r
  \r
     &lt;/dependencies&gt;\r