//////////////////////////////////////////////////////////////////////////////// // // ADOBE SYSTEMS INCORPORATED // Copyright 2003-2007 Adobe Systems Incorporated // All Rights Reserved. // // NOTICE: Adobe permits you to use, modify, and distribute this file // in accordance with the terms of the license agreement accompanying it. // //////////////////////////////////////////////////////////////////////////////// package gov.va.med.edp.skins { import mx.core.EdgeMetrics; import mx.core.UIComponent; import mx.skins.Border; import mx.styles.StyleManager; import mx.utils.ColorUtil; /** * The skin for all the states of a Tab in a TabNavigator or TabBar. */ public class LinkButtonTabSkin extends Border { /** * @private * Storage for the borderMetrics property. */ private var _borderMetrics:EdgeMetrics = EdgeMetrics.EMPTY; /** * @private */ override public function get borderMetrics():EdgeMetrics { return _borderMetrics; } //---------------------------------- // measuredWidth //---------------------------------- /** * @private */ override public function get measuredWidth():Number { return UIComponent.DEFAULT_MEASURED_MIN_WIDTH; } //---------------------------------- // measuredHeight //---------------------------------- /** * @private */ override public function get measuredHeight():Number { return UIComponent.DEFAULT_MEASURED_MIN_HEIGHT; } /** * @private */ override protected function updateDisplayList(w:Number, h:Number):void { super.updateDisplayList(w, h); // User-defined styles. var rollOverColor:uint = getStyle("rollOverColor"); var cornerRadius:Number = getStyle("cornerRadius"); var selectionColor:uint = getStyle("selectionColor"); graphics.clear(); switch (name) { case "upSkin": { // Draw invisible shape so we have a hit area. drawRoundRect( 0, 0, w, h, cornerRadius, 0, 0); break; } case "overSkin": { drawRoundRect( 0, 0, w, h, cornerRadius, rollOverColor, 1); break; } case "disabledSkin": { // Draw invisible shape so we have a hit area. drawRoundRect( 0, 0, w, h, cornerRadius, 0, 0); break; } case "selectedDownSkin": case "downSkin": { drawRoundRect( 0, 0, w, h, cornerRadius, selectionColor, 1); break; } case "selectedUpSkin": case "selectedOverSkin": case "selectedDisabledSkin": { drawRoundRect( 0, 0, w, h, cornerRadius, 0, 0); break; } } } } }