public void execute(Object parent) { mxIGraphModel model = graph.Model; //.GetModel(); // Moves the vertices to build a circle. Makes sure the // radius is large enough for the vertices to not // overlap model.BeginUpdate(); try { // Gets all vertices inside the parent and finds // the maximum dimension of the largest vertex double max = 0; Double top = 0; Double left = 0; List <Object> vertices = new List <Object>(); int childCount = model.GetChildCount(parent); for (int i = 0; i < childCount; i++) { Object cell = model.GetChildAt(parent, i); if (!isVertexIgnored(cell)) { vertices.add(cell); mxRectangle bounds = getVertexBounds(cell); if (top == null) { top = bounds.getY(); } else { top = Math.Min(top, bounds.getY()); } if (left == null) { left = bounds.getX(); } else { left = Math.Min(left, bounds.getX()); } max = Math.Max(max, Math.Max(bounds.getWidth(), bounds .getHeight())); } else if (!isEdgeIgnored(cell)) { if (isResetEdges()) { graph.resetEdge(cell); } if (isDisableEdgeStyle()) { setEdgeStyleEnabled(cell, false); } } } int vertexCount = vertices.size(); double r = Math.Max(vertexCount * max / Math.PI, radius); // Moves the circle to the specified origin if (moveCircle) { left = x0; top = y0; } circle(vertices.ToArray(), r, left, top); } finally { model.EndUpdate(); } }