Package org.graphstream.ui.view

Examples of org.graphstream.ui.view.ViewerPipe


  protected boolean loop = true;

  public DemoViewerColorInterpolation() {
    Graph graph = new MultiGraph("main graph");
    ViewerPipe pipe = graph.display(false).newViewerPipe();

    // graph.addAttribute( "ui.quality" );
    graph.addAttribute("ui.antialias");

    pipe.addViewerListener(this);

    Node A = graph.addNode("A");
    Node B = graph.addNode("B");
    Node C = graph.addNode("C");

    graph.addEdge("AB", "A", "B", true);
    graph.addEdge("BC", "B", "C", true);
    graph.addEdge("CA", "C", "A", true);

    A.addAttribute("xyz", 0, 1, 0);
    B.addAttribute("xyz", 1, 0, 0);
    C.addAttribute("xyz", -1, 0, 0);

    graph.addAttribute("ui.stylesheet", styleSheet);

    float color = 0;
    float dir = 0.01f;

    while (loop) {
      try {
        Thread.sleep(100);
      } catch (InterruptedException e) {
        e.printStackTrace();
      }

      pipe.pump();

      color += dir;

      if (color > 1) {
        color = 1;
View Full Code Here

TOP

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

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.