Revision: 1573
Author: [email protected]
Date: Mon Jul 18 21:12:56 2011
Log: Edited wiki page Grapher through web user interface.
http://code.google.com/p/google-guice/source/detail?r=1573
Modified:
/wiki/Grapher.wiki
=======================================
--- /wiki/Grapher.wiki Wed Feb 11 16:57:03 2009
+++ /wiki/Grapher.wiki Mon Jul 18 21:12:56 2011
@@ -6,22 +6,18 @@
Guice's grapher leans heavily on [http://www.graphviz.org/ GraphViz], an
open source graph visualization package. It cleanly separates graph
specification from visualization and layout. To produce a graph `.dot` file
for an `Injector`, you can use the following code:
{{{
import com.google.inject.Injector;
-import com.google.inject.grapher.GrapherModule;
-import com.google.inject.grapher.InjectorGrapher;
+import com.google.inject.grapher.graphviz.GraphvizGrapher;
import com.google.inject.grapher.graphviz.GraphvizModule;
-import com.google.inject.grapher.graphviz.GraphvizRenderer;
public class Grapher {
private void graph(String filename, Injector demoInjector) throws
IOException {
PrintWriter out = new PrintWriter(new File(filename), "UTF-8");
- Injector injector = Guice.createInjector(new GrapherModule(), new
GraphvizModule());
- GraphvizRenderer renderer =
injector.getInstance(GraphvizRenderer.class);
- renderer.setOut(out).setRankdir("TB");
-
- injector.getInstance(InjectorGrapher.class)
- .of(demoInjector)
- .graph();
+ Injector injector = Guice.createInjector(new GraphvizModule());
+ GraphvizGrapher grapher = injector.getInstance(GraphvizGrapher.class);
+ grapher.setOut(out);
+ grapher.setRankdir("TB");
+ grapher.graph(demoInjector);
}
}
}}}
--
You received this message because you are subscribed to the Google Groups
"google-guice-dev" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-guice-dev?hl=en.