private void updateMarginSize(CompoundModel root) { for (Object o : root.getChildren()) { GraphObject child = (GraphObject) o; if (child instanceof CompoundModel) { updateMarginSize((CompoundModel) child); } } root.calculateSizeUp(); }
public void setMarginSize(int margin) { this.MARGIN_SIZE = margin; CompoundModel root = this; while (root.getParentModel() != null) { root = root.getParentModel(); } for (Object o : root.getChildren()) { if (o instanceof CompoundModel) { updateMarginSize((CompoundModel) o); } } }