Figure f = new FreeformLayer();
f.setLayoutManager(new FreeformLayout());
// Create the static router for the connection layer
ConnectionLayer connLayer = (ConnectionLayer) getLayer(LayerConstants.CONNECTION_LAYER);
ShortestPathConnectionRouter router = new ShortestPathConnectionRouter(
f);
router.setSpacing(2);
// ManhattanConnectionRouter router = new ManhattanConnectionRouter();
connLayer.setConnectionRouter(router);
return f;
}