*/
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);
}