/** * Get the graph to be layouted. */ public Graph getGraph() { if(layers==null) layoutLayers(); if(!positions) setPositions(); return super.getGraph(); }
private void adjustLocations(Dimension oldSize, Dimension size) { int xOffset = (size.width - oldSize.width) / 2; int yOffset = (size.height - oldSize.height) / 2; // now, move each vertex to be at the new screen center while(true) { try { for(V v : getGraph().getVertices()) { offsetVertex(v, xOffset, yOffset); } break; } catch(ConcurrentModificationException cme) { } } }
private void adjustLocations(Dimension oldSize, Dimension size) { int xOffset = (size.width - oldSize.width) / 2; int yOffset = (size.height - oldSize.height) / 2; // now, move each vertex to be at the new screen center while(true) { try { for(V v : getGraph().getVertices()) { offsetVertex(v, xOffset, yOffset); } break; } catch(ConcurrentModificationException cme) { } } }
Graph graph = super.getGraph(); List rootnodes = new ArrayList(); List leafnodes = new ArrayList();