Package org.graphstream.ui.view

Examples of org.graphstream.ui.view.Viewer


  }

  public DemoTwoGraphsInOneViewer() {
    Graph graph1 = new MultiGraph("g1");
    Graph graph2 = new MultiGraph("g2");
    Viewer viewer1 = new Viewer(new ThreadProxyPipe(graph1));
    Viewer viewer2 = new Viewer(new ThreadProxyPipe(graph2));

    graph1.addAttribute("ui.stylesheet", styleSheet1);
    graph2.addAttribute("ui.stylesheet", styleSheet2);
    //View view1 =
    viewer1.addDefaultView(true);
    viewer2.addDefaultView(true);
    viewer1.enableAutoLayout();
    viewer2.enableAutoLayout();

    //view1.setBackLayerRenderer(view2);

    FileSourceDGS dgs = new FileSourceDGS();
View Full Code Here


  }

  public DemoLayoutAndViewer() {
    boolean loop = true;
    Graph graph = new MultiGraph("test");
    Viewer viewer = new Viewer(new ThreadProxyPipe(graph));
    ProxyPipe fromViewer = viewer.newThreadProxyOnGraphicGraph();
    LinLog layout = new LinLog(false);
   
    layout.configure(a, r, true, force);

    graph.addAttribute("ui.antialias");
    graph.addAttribute("ui.stylesheet", styleSheet);
    fromViewer.addSink(graph);
    viewer.addDefaultView(true);
    graph.addSink(layout);
    layout.addAttributeSink(graph);

    FileSource dgs = GRAPH.endsWith(".gml") ? new FileSourceGML() : new FileSourceDGS();
View Full Code Here

    Graph graph  = new MultiGraph("mg");
   
    // On demande au viewer de consid�rer que le graphe ne sera lu et modifi� que
    // dans le thread Swing.
   
    Viewer viewer = new Viewer(graph, Viewer.ThreadingModel.GRAPH_IN_GUI_THREAD);

    // � Partir de l�, le viewer consid�re que le graphe est dans son propre thread,
    // c'est-�-dire le thread Swing. Il est donc dangereux d'y toucher dans la thread
    // main. On utilise invokeLater pour faire tourner du code dans le thread Swing,
    // par exemple pour initialiser l'application :
View Full Code Here

  }

  public DemoViewerJComponents() {
    Graph graph = new MultiGraph("main graph");
    ThreadProxyPipe toSwing = new ThreadProxyPipe(graph);
    Viewer viewer = new Viewer(toSwing);
    ProxyPipe fromSwing = viewer.newThreadProxyOnGraphicGraph();
    SpriteManager sman = new SpriteManager(graph);

    fromSwing.addAttributeSink(graph);
    viewer.addDefaultView(true);

    Node A = graph.addNode("A");
    Node B = graph.addNode("B");
    Node C = graph.addNode("C");
View Full Code Here

          String.format(
              "node { text-alignment: at-right; size: %dpx; fill-color: grey; %s text-background-mode: plain; text-offset: 2px, 0px; text-padding: 2px; text-background-color: #FFFFFFAA; } edge { fill-color: #333; }",
              entry.veryLarge ? 6 : 16, entry.veryLarge ? ""
                  : "stroke-mode: plain; stroke-color: #333;"));
   
    Viewer v = graph.display(entry.autoLayout);
    v.setCloseFramePolicy(CloseFramePolicy.CLOSE_VIEWER);
   
    in.addSink(graph);
    in.readAll(TestPajekParser.class
        .getResourceAsStream(entry.ressourceName));

    if (entry.addLabels) {
      for (Node node : graph) {
        node.addAttribute("ui.label", node.getId());
      }
    }
   
    try {
      Thread.sleep(1000);
    } catch(Exception e) {}
   
    v.close();
  }
View Full Code Here

  public Viewer display() {
    return display(true);
  }

  public Viewer display(boolean autoLayout) {
    Viewer viewer = new Viewer(this,
        Viewer.ThreadingModel.GRAPH_IN_ANOTHER_THREAD);
    GraphRenderer renderer = Viewer.newGraphRenderer();
    viewer.addView(Viewer.DEFAULT_VIEW_ID, renderer);
    if (autoLayout) {
      Layout layout = Layouts.newLayoutAlgorithm();
      viewer.enableAutoLayout(layout);
    }
    return viewer;
  }
View Full Code Here

TOP

Related Classes of org.graphstream.ui.view.Viewer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.