From 25ee1c84ae7afd5c4c09b8b5ef2da1a1976e026b Mon Sep 17 00:00:00 2001 From: Svjatoslav Agejenko Date: Sat, 21 Jan 2017 21:57:32 +0200 Subject: [PATCH] Updated documentation theme. --- doc/index.html | 614 ++++++++++++++++++++++++++++--------------------- doc/index.org | 12 +- 2 files changed, 361 insertions(+), 265 deletions(-) diff --git a/doc/index.html b/doc/index.html index 5836449..5ee48a2 100644 --- a/doc/index.html +++ b/doc/index.html @@ -1,189 +1,228 @@ - - - + + - - - JavaInspect - Utility to visualize java software - - + + + + + + + +" + - -
-

JavaInspect - Utility to visualize java software

- -
+
+

JavaInspect - Utility to visualize java software

+
+ -
  • other applications hosted at svjatoslav.eu
  • +
  • other applications hosted at svjatoslav.eu +
  • -
    -

    1 General

    +
    +

    1 General

    Goal: simplify/speed up understanding the computer program code by @@ -208,12 +247,14 @@ up with 2 solutions:

      -
    1. Add JavaInspect library in your project as a dependency.
    2. +
    3. Add JavaInspect library in your project as a dependency. +
    4. Create new Java project for the purpose visualizing your other projects and include JavaInspect and your projecs binary artifacts (Jar's) into new project classpath. Built binary Jar's (with no source code) are sufficient because JavaInspect operates via -reflection.
    5. +reflection. +

    @@ -224,42 +265,42 @@ bitmap graph in PNG format. By default on your Desktop directory.

    -Note: GraphViz is developed and tested so far only on GNU Linux. +Note: GraphViz is developed and tested so far only on GNU/Linux.

    -
    -

    2 Example graphs

    +
    +

    2 Example graphs

    -
    -

    3 Usage

    +
    +

    3 Usage

    Currently the only way to control JavaInspect is by using Java @@ -273,35 +314,46 @@ product or project artifact I'm just willing to visualize. Control code in general does the following:

      -
    1. Create graph object.
    2. +
    3. Create graph object. +
    4. Java reflection/classloaders does not provide mechanism for discovering all classes under given package. Therefore you need to declare at least some classes to be added to the graph by:
        -
      • Manually adding individual classes to the graph.
      • +
      • Manually adding individual classes to the graph. +
      • and/or: Let GraphViz recursively scan and parse specified -directories with Java source code files to discover class names.
      • +directories with Java source code files to discover class names. +
      • For every class added to the graph, GraphViz will recursively -inspect it and add all referecned classes to the graph as well.
      • -
    5. +inspect it and add all referecned classes to the graph as well. + + +
    6. Graphs easilly get very big and complex so optionally we filter important code using classname wildcards patterns based blacklist -and/or whitelist.
    7. +and/or whitelist. +
    8. Optionally we can tune some rendering parameters like:
      • Possibility to remove orphaned classes (classes with no -references) from the graph.
      • +references) from the graph. +
      • Specify target directory for generated visualization -files. (Default is user desktop directory)
      • -
      • Keep intermediate GraphViz dot file for later inspection.
      • -
    9. -
    10. Render graph.
    11. +files. (Default is user desktop directory) + +
    12. Keep intermediate GraphViz dot file for later inspection. +
    13. + + +
    14. Render graph. +
    -
    -

    3.1 example 1: individually picked objects

    +
    +

    3.1 example 1: individually picked objects

    This example demonstrates generating of class graph from hand picked @@ -310,22 +362,22 @@ classes and visualizing GraphViz itself.

    -
    // Create graph
    -final ClassGraph graph = new ClassGraph();
    +
    // Create graph
    +final ClassGraph graph = new ClassGraph();
     
    -// Add some random object to the graph. GraphViz will detect Class from
    -// the object.
    -graph.add(graph);
    +// Add some random object to the graph. GraphViz will detect Class from
    +// the object.
    +graph.add(graph);
     
    -// Also add some random class to the graph.
    -graph.add(Utils.class);
    +// Also add some random class to the graph.
    +graph.add(Utils.class);
     
    -// Keep intermediary GraphViz DOT file for reference.
    -graph.setKeepDotFile(true);
    +// Keep intermediary GraphViz DOT file for reference.
    +graph.setKeepDotFile(true);
     
    -// Produce bitmap image titled "JavaInspect.png" to the user Desktop
    -// directory
    -graph.generateGraph("JavaInspect");
    +// Produce bitmap image titled "JavaInspect.png" to the user Desktop
    +// directory
    +graph.generateGraph("JavaInspect");
     
    @@ -334,8 +386,8 @@ Note: if desired, more compact version of the above:

    -
    new ClassGraph().add(randomObject, RandomClass.class)
    -                .setKeepDotFile(true).generateGraph("JavaInspect");
    +
    new ClassGraph().add(randomObject, RandomClass.class)
    +                .setKeepDotFile(true).generateGraph("JavaInspect");
     
    @@ -344,72 +396,77 @@ Note: if desired, more compact version of the above: Result:

    -
    -

    3.2 example 2: scan java code, apply filters

    +
    +

    3.2 example 2: scan java code, apply filters

    -
    // Create graph
    -final ClassGraph graph = new ClassGraph();
    +
    // Create graph
    +final ClassGraph graph = new ClassGraph();
     
    -// Recursively scan current directory for Java source code and attempt
    -// to detect class names from there to be added to the graph.
    -graph.addProject(".");
    +// Recursively scan current directory for Java source code and attempt
    +// to detect class names from there to be added to the graph.
    +graph.addProject(".");
     
    -// Blacklist example classes from being shown on the graph
    -graph.blacklistClassPattern("eu.svjatoslav.inspector.java.structure.example.*");
    +// Blacklist example classes from being shown on the graph
    +graph.blacklistClassPattern("eu.svjatoslav.inspector.java.structure.example.*");
     
    -// do not show single classes with no relationships on the graph
    -graph.hideOrphanedClasses();
    +// do not show single classes with no relationships on the graph
    +graph.hideOrphanedClasses();
     
    -// Produce bitmap image titled "JavaInspect full project.png" to the
    -// user Desktop directory.
    -graph.generateGraph("JavaInspect full project");
    +// Produce bitmap image titled "JavaInspect full project.png" to the
    +// user Desktop directory.
    +graph.generateGraph("JavaInspect full project");
     

    Result:

    -
    -

    3.3 example 3: GraphViz embedded in another project

    +
    +

    3.3 example 3: GraphViz embedded in another project

      -
    1. Download project Sixth code snapshot.
    2. -
    3. Inspect and run *DataGraph.java*.
    4. +
    5. Download project Sixth code snapshot. +
    6. +
    7. Inspect and run *DataGraph.java*. +
    -
    -

    4 Embedding JavaInspect in your Maven project

    +
    +

    4 Embedding JavaInspect in your Maven project

    Declare JavaInspect as dependency:

    -
    <dependencies>
    +
    <dependencies>
         ...
    -    <dependency>
    -        <groupId>eu.svjatoslav</groupId>
    -        <artifactId>javainspect</artifactId>
    -        <version>1.5</version>
    -    </dependency>
    +    <dependency>
    +        <groupId>eu.svjatoslav</groupId>
    +        <artifactId>javainspect</artifactId>
    +        <version>1.5</version>
    +    </dependency>
         ...
    -</dependencies>
    +</dependencies>
     
    @@ -419,22 +476,22 @@ Add Maven repository to retrieve artifact from:

    -
    <repositories>
    +
    <repositories>
         ...
    -    <repository>
    -        <id>svjatoslav.eu</id>
    -        <name>Svjatoslav repository</name>
    -        <url>http://www2.svjatoslav.eu/maven/</url>
    -    </repository>
    +    <repository>
    +        <id>svjatoslav.eu</id>
    +        <name>Svjatoslav repository</name>
    +        <url>http://www2.svjatoslav.eu/maven/</url>
    +    </repository>
         ...
    -</repositories>
    +</repositories>
     
    -
    -

    5 Requirements

    +
    +

    5 Requirements

    GraphViz - shall be installed on the computer. @@ -450,35 +507,64 @@ On Ubuntu/Debian use:

    -
    -

    6 TO DO

    +
    +

    6 TO DO

    • BUG: Should not hide references if there are too many of them to classes if referring classes are not visible anyway because of blacklist/whitelist rules. -Basically reference counting should exclude not visible classes.
    • -
    • FEATURE: add dark theme
    • -
    • FEATURE: sort Class fields by alphabet
    • +Basically reference counting should exclude not visible classes. + +
    • FEATURE: add dark theme +
    • +
    • FEATURE: sort Class fields by alphabet +
    • FEATURE: visualize also concrete field values so it could be used as -ultra cool runtime logging framework
    • +ultra cool runtime logging framework +
    • FEATURE: possibility to visualize structure and data from JVM -snapshot
    • +snapshot +
    • FEATURE: possibility to attach to remote process to visualize -data/structure using JVM debug port and mechanism.
    • -
    • FEATURE: possibility to attach to JVM using JVM agent
    • -
    • FEATURE: possibility to script javainspect behavior
    • +data/structure using JVM debug port and mechanism. + +
    • FEATURE: possibility to attach to JVM using JVM agent +
    • +
    • FEATURE: possibility to script javainspect behavior +
    • FEATURE: possibility to select classes/fields/values to be -visualized in SQL like syntax
    • +visualized in SQL like syntax +
    • FEATURE: configurable maven plugin to generate graphs as part of the -project build/release process
    • +project build/release process +
    +
    +
    +

    Author: Svjatoslav Agejenko

    +

    Created: 2017-01-21 Sat 21:56

    +

    Emacs 24.4.1 (Org-mode 8.2.10)

    +
    diff --git a/doc/index.org b/doc/index.org index 42916a3..120b9e8 100644 --- a/doc/index.org +++ b/doc/index.org @@ -14,6 +14,16 @@ - [[http://svjatoslav.eu/programs.jsp][other applications hosted at svjatoslav.eu]] +* (document settings) :noexport: +** use dark style for TWBS-HTML exporter +#+HTML_HEAD: +#+HTML_HEAD: +#+HTML_HEAD: " +#+HTML_HEAD: + * General Goal: simplify/speed up understanding the computer program code by automatically visualizing its structure. @@ -41,7 +51,7 @@ unimportant parts, JavaInspect produces GraphViz dot file that describes data to be visualized. Then launches GraphViz to generate bitmap graph in PNG format. By default on your Desktop directory. -Note: GraphViz is developed and tested so far only on GNU Linux. +Note: GraphViz is developed and tested so far only on GNU/Linux. * Example graphs + A very simple example: -- 2.20.1