[fusion-commits] r2109 - sandbox/adsk/2.2gp/widgets

svn_fusion at osgeo.org svn_fusion at osgeo.org
Thu Mar 25 04:23:36 EDT 2010


Author: liuar
Date: 2010-03-25 04:23:34 -0400 (Thu, 25 Mar 2010)
New Revision: 2109

Modified:
   sandbox/adsk/2.2gp/widgets/Measure.js
   sandbox/adsk/2.2gp/widgets/Redline.js
   sandbox/adsk/2.2gp/widgets/Select.js
   sandbox/adsk/2.2gp/widgets/SelectPolygon.js
   sandbox/adsk/2.2gp/widgets/SelectRadius.js
Log:
Submit on behalf of Buddy Hu.
Roll back the fix of Ticket #355 in GrandPrix branch.


Modified: sandbox/adsk/2.2gp/widgets/Measure.js
===================================================================
--- sandbox/adsk/2.2gp/widgets/Measure.js	2010-03-25 01:57:32 UTC (rev 2108)
+++ sandbox/adsk/2.2gp/widgets/Measure.js	2010-03-25 08:23:34 UTC (rev 2109)
@@ -371,7 +371,8 @@
         this.resetMeasure();
         OpenLayers.Event.observe(document,"keypress",this.keyHandler);
         this.loadDisplayPanel();
