Fix compiler problem with ambiguous VideoEvent
[potlatch2.git] / net / systemeD / potlatch2 / panels / BackgroundPanel.mxml
1 <?xml version="1.0" encoding="utf-8"?>
2
3 <!--
4     Background Panel
5 -->
6
7 <mx:VBox
8     xmlns:fx="http://ns.adobe.com/mxml/2009"
9     xmlns:mx="library://ns.adobe.com/flex/mx"
10     height="100%">
11   <mx:Text id="backgroundPanelText" text="You have selected a Background Feature." width="100%" styleName="helpInfo" />
12   <mx:DataGrid editable="false" id="backgroundPanelDG" width="100%" height="50%">
13     <mx:columns>
14       <mx:DataGridColumn editable="false" dataField="key" headerText="key" />
15       <mx:DataGridColumn editable="false" dataField="value" headerText="value" />
16     </mx:columns>
17   </mx:DataGrid>
18   <mx:Text text="All the data copied to the main layer? Click 'complete'!" />
19   <mx:Button label="Complete" click="markComplete()"/>
20   <fx:Script><![CDATA[
21
22       import net.systemeD.halcyon.connection.*;
23       import net.systemeD.halcyon.MapPaint;
24       import net.systemeD.potlatch2.utils.SnapshotConnection;
25       import mx.collections.*;
26
27       private var selectedEntity:Entity;
28       private var tagDataProvider:ArrayCollection;
29       private var layer:MapPaint;
30
31       public function init(entity:Entity, layer:MapPaint):void {
32             this.layer = layer;
33             if ( tagDataProvider == null ) {
34                 tagDataProvider = new ArrayCollection();
35                 backgroundPanelDG.dataProvider = tagDataProvider;
36             }
37
38             selectedEntity=entity;
39             updateTagDataProvider();
40       }
41
42       private function updateTagDataProvider():void {
43             tagDataProvider.removeAll();
44             if (selectedEntity==null) { return; }
45             var tags:Array = selectedEntity.getTagArray();
46             tags.sortOn("key");
47             for each(var tag:Tag in tags) { tagDataProvider.addItem(tag); }
48       }
49
50       private function markComplete():void {
51             if (selectedEntity.connection is SnapshotConnection) {
52                 SnapshotConnection(selectedEntity.connection).markComplete(selectedEntity);
53             }
54       }
55       ]]>
56   </fx:Script>
57 </mx:VBox>