First basics of a background tag merging panel
authorAndy Allan <andy@gravitystorm.co.uk>
Fri, 1 Jul 2011 14:36:09 +0000 (15:36 +0100)
committerAndy Allan <andy@gravitystorm.co.uk>
Fri, 1 Jul 2011 14:36:09 +0000 (15:36 +0100)
net/systemeD/potlatch2/TagViewer.mxml
net/systemeD/potlatch2/panels/BackgroundMergePanel.mxml [new file with mode: 0644]

index 2e6d8f1..fdc0ba6 100644 (file)
     <sidepanel:BackgroundPanel id="backgroundPanelContents" width="100%"/>
   </mx:VBox>
 
+  <!-- merge tags from background layer -->
+
+  <mx:VBox id="backgroundMergePanel" width="100%" height="100%" horizontalScrollPolicy="off" styleName="dndPanelVbox">
+    <sidepanel:BackgroundMergePanel id="backgroundMergePanelContents" width="100%" />
+  </mx:VBox>
+
 </mx:ViewStack>
 
   <mx:Script><![CDATA[
               sidebar.selectedChild = tagsPanel;
             }
 
+        } else if (entities.length==2
+                      && xor(entities[0].connection is SnapshotConnection, entities[1].connection is SnapshotConnection)
+                      && xor(!controller.map.getLayerForEntity(entities[0]).isBackground, !controller.map.getLayerForEntity(entities[1]).isBackground) ) {
+            //backgroundMergePanel.init(entities, layer)
+            sidebar.selectedChild = backgroundMergePanel;
+
                } else if(isMultipleEditable(entities)) {
                        selectedEntity = new EntityCollection(entities);
                        selectedEntity.addEventListener(Connection.TAG_CHANGED, tagChanged);
                UIComponent.resumeBackgroundProcessing();
       }
 
+      private function xor(a:Boolean, b:Boolean):Boolean {
+          return ( a || b) && !(a && b);
+      }
+
       private function refreshFeatureIcon():void {
           var oldFeature:Feature = feature;
           feature = selectedEntity == null ? null : mapFeatures.findMatchingFeature(selectedEntity);
diff --git a/net/systemeD/potlatch2/panels/BackgroundMergePanel.mxml b/net/systemeD/potlatch2/panels/BackgroundMergePanel.mxml
new file mode 100644 (file)
index 0000000..a5de13f
--- /dev/null
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<!--
+    Background Merge Panel
+-->
+
+<mx:VBox xmlns:mx="http://www.adobe.com/2006/mxml" height="100%">
+  <mx:Text id="backgroundMergePanelText" text="W00t!!!" width="100%" styleName="helpInfo" />
+</mx:VBox>
\ No newline at end of file