Package edu.uci.ics.jung.visualization

Examples of edu.uci.ics.jung.visualization.GraphDraw


   */
  public void handle(Request request, Response response, HandlerChain chain)
      throws HandlerException {
    Graph g = getGraph();

    GraphDraw gd = new GraphDraw(g);
    gd.setSize((int) (Math.log(g.numVertices()) * 180), (int) (Math.log(g
        .numVertices()) * 180.0));
    //gd.setGraphLayout(new FRLayout(g));
    //gd.setGraphLayout(new SpringLayout(g));
    //gd.setGraphLayout(new CircleLayout(g));
    gd.setGraphLayout(new ISOMLayout(g));
    //gd.setLayout(SpringLayout.)
    gd.addNotify();
    gd.setSize((int) (Math.log(g.numVertices()) * 180), (int) (Math.log(g
        .numVertices()) * 180.0));
    gd.validate();
    PipedOutputStream out = new PipedOutputStream();
    PipedInputStream pipedIn;
    try {
      pipedIn = new PipedInputStream(out);
      response.setBody(pipedIn);

      try {
        Thread.sleep(500);
      } catch (InterruptedException ex) {
        log.error(ex);
      }
      EnhancedRequestURI ehRequestURI = new EnhancedRequestURI(request
          .getRequestURI());
      if ("true".equals(ehRequestURI.getParameter("showLocally"))) {
        showLocally(gd);
      }

      gd.setBackground(Color.BLUE);
      try {
        Thread.sleep(500);
      } catch (InterruptedException ex) {
        log.error(ex);
      }
View Full Code Here

TOP

Related Classes of edu.uci.ics.jung.visualization.GraphDraw

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.