public mxCell insertVertex(VertexValue value) { graph.getModel().beginUpdate(); Object parent = graph.getDefaultParent(); Object inserted; try { inserted = graph.insertVertex(parent, null, value, 0, 0, vertexWidth, vertexHeight); layout.execute(parent); } catch (Exception e) { e.printStackTrace(); return null; } finally { graph.getModel().endUpdate(); } return (mxCell) inserted; }
private void morphLayout() { panGraph.getModel().beginUpdate(); layout.execute(graphParent); panGraph.getModel().endUpdate(); }
public void executeLayout() { layout.execute(graph.getDefaultParent()); }