refactor EditController to make it stateful, and add addWayNodes functionality with...
[potlatch2.git] / net / systemeD / halcyon / connection / Connection.as
index 965d12f8da73196e6950a58a390e386bccbf604b..f7d48d5d1dbf25a42e94eb9f839b495ab5d22a4b 100755 (executable)
@@ -61,6 +61,8 @@ package net.systemeD.halcyon.connection {
         public static var NEW_POI:String = "new_poi";
         public static var TAG_CHANGE:String = "tag_change";
         public static var NODE_MOVED:String = "node_moved";
+        public static var WAY_NODE_ADDED:String = "way_node_added";
+        public static var WAY_NODE_REMOVED:String = "way_node_removed";
 
         // store the data we download
         private var negativeID:Number = -1;
@@ -89,6 +91,21 @@ package net.systemeD.halcyon.connection {
             if (relation.loaded) { sendEvent(new EntityEvent(NEW_RELATION, relation)); }
         }
 
+        protected function renumberNode(oldID:Number, node:Node):void {
+            nodes[node.id] = node;
+            delete nodes[oldID];
+        }
+
+        protected function renumberWay(oldID:Number, way:Way):void {
+            ways[way.id] = way;
+            delete ways[oldID];
+        }
+
+        protected function renumberRelation(oldID:Number, relation:Relation):void {
+            relations[relation.id] = relation;
+            delete relations[oldID];
+        }
+
                public function sendEvent(e:*):void {
                        dispatchEvent(e);
                }