Rev | Line | |
---|
[1227] | 1 | <?xml version="1.0" encoding="utf-8"?>
|
---|
| 2 | <mx:Label
|
---|
| 3 | xmlns:mx="http://www.adobe.com/2006/mxml" >
|
---|
| 4 |
|
---|
| 5 | <mx:Script>
|
---|
| 6 | <![CDATA[
|
---|
| 7 | import gov.va.med.edp.vo.ColorSelectionVO;
|
---|
| 8 |
|
---|
| 9 | private var _data: Object;
|
---|
| 10 |
|
---|
| 11 | override public function set data(value: Object): void {
|
---|
| 12 | super.data = value;
|
---|
| 13 |
|
---|
| 14 | if (value != null) {
|
---|
| 15 | var color: ColorSelectionVO = value["color"] as ColorSelectionVO;
|
---|
| 16 | if (color == null) return;
|
---|
| 17 |
|
---|
| 18 | setStyle("color", color.text);
|
---|
| 19 | if (color.ignore) {
|
---|
| 20 | this.text = "Color not used"
|
---|
| 21 | } else {
|
---|
| 22 | this.text = "Sample Color"
|
---|
| 23 | }
|
---|
| 24 | }
|
---|
| 25 | }
|
---|
| 26 |
|
---|
| 27 | override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
|
---|
| 28 | {
|
---|
| 29 | super.updateDisplayList(unscaledWidth, unscaledHeight);
|
---|
| 30 |
|
---|
| 31 | if (data != null) {
|
---|
| 32 | var color: ColorSelectionVO = data["color"];
|
---|
| 33 | if (color == null) return;
|
---|
| 34 |
|
---|
| 35 | var g:Graphics = graphics;
|
---|
| 36 | g.clear();
|
---|
| 37 | g.beginFill(color.back);
|
---|
| 38 | g.drawRect(0, 0, unscaledWidth, unscaledHeight);
|
---|
| 39 | g.endFill();
|
---|
| 40 | }
|
---|
| 41 | }
|
---|
| 42 | ]]>
|
---|
| 43 | </mx:Script>
|
---|
| 44 | </mx:Label>
|
---|
Note:
See
TracBrowser
for help on using the repository browser.