/*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is the Flex4Wizard component.
*
* The Initial Developer of the Original Code is
* Anirudh Sasikumar (http://anirudhs.chaosnet.org/).
* Portions created by the Initial Developer are Copyright (C) 2008
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
*/
package net.anirudh.wizard.skins
{
    import mx.skins.Border;
    import mx.styles.StyleManager;
    import mx.utils.ColorUtil;

    public class ProgressTrackSkin extends Border
    {
        public function ProgressTrackSkin()
        {
            super();
        }
        
    //----------------------------------
    //  measuredWidth
    //----------------------------------
    
    /**
     *  @private
     */
    override public function get measuredWidth():Number
    {
        return 200;
    }
    
    //----------------------------------
    //  measuredHeight
    //----------------------------------

    /**
     *  @private
     */
        
    override public function get measuredHeight():Number
    {
        return 34;
    }

    //--------------------------------------------------------------------------
    //
    //  Overridden methods
    //
    //--------------------------------------------------------------------------
        
    override protected function updateDisplayList(w:Number, h:Number):void
    {
        super.updateDisplayList(w, h);
        
        // User-defined styles
        var borderColor:uint = getStyle("borderColor");
        var fillColors:Array = getStyle("trackColors") as Array;
        StyleManager.getColorNames(fillColors);
        
        // ProgressTrack-unique styles
        var borderColorDrk1:Number =
            ColorUtil.adjustBrightness2(borderColor, -30);
        
        graphics.clear();
        
        /*drawRoundRect(
            0, 0, w, h, 0, 
            [ borderColorDrk1, borderColor ], 1,
            verticalGradientMatrix(0, 0, w, h));
        
        drawRoundRect(
            1, 1, w - 2, h - 2, 0,
            fillColors, 1,
            verticalGradientMatrix(1, 1, w - 2, h - 2));*/
    }

        
        
    }
}