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

int [] com::jgoodies::forms::layout::FormLayout::computeGridOrigins ( Container  container,
int  totalSize,
int  offset,
List  formSpecs,
List[]  componentLists,
int  groupIndices[][],
Measure  minMeasure,
Measure  prefMeasure 
) [inline, private]

Computes and returns the grid's origins.

Parameters:
container the layout container
totalSize the total size to assign
offset the offset from left or top margin
formSpecs the column or row specs, resp.
componentLists the components list for each col/row
minMeasure the measure used to determin min sizes
prefMeasure the measure used to determin pre sizes
groupIndices the group specification
Returns:
an int array with the origins

Definition at line 1162 of file FormLayout.java.

References compressedSizes(), computeOrigins(), distributedSizes(), groupedSizes(), maximumSizes(), and sum().

Referenced by getLayoutInfo(), and layoutContainer().

                                                           {
        /* For each spec compute the minimum and preferred size that is 
         * the maximum of all component minimum and preferred sizes resp.
         */
        int[] minSizes   = maximumSizes(container, formSpecs, componentLists, 
                                        minMeasure, prefMeasure, minMeasure);
        int[] prefSizes  = maximumSizes(container, formSpecs, componentLists, 
                                        minMeasure, prefMeasure, prefMeasure);

        int[] groupedMinSizes  = groupedSizes(groupIndices, minSizes);
        int[] groupedPrefSizes = groupedSizes(groupIndices, prefSizes);
        int   totalMinSize     = sum(groupedMinSizes);
        int   totalPrefSize    = sum(groupedPrefSizes);
        int[] compressedSizes  = compressedSizes(formSpecs, 
                                               totalSize, 
                                               totalMinSize,  
                                               totalPrefSize,  
                                               groupedMinSizes,  
                                               prefSizes);
        int[] groupedSizes     = groupedSizes(groupIndices, compressedSizes);
        int   totalGroupedSize = sum(groupedSizes);
        int[] sizes            = distributedSizes(formSpecs, 
                                                 totalSize, 
                                                 totalGroupedSize,  
                                                 groupedSizes);
        return computeOrigins(sizes, offset);
    }


Generated by  Doxygen 1.6.0   Back to index