 
 package spark.layouts
 {
+import mx.containers.utilityClasses.ConstraintColumn;
+import mx.containers.utilityClasses.Flex;
 import mx.core.ILayoutElement;
 import mx.core.mx_internal;
 
-import spark.components.Form;
 import spark.components.supportClasses.GroupBase;
 import spark.components.supportClasses.SkinnableComponent;
 import spark.layouts.supportClasses.LayoutBase;

     */
    public function getMeasuredColumnWidths():Vector.<Number>
    {
        calculateColumnMaxWidths();
        return columnMaxWidths;
    }
    
    /**

 */
public class FormLayout extends VerticalLayout
{
    //--------------------------------------------------------------------------
    //
    //  Class methods
    //
    //--------------------------------------------------------------------------
    
    /**
     *  @private
     *  Return the sum of all of the column widths
     */
    private static function calculateColumnWidthsSum(columnWidths:Vector.<Number>):Number
    {
        if (columnWidths == null)
            return 0;
        
        var sum:Number = 0;
        var columnWidthsLength:int = columnWidths.length;
        for (var i:int = 0; i < columnWidthsLength; i++)
        {
            sum += columnWidths[i];
        }
        
        return sum;
    }
    
    /**
     *  @private
     *  Look for the layout property of several known types. 
     *  For Form, we want the content layout. 
     *  For SkinnableComponent, we want the skin's layout. 
     *  For GroupBase, we get the layout (it has no skin).
     *  If that layout is an IFormItemLayout, then it will
     *  participate in the FormLayout's column alignment
     */ 
    private static function getElementLayout(elt:ILayoutElement):LayoutBase
    {
        var layout:LayoutBase = null;
        
        if (elt is SkinnableComponent)
        {
            var skin:GroupBase = SkinnableComponent(elt).skin as GroupBase;
            if (skin)
                layout = skin.layout;
        }
        else if (elt is GroupBase)
        {
            layout = GroupBase(elt).layout;
        }
        
        return layout;
    }
    
    /**
     *  @private
     *  Returns a vector containing the layout elements that have a FormItemLayout and
     *  thus are participating in the Form's column alignment step.
     */ 
    private static function getFormItems(layoutTarget:GroupBase):Vector.<ILayoutElement>
    {
        if (!layoutTarget)
            return new Vector.<ILayoutElement>();
        
        const nElts:int = layoutTarget.numElements;
        var elt:ILayoutElement;
        var formItems:Vector.<ILayoutElement> = new Vector.<ILayoutElement>();
        
        for (var i:int = 0; i < nElts; i++)
        {
            elt = layoutTarget.getElementAt(i);
            if (!elt.includeInLayout)
                continue;
            
            if (getElementLayout(elt) is FormItemLayout)
                formItems.push(elt);
        }
        
        return formItems;
    }
    
    //--------------------------------------------------------------------------
    //
    //  Constructor
    //
    //--------------------------------------------------------------------------
    
    /**
     *  Constructor.
     *  
