1 <?xml version="1.0" encoding="utf-8"?>
8 xmlns:fx="http://ns.adobe.com/mxml/2009"
9 xmlns:mx="library://ns.adobe.com/flex/mx"
10 xmlns:s="library://ns.adobe.com/flex/spark"
12 <s:RichText id="backgroundPanelText" text="You have selected a Background Feature." />
13 <s:RichText text="{connectionName}" />
14 <mx:DataGrid editable="false" id="backgroundPanelDG" width="100%" height="50%">
16 <mx:DataGridColumn editable="false" dataField="key" headerText="key" />
17 <mx:DataGridColumn editable="false" dataField="value" headerText="value" />
20 <mx:ViewStack id="statusStack" resizeToContent="true" width="100%">
21 <mx:VBox id="empty" />
22 <mx:VBox id="not_complete">
23 <s:RichText text="All the data copied to the main layer? Click 'complete'!" />
24 <mx:Button label="Complete" click="markComplete()"/>
26 <mx:VBox id="complete">
27 <s:RichText text="This feature has been marked as complete. If this is wrong, press the button below." />
28 <mx:Button label="Not complete" click="markNotComplete()"/>
33 import net.systemeD.halcyon.connection.*;
34 import net.systemeD.potlatch2.utils.SnapshotConnection;
35 import mx.collections.*;
37 private var selectedEntity:Entity;
38 private var tagDataProvider:ArrayCollection;
40 private var connectionName:String;
42 public function init(entity:Entity):void {
43 if ( tagDataProvider == null ) {
44 tagDataProvider = new ArrayCollection();
45 backgroundPanelDG.dataProvider = tagDataProvider;
48 selectedEntity=entity;
49 selectedEntity.addEventListener(Connection.STATUS_CHANGED, statusEvent, false, 0, true);
50 connectionName = selectedEntity.connection.name;
52 updateTagDataProvider();
55 private function updateTagDataProvider():void {
56 tagDataProvider.removeAll();
57 if (selectedEntity==null) { return; }
58 var tags:Array = selectedEntity.getTagArray();
60 for each(var tag:Tag in tags) { tagDataProvider.addItem(tag); }
63 private function statusEvent(e:Event):void {
67 private function setStatusStack():void {
68 switch (selectedEntity.status) {
70 statusStack.selectedChild = not_complete;
73 statusStack.selectedChild = complete;
76 statusStack.selectedChild = empty;
80 private function markComplete():void {
81 if (selectedEntity.connection is SnapshotConnection) {
82 SnapshotConnection(selectedEntity.connection).markComplete(selectedEntity);
86 private function markNotComplete():void {
87 if (selectedEntity.connection is SnapshotConnection) {
88 SnapshotConnection(selectedEntity.connection).markNotComplete(selectedEntity);