-        this.getMap().supressContextMenu(true);
+        //roll back this in GrandPrix branch
+        //this.getMap().supressContextMenu(true);
     },
     
     loadDisplayPanel: function() {
@@ -420,7 +421,8 @@
         OpenLayers.Event.stopObserving(document, 'keypress', this.keyHandler);           
         this.control.deactivate();
         this.control.cancel();
-        this.getMap().supressContextMenu(false);
+        //roll back this in GrandPrix branch
+        //this.getMap().supressContextMenu(false);
     },
     
     resetMeasure: function() {

Modified: sandbox/adsk/2.2gp/widgets/Redline.js
===================================================================
--- sandbox/adsk/2.2gp/widgets/Redline.js	2010-03-25 01:57:32 UTC (rev 2108)
+++ sandbox/adsk/2.2gp/widgets/Redline.js	2010-03-25 08:23:34 UTC (rev 2109)
@@ -45,10 +45,10 @@
     // a reference to a redline taskPane
     taskPane: null,
 
-    // array of OL vector layer
-    vectorLayers: null,
-
-    // the default layer name
+    // array of OL vector layer
+    vectorLayers: null,
+
+    // the default layer name
     defaultLayerName: null,
 
     // the drawing controls
@@ -75,9 +75,9 @@
     saveForm: null,
 
     initializeWidget: function(widgetTag) {
-        var json = widgetTag.extension;
-        this.mapWidget = Fusion.getWidgetById('Map');
-
+        var json = widgetTag.extension;
+        this.mapWidget = Fusion.getWidgetById('Map');
+
         this.defaultLayerName = OpenLayers.i18n('redlineLayerName');
 
         // register Redline specific events
@@ -102,10 +102,10 @@
  
         this.styleMap = new OpenLayers.StyleMap(defaultFeatureStyle);
         
-        // create one default layer, unless other redline widgets have created it
+        // create one default layer, unless other redline widgets have created it
         this.vectorLayers = this.mapWidget.oMapOL.getLayersByName(this.defaultLayerName + '0');
     
-        if (!this.vectorLayers.length) {
+        if (!this.vectorLayers.length) {
             this.vectorLayers[0] = new OpenLayers.Layer.Vector(this.defaultLayerName + '0', { styleMap: this.styleMap });
             this.vectorLayers[0].redLineLayer = true;
             this.mapWidget.oMapOL.addLayers([this.vectorLayers[0]]);
@@ -214,14 +214,16 @@
         }
         this.activateLayer(0);
         this.activateControl(this.defaultControl,0);
-        this.getMap().supressContextMenu(true);
+        //roll back this in GrandPrix branch
+        //this.getMap().supressContextMenu(true);
     },
 
     // desactivate the redline widget
     deactivate: function() {
         this.activeControl.deactivate();
         this.activeControl = null;
-        this.getMap().supressContextMenu(false);
+        //roll back this in GrandPrix branch
+        //this.getMap().supressContextMenu(false);
     },
    
     featureAdded: function(evt) {
@@ -277,7 +279,7 @@
     },
     
     newLayerFromFile: function(fileName) {
-        var i = this.vectorLayers.length;
+        var i = this.vectorLayers.length;
         this.vectorLayers[i] = new OpenLayers.Layer.Vector(this.defaultLayerName + this.vectorLayers.length, {
             strategies: [new OpenLayers.Strategy.Fixed()],
             protocol: new OpenLayers.Protocol.HTTP({
@@ -295,29 +297,29 @@
         this.vectorLayers[layerIndex].destroy();
         this.vectorLayers.splice(layerIndex,1);
         // we always keep at least one vector layer
-        if (this.vectorLayers.length == 0) {
+        if (this.vectorLayers.length == 0) {
             this.vectorLayers[0] = new OpenLayers.Layer.Vector(this.defaultLayerName + '0', { styleMap: this.styleMap });
             this.mapWidget.oMapOL.addLayers([this.vectorLayers[0]]);
             this.vectorLayers[0].redLineLayer = true;
         }
         this.activateLayer(0);
-    },
-
-    getUniqueLayerName: function() {
-        var offset = this.vectorLayers.length;
-        var exist = true;
-        while (exist) {
-            exist = false;
-            var i = 0;
-            while (!exist && i < this.vectorLayers.length) {
-                if ((this.defaultLayerName + offset) == this.vectorLayers[i].name)
-                    exist = true;
-                i++;
-            }
-            if (exist)
-                offset++;
-        }
-        return this.defaultLayerName + offset;
+    },
+
+    getUniqueLayerName: function() {
+        var offset = this.vectorLayers.length;
+        var exist = true;
+        while (exist) {
+            exist = false;
+            var i = 0;
+            while (!exist && i < this.vectorLayers.length) {
+                if ((this.defaultLayerName + offset) == this.vectorLayers[i].name)
+                    exist = true;
+                i++;
+            }
+            if (exist)
+                offset++;
+        }
+        return this.defaultLayerName + offset;
     }
 });
 
@@ -401,7 +403,7 @@
         doc.getElementById("RedlineWidgetRenameFeatureButton").onclick = OpenLayers.Function.bind(this.renameFeature, this);
     },
 
-    newLayer: function() {
+    newLayer: function() {
         var name = prompt("Layer name:", this.widget.getUniqueLayerName());
         if (name!=null && name!="") {
             this.widget.newLayer(name);

Modified: sandbox/adsk/2.2gp/widgets/Select.js
===================================================================
--- sandbox/adsk/2.2gp/widgets/Select.js	2010-03-25 01:57:32 UTC (rev 2108)
+++ sandbox/adsk/2.2gp/widgets/Select.js	2010-03-25 08:23:34 UTC (rev 2109)
@@ -110,7 +110,8 @@
         this.handler.activate();
         //this.shiftHandler.activate();
         this.getMap().setCursor(this.asCursor);
-        this.getMap().supressContextMenu(true);
+        //roll back this in GrandPrix branch
+        //this.getMap().supressContextMenu(true);
     },
 
     /**
@@ -122,7 +123,8 @@
         this.handler.deactivate();
         //this.shiftHandler.deactivate();
         this.getMap().setCursor('auto');
-        this.getMap().supressContextMenu(false);
+        //roll back this in GrandPrix branch
+        //this.getMap().supressContextMenu(false);
     },
 
     /**

Modified: sandbox/adsk/2.2gp/widgets/SelectPolygon.js
===================================================================
--- sandbox/adsk/2.2gp/widgets/SelectPolygon.js	2010-03-25 01:57:32 UTC (rev 2108)
+++ sandbox/adsk/2.2gp/widgets/SelectPolygon.js	2010-03-25 08:23:34 UTC (rev 2109)
@@ -65,7 +65,8 @@
     activate: function() {
         this.handler.activate();
         this.getMap().setCursor(this.asCursor);
-        this.getMap().supressContextMenu(true);
+        //roll back this in GrandPrix branch
+        //this.getMap().supressContextMenu(true);
     },
 
     /**
@@ -77,7 +78,8 @@
     {
         this.handler.deactivate();
         this.getMap().setCursor('auto');
-        this.getMap().supressContextMenu(false);
+        //roll back this in GrandPrix branch
+        //this.getMap().supressContextMenu(false);
     },
     
     /**

Modified: sandbox/adsk/2.2gp/widgets/SelectRadius.js
===================================================================
--- sandbox/adsk/2.2gp/widgets/SelectRadius.js	2010-03-25 01:57:32 UTC (rev 2108)
+++ sandbox/adsk/2.2gp/widgets/SelectRadius.js	2010-03-25 08:23:34 UTC (rev 2109)
@@ -113,7 +113,8 @@
         this.getMap().setCursor(this.asCursor);
         /*map units for tool tip*/
         this.units = this.getMap().getAllMaps()[0].units;
-        this.getMap().supressContextMenu(true);
+        //roll back this in GrandPrix branch
+        //this.getMap().supressContextMenu(true);
         this.triggerEvent(Fusion.Event.RADIUS_WIDGET_ACTIVATED, true);
     },
 
@@ -125,7 +126,8 @@
     deactivate: function() {
         this.handler.deactivate();
         this.getMap().setCursor('auto');
-        this.getMap().supressContextMenu(false);
+        //roll back this in GrandPrix branch
+        //this.getMap().supressContextMenu(false);
         /*icon button*/
         this.triggerEvent(Fusion.Event.RADIUS_WIDGET_ACTIVATED, false);
     },



More information about the fusion-commits mailing list