projects
/
javainspect.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Refactoring. API simplifications. Documentation updates.
[javainspect.git]
/
src
/
test
/
java
/
eu
/
svjatoslav
/
inspector
/
java
/
structure
/
example
/
RenderJavaInspect.java
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
old mode 100644
(file)
new mode 100755
(executable)
index
560c172
..
181ac09
--- a/
src/test/java/eu/svjatoslav/inspector/java/structure/example/RenderJavaInspect.java
+++ b/
src/test/java/eu/svjatoslav/inspector/java/structure/example/RenderJavaInspect.java
@@
-1,10
+1,10
@@
/*
* JavaInspect - Utility to visualize java software
/*
* JavaInspect - Utility to visualize java software
- * Copyright (C) 2013, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
- *
+ * Copyright (C) 2013
-2015
, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
+ *
* This program is free software; you can redistribute it and/or
* This program is free software; you can redistribute it and/or
- * modify it under the terms of version
2 of the GNU
General Public License
- * as published by the Free Software Foundation.
+ * modify it under the terms of version
3 of the GNU Lesser
General Public License
+ *
or later
as published by the Free Software Foundation.
*/
package eu.svjatoslav.inspector.java.structure.example;
*/
package eu.svjatoslav.inspector.java.structure.example;
@@
-16,14
+16,6
@@
import eu.svjatoslav.inspector.java.structure.Utils;
public class RenderJavaInspect {
public class RenderJavaInspect {
- public static void main(final String[] args) throws FileNotFoundException {
-
- handpickClassesExample();
-
- fullProjectExample();
-
- }
-
private static void fullProjectExample() {
final ClassGraph graph = new ClassGraph();
private static void fullProjectExample() {
final ClassGraph graph = new ClassGraph();
@@
-32,8
+24,7
@@
public class RenderJavaInspect {
graph.addProject(".");
// Blacklist example classes from being shown on the graph
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();
// do not show single classes with no relationships on the graph
graph.hideOrphanedClasses();
@@
-46,24
+37,29
@@
public class RenderJavaInspect {
private static void handpickClassesExample() {
/*
* This example demonstrates generating of class graph from hand picked
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();
*/
// 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.
- graph.addObject(graph);
+ // Add some random object to the graph. GraphViz will detect Class from
+ // the object.
+ graph.add(graph);
- // Add some class to the graph.
- graph.add
Class
(Utils.class);
+ // Add some
random
class to the graph.
+ graph.add(Utils.class);
// Produce bitmap image titled "JavaInspect.png" to the user Desktop
// directory and keep intermediary GraphViz DOT file for reference.
// Produce bitmap image titled "JavaInspect.png" to the user Desktop
// directory and keep intermediary GraphViz DOT file for reference.
- graph.generateGraph("JavaInspect", true);
+ graph.setKeepDotFile(true).generateGraph("JavaInspect");
+ }
+
+ public static void main(final String[] args) throws FileNotFoundException {
+
+ handpickClassesExample();
+
+ fullProjectExample();
+
}
}
}
}