if (isHorizontalIn(parent)) layoutAlgorithm(parent, HORIZONTAL, VERTICAL);
Component[] children = container.getComponents(); SizeRequirements[] hSizeReqs = new SizeRequirements[children.length]; SizeRequirements[] vSizeReqs = new SizeRequirements[children.length]; getSizeRequirements(hSizeReqs, vSizeReqs);  int[] hSpans = new int[children.length]; int[] hOffsets = new int[children.length]; int[] vSpans = new int[children.length]; int[] vOffsets = new int[children.length];  Insets insets = container.getInsets(); int width = container.getWidth() - insets.left - insets.right - 1; int height = container.getHeight() - insets.top - insets.bottom - 1; if (isHorizontalIn(container)) { SizeRequirements.calculateTiledPositions(width, null, hSizeReqs, hOffsets, hSpans); SizeRequirements.calculateAlignedPositions(height, null, vSizeReqs, vOffsets, vSpans); }
  public void layoutContainer(Container parent)  {    if (isHorizontalIn(parent))      layoutAlgorithm(parent, HORIZONTAL, VERTICAL);    else      layoutAlgorithm(parent, VERTICAL, HORIZONTAL);  }