layout.setSpeed(1.0);//layout.setConverged(Boolean.TRUE);
layout.setFreezeStrength(80.0);
layout.setFreezeInertia(0.2);
layout.setOutboundAttractionDistribution(Boolean.TRUE);//incoming links tend to be at centre
for (int i = 0; i < 100 && layout.canAlgo(); i++) {
layout.goAlgo();
}
//export the graph
ExportController ec = Lookup.getDefault().lookup(ExportController.class);
PDFExporter exporter = (PDFExporter) ec.getExporter("pdf");