1 | ////////////////////////////////////////////////////////////////////////////////
|
---|
2 | //
|
---|
3 | // ADOBE SYSTEMS INCORPORATED
|
---|
4 | // Copyright 2003-2007 Adobe Systems Incorporated
|
---|
5 | // All Rights Reserved.
|
---|
6 | //
|
---|
7 | // NOTICE: Adobe permits you to use, modify, and distribute this file
|
---|
8 | // in accordance with the terms of the license agreement accompanying it.
|
---|
9 | //
|
---|
10 | ////////////////////////////////////////////////////////////////////////////////
|
---|
11 |
|
---|
12 | package gov.va.med.edp.skins
|
---|
13 | {
|
---|
14 |
|
---|
15 | import mx.core.EdgeMetrics;
|
---|
16 | import mx.core.UIComponent;
|
---|
17 | import mx.skins.Border;
|
---|
18 | import mx.styles.StyleManager;
|
---|
19 | import mx.utils.ColorUtil;
|
---|
20 |
|
---|
21 | /**
|
---|
22 | * The skin for all the states of a Tab in a TabNavigator or TabBar.
|
---|
23 | */
|
---|
24 | public class LinkButtonTabSkin extends Border
|
---|
25 | {
|
---|
26 | /**
|
---|
27 | * @private
|
---|
28 | * Storage for the borderMetrics property.
|
---|
29 | */
|
---|
30 | private var _borderMetrics:EdgeMetrics = EdgeMetrics.EMPTY;
|
---|
31 |
|
---|
32 | /**
|
---|
33 | * @private
|
---|
34 | */
|
---|
35 | override public function get borderMetrics():EdgeMetrics
|
---|
36 | {
|
---|
37 | return _borderMetrics;
|
---|
38 | }
|
---|
39 |
|
---|
40 | //----------------------------------
|
---|
41 | // measuredWidth
|
---|
42 | //----------------------------------
|
---|
43 |
|
---|
44 | /**
|
---|
45 | * @private
|
---|
46 | */
|
---|
47 | override public function get measuredWidth():Number
|
---|
48 | {
|
---|
49 | return UIComponent.DEFAULT_MEASURED_MIN_WIDTH;
|
---|
50 | }
|
---|
51 |
|
---|
52 | //----------------------------------
|
---|
53 | // measuredHeight
|
---|
54 | //----------------------------------
|
---|
55 |
|
---|
56 | /**
|
---|
57 | * @private
|
---|
58 | */
|
---|
59 | override public function get measuredHeight():Number
|
---|
60 | {
|
---|
61 | return UIComponent.DEFAULT_MEASURED_MIN_HEIGHT;
|
---|
62 | }
|
---|
63 |
|
---|
64 | /**
|
---|
65 | * @private
|
---|
66 | */
|
---|
67 | override protected function updateDisplayList(w:Number, h:Number):void
|
---|
68 | {
|
---|
69 | super.updateDisplayList(w, h);
|
---|
70 |
|
---|
71 | // User-defined styles.
|
---|
72 | var rollOverColor:uint = getStyle("rollOverColor");
|
---|
73 | var cornerRadius:Number = getStyle("cornerRadius");
|
---|
74 | var selectionColor:uint = getStyle("selectionColor");
|
---|
75 |
|
---|
76 | graphics.clear();
|
---|
77 |
|
---|
78 | switch (name)
|
---|
79 | {
|
---|
80 | case "upSkin":
|
---|
81 | {
|
---|
82 | // Draw invisible shape so we have a hit area.
|
---|
83 | drawRoundRect(
|
---|
84 | 0, 0, w, h, cornerRadius,
|
---|
85 | 0, 0);
|
---|
86 | break;
|
---|
87 | }
|
---|
88 |
|
---|
89 | case "overSkin":
|
---|
90 | {
|
---|
91 | drawRoundRect(
|
---|
92 | 0, 0, w, h, cornerRadius,
|
---|
93 | rollOverColor, 1);
|
---|
94 | break;
|
---|
95 | }
|
---|
96 |
|
---|
97 | case "disabledSkin":
|
---|
98 | {
|
---|
99 | // Draw invisible shape so we have a hit area.
|
---|
100 | drawRoundRect(
|
---|
101 | 0, 0, w, h, cornerRadius,
|
---|
102 | 0, 0);
|
---|
103 | break;
|
---|
104 | }
|
---|
105 | case "selectedDownSkin":
|
---|
106 | case "downSkin":
|
---|
107 | {
|
---|
108 | drawRoundRect(
|
---|
109 | 0, 0, w, h, cornerRadius,
|
---|
110 | selectionColor, 1);
|
---|
111 | break;
|
---|
112 | }
|
---|
113 | case "selectedUpSkin":
|
---|
114 | case "selectedOverSkin":
|
---|
115 | case "selectedDisabledSkin":
|
---|
116 | {
|
---|
117 | drawRoundRect(
|
---|
118 | 0, 0, w, h, cornerRadius,
|
---|
119 | 0, 0);
|
---|
120 | break;
|
---|
121 | }
|
---|
122 | }
|
---|
123 | }
|
---|
124 |
|
---|
125 | }
|
---|
126 |
|
---|
127 | }
|
---|