Java 类com.google.inject.grapher.graphviz.GraphvizGrapher 实例源码

项目:runelite    文件:PluginManagerTest.java   
@Test
public void dumpGraph() throws Exception
{
    List<Module> modules = new ArrayList<>();
    modules.add(new GraphvizModule());
    modules.add(new RuneLiteModule());

    runelite.setClient(client);

    PluginManager pluginManager = new PluginManager();
    pluginManager.loadCorePlugins();
    for (Plugin p : pluginManager.getPlugins())
    {
        modules.add(p);
    }

    File file = folder.newFile();
    try (PrintWriter out = new PrintWriter(file, "UTF-8"))
    {
        Injector injector = Guice.createInjector(modules);
        GraphvizGrapher grapher = injector.getInstance(GraphvizGrapher.class);
        grapher.setOut(out);
        grapher.setRankdir("TB");
        grapher.graph(injector);
    }
}
项目:bue-common-open    文件:TextGroupEntryPoints.java   
private static void maybeGraphGuiceDependencies(final Injector injector,
    final Class<? extends TextGroupEntryPoint> entryPointClass, final Parameters params)
    throws IOException {

  final Optional<File> dotFile = params.getOptionalCreatableFile(GRAPH_DEPENDENCIES_PARAM);

  if (dotFile.isPresent()) {
    final Injector grapherInjector = Guice.createInjector(new GraphvizModule());
    final GraphvizGrapher grapher = grapherInjector.getInstance(GraphvizGrapher.class);
    // orient graph vertically
    grapher.setRankdir("TB");

    log.info("Writing Guice configuration graph to {}. To compile it, do dot -T png {}",
        dotFile.get(), dotFile.get());
    try (PrintWriter out = new PrintWriter(Files.asCharSink(dotFile.get(), Charsets.UTF_8)
        .openBufferedStream())) {
      grapher.setOut(out);
      grapher.graph(injector, ImmutableSet.<Key<?>>of(Key.get(entryPointClass)));
    }
  }
}
项目:guice    文件:InjectorGrapherDemo.java   
public static void main(String[] args) throws Exception {
  // TODO(phopkins): Switch to Stage.TOOL when issue 297 is fixed.
  Injector demoInjector =
      Guice.createInjector(
          Stage.DEVELOPMENT,
          new BackToTheFutureModule(),
          new MultibinderModule(),
          new PrivateTestModule());
  PrintWriter out = new PrintWriter(new File(args[0]), "UTF-8");

  Injector injector = Guice.createInjector(new GraphvizModule());
  GraphvizGrapher grapher = injector.getInstance(GraphvizGrapher.class);
  grapher.setOut(out);
  grapher.setRankdir("TB");
  grapher.graph(demoInjector);
}
项目:ProjectAres    文件:Grapher.java   
public void writeGraph(File file, Injector injector) throws IOException {
    final PrintWriter out = new PrintWriter(file, Charsets.UTF_8.name());
    final GraphvizGrapher grapher = Guice.createInjector(new GraphvizModule()).getInstance(GraphvizGrapher.class);

    grapher.setOut(out);
    grapher.setRankdir("TB");
    grapher.graph(injector);
}
项目:ComeAndGo    文件:Architecture.java   
private static void writeDotFile(String filename, Injector demoInjector) throws IOException {
    PrintWriter out = new PrintWriter(new File(filename), "UTF-8");

    com.google.inject.Injector injector = Guice.createInjector(new GraphvizModule());
    GraphvizGrapher grapher = injector.getInstance(GraphvizGrapher.class);
    grapher.setOut(out);
    grapher.setRankdir("TB");
    grapher.graph(demoInjector);
}
项目:pinpoint    文件:DependencyGraph.java   
public void graph(String filename, Injector demoInjector) throws IOException {
    PrintWriter out = new PrintWriter(new File(filename), Charsets.UTF_8.name());

    Injector injector = Guice.createInjector(new GraphvizModule());
    GraphvizGrapher grapher = injector.getInstance(GraphvizGrapher.class);
    grapher.setOut(out);
    grapher.setRankdir("TB");
    grapher.graph(demoInjector);
}
项目:pinpoint    文件:Grapher.java   
public void graph(String filename, Injector demoInjector) throws IOException {
    PrintWriter out = new PrintWriter(new File(filename), Charsets.UTF_8_NAME);

    Injector injector = Guice.createInjector(new GraphvizModule());
    GraphvizGrapher grapher = injector.getInstance(GraphvizGrapher.class);
    grapher.setOut(out);
    grapher.setRankdir("TB");
    grapher.graph(demoInjector);
}
项目:guice-old    文件:InjectorGrapherDemo.java   
public static void main(String[] args) throws Exception {
  // TODO(phopkins): Switch to Stage.TOOL when issue 297 is fixed.
  Injector demoInjector = Guice.createInjector(Stage.DEVELOPMENT,
      new BackToTheFutureModule(), new MultibinderModule(), new PrivateTestModule());
  PrintWriter out = new PrintWriter(new File(args[0]), "UTF-8");

  Injector injector = Guice.createInjector(new GraphvizModule());
  GraphvizGrapher grapher = injector.getInstance(GraphvizGrapher.class);
  grapher.setOut(out);
  grapher.setRankdir("TB");
  grapher.graph(demoInjector);
}
项目:google-guice    文件:InjectorGrapherDemo.java   
public static void main(String[] args) throws Exception {
  // TODO(phopkins): Switch to Stage.TOOL when issue 297 is fixed.
  Injector demoInjector = Guice.createInjector(Stage.DEVELOPMENT,
      new BackToTheFutureModule(), new MultibinderModule(), new PrivateTestModule());
  PrintWriter out = new PrintWriter(new File(args[0]), "UTF-8");

  Injector injector = Guice.createInjector(new GraphvizModule());
  GraphvizGrapher grapher = injector.getInstance(GraphvizGrapher.class);
  grapher.setOut(out);
  grapher.setRankdir("TB");
  grapher.graph(demoInjector);
}