use of cbit.vcell.graph.GeometryContextStructureShape in project vcell by virtualcell.
the class GraphContainerLayoutVCellClassical method refreshLayoutChildrenGeometryContextStructureShape.
public void refreshLayoutChildrenGeometryContextStructureShape(GeometryContextStructureShape shape) {
// calculate total height and max width of SubVolumeContainerShape
int childHeight = 0;
int childWidth = 0;
for (Shape child : shape.getChildren()) {
childHeight += child.getSpaceManager().getSize().height;
childWidth = Math.max(childWidth, child.getSpaceManager().getSize().width);
}
int centerX = shape.getSpaceManager().getSize().width / 2;
int centerY = shape.getSpaceManager().getSize().height / 2;
int currY = Math.max(0, centerY - childHeight / 2) + shape.getLabelSize().height + 2;
for (Shape child : shape.getChildren()) {
child.getSpaceManager().setRelPos(centerX - child.getSpaceManager().getSize().width / 2, currY);
currY += child.getSpaceManager().getSize().height;
child.refreshLayoutSelf();
refreshLayoutChildren(child);
}
}
Aggregations