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" width="100%">
23 <s:VGroup width="100%">
24 <s:RichText width="100%">If all the information from this feature is accounted for in the main layer, you can mark this feature as 'complete'.</s:RichText>
25 <s:RichText width="100%">This lets other contributors see what still needs reconciling.</s:RichText>
26 <mx:Button label="Mark feature as Complete" click="markComplete()"/>
29 <mx:VBox id="complete" width="100%">
30 <s:VGroup width="100%">
31 <s:RichText width="100%">This feature has been marked as 'complete'. If this is incorrect, and there is still reconciling required, you can mark this feature as 'not complete'.</s:RichText>
32 <mx:Button label="Mark feature as Not complete" click="markNotComplete()"/>
38 import net.systemeD.halcyon.connection.*;
39 import net.systemeD.potlatch2.utils.SnapshotConnection;
40 import mx.collections.*;
42 private var selectedEntity:Entity;
43 private var tagDataProvider:ArrayCollection;
45 private var connectionName:String;
47 public function init(entity:Entity):void {
48 if ( tagDataProvider == null ) {
49 tagDataProvider = new ArrayCollection();
50 backgroundPanelDG.dataProvider = tagDataProvider;
53 selectedEntity=entity;
54 selectedEntity.addEventListener(Connection.STATUS_CHANGED, statusEvent, false, 0, true);
55 connectionName = selectedEntity.connection.name;
57 updateTagDataProvider();
60 private function updateTagDataProvider():void {
61 tagDataProvider.removeAll();
62 if (selectedEntity==null) { return; }
63 var tags:Array = selectedEntity.getTagArray();
65 for each(var tag:Tag in tags) { tagDataProvider.addItem(tag); }
68 private function statusEvent(e:Event):void {
72 private function setStatusStack():void {
73 switch (selectedEntity.status) {
75 statusStack.selectedChild = not_complete;
78 statusStack.selectedChild = complete;
81 statusStack.selectedChild = empty;
85 private function markComplete():void {
86 if (selectedEntity.connection is SnapshotConnection) {
87 SnapshotConnection(selectedEntity.connection).markComplete(selectedEntity);
91 private function markNotComplete():void {
92 if (selectedEntity.connection is SnapshotConnection) {
93 SnapshotConnection(selectedEntity.connection).markNotComplete(selectedEntity);