Logo Search packages:      
Sourcecode: libjgoodies-forms-java version File versions  Download package

void com::jgoodies::forms::layout::FormLayout::layoutContainer ( Container  parent  )  [inline]

Lays out the specified container using this form layout. This method reshapes components in the specified container in order to satisfy the contraints of this FormLayout object.

Most applications do not call this method directly.

The form layout performs the following steps:

  1. find components that occupy exactly one column or row
  2. compute minimum widths and heights
  3. compute preferred widths and heights
  4. give cols and row equal size if they share a group
  5. compress default columns and rows if total is less than pref size
  6. give cols and row equal size if they share a group
  7. distribute free space
  8. set components bounds

Parameters:
parent the container in which to do the layout
See also:
Container

Container::doLayout()

Definition at line 994 of file FormLayout.java.

References colComponents, colGroupIndices, colSpecs, computeGridOrigins(), initializeColAndRowComponentLists(), layoutComponents(), minimumWidthMeasure, rowComponents, rowGroupIndices, and rowSpecs.

                                                  {
        synchronized (parent.getTreeLock()) {
            initializeColAndRowComponentLists();
            Dimension size = parent.getSize();
            
            Insets insets = parent.getInsets();
            int totalWidth  = size.width - insets.left - insets.right;
            int totalHeight = size.height- insets.top  - insets.bottom; 

            int[] x = computeGridOrigins(parent,
                                         totalWidth, insets.left,
                                         colSpecs, 
                                         colComponents,
                                         colGroupIndices,
                                         minimumWidthMeasure,
                                         preferredWidthMeasure
                                         );
            int[] y = computeGridOrigins(parent,
                                         totalHeight, insets.top,
                                         rowSpecs, 
                                         rowComponents,
                                         rowGroupIndices,
                                         minimumHeightMeasure,
                                         preferredHeightMeasure
                                         );
                                         
            layoutComponents(x, y);
        }        
    }


Generated by  Doxygen 1.6.0   Back to index