Merge branch 'master' of github.com:systemed/potlatch2
[potlatch2.git] / net / systemeD / potlatch2 / mapfeatures / editors / TurnRestrictionRenderer.mxml
1 <?xml version="1.0" encoding="utf-8"?>
2 <mx:Canvas
3         xmlns:fx="http://ns.adobe.com/mxml/2009"
4         xmlns:mx="library://ns.adobe.com/flex/mx"
5         xmlns:edit="net.systemeD.potlatch2.mapfeatures.editors.*"
6         width="40" height="40" maxWidth="40" maxHeight="40" minWidth="40" minHeight="40"
7         mouseEnabled="false" mouseChildren="false">
8
9         <mx:Image x="0" y="0" id="sign" left="4" top="4" source="{iconSource()}" toolTip="{dataProxied.label}" />
10
11   <fx:Script><![CDATA[
12
13         import mx.utils.ObjectProxy;
14     import net.systemeD.halcyon.FileBank;
15
16         [Bindable(event="dataChange")] public function iconSource():* {
17                 var d:String=dataProxied.data; if (!d) return '';
18                 var fn:String="features/restriction__"+d+".png";
19                 var fb:FileBank=FileBank.getInstance();
20                 return fb.hasFile(fn) ? fb.getAsByteArray(fn) : fn;
21         }
22
23         [Bindable(event="dataChange")] public function get dataProxied():ObjectProxy {
24                 return new ObjectProxy(data);
25         }
26
27   ]]></fx:Script>
28         
29 </mx:Canvas>
30