[mapguide-commits] r6163 - in trunk/Tools/Maestro: Maestro.AddIn.Local Maestro.Editors/LayerDefinition Maestro.Editors/WebLayout/Commands OSGeo.MapGuide.MaestroAPI/ObjectModels OSGeo.MapGuide.MaestroAPI.Local

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Tue Oct 4 02:04:59 EDT 2011


Author: jng
Date: 2011-10-03 23:04:59 -0700 (Mon, 03 Oct 2011)
New Revision: 6163

Modified:
   trunk/Tools/Maestro/Maestro.AddIn.Local/ACE.dll
   trunk/Tools/Maestro/Maestro.AddIn.Local/GEOS.dll
   trunk/Tools/Maestro/Maestro.AddIn.Local/MapGuideDesktopUnmanagedApi.dll
   trunk/Tools/Maestro/Maestro.AddIn.Local/MgDesktop.dll
   trunk/Tools/Maestro/Maestro.AddIn.Local/MgFoundation.dll
   trunk/Tools/Maestro/Maestro.AddIn.Local/MgGeometry.dll
   trunk/Tools/Maestro/Maestro.AddIn.Local/MgGwsCommon.dll
   trunk/Tools/Maestro/Maestro.AddIn.Local/MgGwsQueryEngine.dll
   trunk/Tools/Maestro/Maestro.AddIn.Local/MgGwsResource.dll
   trunk/Tools/Maestro/Maestro.AddIn.Local/MgMdfModel.dll
   trunk/Tools/Maestro/Maestro.AddIn.Local/MgMdfParser.dll
   trunk/Tools/Maestro/Maestro.AddIn.Local/MgPlatformBase.dll
   trunk/Tools/Maestro/Maestro.AddIn.Local/MgRenderers.dll
   trunk/Tools/Maestro/Maestro.AddIn.Local/MgStylization.dll
   trunk/Tools/Maestro/Maestro.AddIn.Local/OSGeo.MapGuide.Desktop.dll
   trunk/Tools/Maestro/Maestro.AddIn.Local/OSGeo.MapGuide.Viewer.dll
   trunk/Tools/Maestro/Maestro.AddIn.Local/gd.dll
   trunk/Tools/Maestro/Maestro.AddIn.Local/xerces-c_3_1mg.dll
   trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/LayerPropertiesSectionCtrl.Designer.cs
   trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/LayerPropertiesSectionCtrl.cs
   trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/LayerPropertiesSectionCtrl.resx
   trunk/Tools/Maestro/Maestro.Editors/WebLayout/Commands/SearchCmdCtrl.cs
   trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Local/LocalConnection.cs
   trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/ObjectModels/LayerInterfaces.cs
   trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/ObjectModels/VectorLayerDefinitionImpl.cs
Log:
#1823: Add support in the Layer Editor for re-ordering layer properties. Also fix layer display problem in Web Layout editor

Also update mg-desktop binaries and enable unmanaged data APIs in LocalConnection

Modified: trunk/Tools/Maestro/Maestro.AddIn.Local/ACE.dll
===================================================================
(Binary files differ)

Modified: trunk/Tools/Maestro/Maestro.AddIn.Local/GEOS.dll
===================================================================
(Binary files differ)

Modified: trunk/Tools/Maestro/Maestro.AddIn.Local/MapGuideDesktopUnmanagedApi.dll
===================================================================
(Binary files differ)

Modified: trunk/Tools/Maestro/Maestro.AddIn.Local/MgDesktop.dll
===================================================================
(Binary files differ)

Modified: trunk/Tools/Maestro/Maestro.AddIn.Local/MgFoundation.dll
===================================================================
(Binary files differ)

Modified: trunk/Tools/Maestro/Maestro.AddIn.Local/MgGeometry.dll
===================================================================
(Binary files differ)

Modified: trunk/Tools/Maestro/Maestro.AddIn.Local/MgGwsCommon.dll
===================================================================
(Binary files differ)

Modified: trunk/Tools/Maestro/Maestro.AddIn.Local/MgGwsQueryEngine.dll
===================================================================
(Binary files differ)

Modified: trunk/Tools/Maestro/Maestro.AddIn.Local/MgGwsResource.dll
===================================================================
(Binary files differ)

Modified: trunk/Tools/Maestro/Maestro.AddIn.Local/MgMdfModel.dll
===================================================================
(Binary files differ)

Modified: trunk/Tools/Maestro/Maestro.AddIn.Local/MgMdfParser.dll
===================================================================
(Binary files differ)

Modified: trunk/Tools/Maestro/Maestro.AddIn.Local/MgPlatformBase.dll
===================================================================
(Binary files differ)

Modified: trunk/Tools/Maestro/Maestro.AddIn.Local/MgRenderers.dll
===================================================================
(Binary files differ)

Modified: trunk/Tools/Maestro/Maestro.AddIn.Local/MgStylization.dll
===================================================================
(Binary files differ)

Modified: trunk/Tools/Maestro/Maestro.AddIn.Local/OSGeo.MapGuide.Desktop.dll
===================================================================
(Binary files differ)

Modified: trunk/Tools/Maestro/Maestro.AddIn.Local/OSGeo.MapGuide.Viewer.dll
===================================================================
(Binary files differ)

Modified: trunk/Tools/Maestro/Maestro.AddIn.Local/gd.dll
===================================================================
(Binary files differ)

Modified: trunk/Tools/Maestro/Maestro.AddIn.Local/xerces-c_3_1mg.dll
===================================================================
(Binary files differ)

Modified: trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/LayerPropertiesSectionCtrl.Designer.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/LayerPropertiesSectionCtrl.Designer.cs	2011-10-03 02:32:28 UTC (rev 6162)
+++ trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/LayerPropertiesSectionCtrl.Designer.cs	2011-10-04 06:04:59 UTC (rev 6163)
@@ -91,16 +91,18 @@
             // btnMoveUp
             // 
             this.btnMoveUp.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
+            resources.ApplyResources(this.btnMoveUp, "btnMoveUp");
             this.btnMoveUp.Image = global::Maestro.Editors.Properties.Resources.arrow_090;
-            resources.ApplyResources(this.btnMoveUp, "btnMoveUp");
             this.btnMoveUp.Name = "btnMoveUp";
+            this.btnMoveUp.Click += new System.EventHandler(this.btnMoveUp_Click);
             // 
             // btnMoveDown
             // 
             this.btnMoveDown.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
+            resources.ApplyResources(this.btnMoveDown, "btnMoveDown");
             this.btnMoveDown.Image = global::Maestro.Editors.Properties.Resources.arrow_270;
-            resources.ApplyResources(this.btnMoveDown, "btnMoveDown");
             this.btnMoveDown.Name = "btnMoveDown";
+            this.btnMoveDown.Click += new System.EventHandler(this.btnMoveDown_Click);
             // 
             // grdProperties
             // 
@@ -113,8 +115,8 @@
             this.COL_DISPLAY});
             resources.ApplyResources(this.grdProperties, "grdProperties");
             this.grdProperties.Name = "grdProperties";
-            this.grdProperties.RowHeadersVisible = false;
             this.grdProperties.CellEndEdit += new System.Windows.Forms.DataGridViewCellEventHandler(this.grdProperties_CellEndEdit);
+            this.grdProperties.SelectionChanged += new System.EventHandler(this.grdProperties_SelectionChanged);
             // 
             // COL_VISIBLE
             // 
@@ -136,7 +138,7 @@
             // LayerPropertiesSectionCtrl
             // 
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
-            this.HeaderText = "Layer Properties Visible in Viewer";
+            resources.ApplyResources(this, "$this");
             this.Name = "LayerPropertiesSectionCtrl";
             this.contentPanel.ResumeLayout(false);
             this.contentPanel.PerformLayout();

Modified: trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/LayerPropertiesSectionCtrl.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/LayerPropertiesSectionCtrl.cs	2011-10-03 02:32:28 UTC (rev 6162)
+++ trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/LayerPropertiesSectionCtrl.cs	2011-10-04 06:04:59 UTC (rev 6163)
@@ -199,5 +199,93 @@
                 }
             }
         }
+
+        private static DataGridViewRow CloneRow(DataGridViewRow row)
+        {
+            var clone = (DataGridViewRow)row.Clone();
+            for (int i = 0; i < row.Cells.Count; i++)
+            {
+                clone.Cells[i].Value = row.Cells[i].Value;
+            }
+            return clone;
+        }
+
+        static bool IsMapped(DataGridViewRow row)
+        {
+            return row.Cells[0].Value != null && Convert.ToBoolean(row.Cells[0].Value);
+        }
+
+        private void btnMoveUp_Click(object sender, EventArgs e)
+        {
+            if (grdProperties.SelectedRows.Count == 1)
+            {
+                var row = grdProperties.SelectedRows[0];
+                var rowIdx = row.Index;
+                var idx = rowIdx - 1;
+                if (idx >= 0)
+                {
+                    grdProperties.ClearSelection();
+                    var swap = grdProperties.Rows[idx];
+                    grdProperties.Rows.RemoveAt(rowIdx);
+                    grdProperties.Rows.RemoveAt(idx);
+                    
+                    var rowClone = CloneRow(row);
+                    var swapClone = CloneRow(swap);
+                    grdProperties.Rows.Insert(idx, rowClone);
+                    grdProperties.Rows.Insert(rowIdx, swapClone);
+
+                    if (IsMapped(row) && IsMapped(swapClone))
+                    {
+                        var mp = _vl.GetPropertyMapping(row.Cells[1].Value.ToString());
+                        _vl.MoveUp(mp);
+                    }
+
+                    rowClone.Selected = true;
+                }
+            }
+        }
+
+        private void btnMoveDown_Click(object sender, EventArgs e)
+        {
+            if (grdProperties.SelectedRows.Count == 1)
+            {
+                var row = grdProperties.SelectedRows[0];
+                var rowIdx = row.Index;
+                var idx = rowIdx + 1;
+                if (idx < grdProperties.Rows.Count - 1)
+                {
+                    grdProperties.ClearSelection();
+                    var swap = grdProperties.Rows[idx];
+                    grdProperties.Rows.RemoveAt(idx);
+                    grdProperties.Rows.RemoveAt(rowIdx);
+
+                    var rowClone = CloneRow(row);
+                    var swapClone = CloneRow(swap);
+                    grdProperties.Rows.Insert(rowIdx, swapClone);
+                    grdProperties.Rows.Insert(idx, rowClone);
+
+                    if (IsMapped(row) && IsMapped(swapClone))
+                    {
+                        var mp = _vl.GetPropertyMapping(row.Cells[1].Value.ToString());
+                        _vl.MoveDown(mp);
+                    }
+
+                    rowClone.Selected = true;
+                }
+            }
+        }
+
+        private void grdProperties_SelectionChanged(object sender, EventArgs e)
+        {
+            btnMoveDown.Enabled = btnMoveUp.Enabled = false;
+            if (grdProperties.SelectedRows.Count == 1)
+            {
+                if (grdProperties.SelectedRows[0].Index > 0)
+                    btnMoveUp.Enabled = true;
+
+                if (grdProperties.SelectedRows[0].Index < grdProperties.Rows.Count - 1)
+                    btnMoveDown.Enabled = true;
+            }
+        }
     }
 }

Modified: trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/LayerPropertiesSectionCtrl.resx
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/LayerPropertiesSectionCtrl.resx	2011-10-03 02:32:28 UTC (rev 6162)
+++ trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/LayerPropertiesSectionCtrl.resx	2011-10-04 06:04:59 UTC (rev 6163)
@@ -150,6 +150,9 @@
   <data name="grdProperties.Location" type="System.Drawing.Point, System.Drawing">
     <value>0, 25</value>
   </data>
+  <data name="grdProperties.RowHeadersWidth" type="System.Int32, mscorlib">
+    <value>30</value>
+  </data>
   <data name="grdProperties.Size" type="System.Drawing.Size, System.Drawing">
     <value>449, 267</value>
   </data>
@@ -169,7 +172,7 @@
     <value>0</value>
   </data>
   <metadata name="toolStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
-    <value>17, 17</value>
+    <value>0, 0</value>
   </metadata>
   <data name="btnCheckAll.ImageTransparentColor" type="System.Drawing.Color, System.Drawing">
     <value>Magenta</value>
@@ -204,6 +207,9 @@
   <data name="toolStripSeparator1.Size" type="System.Drawing.Size, System.Drawing">
     <value>6, 25</value>
   </data>
+  <data name="btnMoveUp.Enabled" type="System.Boolean, mscorlib">
+    <value>False</value>
+  </data>
   <data name="btnMoveUp.ImageTransparentColor" type="System.Drawing.Color, System.Drawing">
     <value>Magenta</value>
   </data>
@@ -211,8 +217,11 @@
     <value>23, 22</value>
   </data>
   <data name="btnMoveUp.Text" xml:space="preserve">
-    <value>toolStripButton1</value>
+    <value>Move Up</value>
   </data>
+  <data name="btnMoveDown.Enabled" type="System.Boolean, mscorlib">
+    <value>False</value>
+  </data>
   <data name="btnMoveDown.ImageTransparentColor" type="System.Drawing.Color, System.Drawing">
     <value>Magenta</value>
   </data>
@@ -220,7 +229,7 @@
     <value>23, 22</value>
   </data>
   <data name="btnMoveDown.Text" xml:space="preserve">
-    <value>toolStripButton2</value>
+    <value>Move Down</value>
   </data>
   <data name="toolStrip1.Location" type="System.Drawing.Point, System.Drawing">
     <value>0, 0</value>
@@ -261,6 +270,9 @@
   <metadata name="$this.Localizable" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>
+  <data name="$this.HeaderText" xml:space="preserve">
+    <value>Layer Properties Visible in Viewer</value>
+  </data>
   <data name="&gt;&gt;btnCheckAll.Name" xml:space="preserve">
     <value>btnCheckAll</value>
   </data>
@@ -319,6 +331,6 @@
     <value>LayerPropertiesSectionCtrl</value>
   </data>
   <data name="&gt;&gt;$this.Type" xml:space="preserve">
-    <value>Maestro.Editors.Common.EditorBindableCollapsiblePanel, Maestro.Editors, Version=3.0.0.5334, Culture=neutral, PublicKeyToken=null</value>
+    <value>Maestro.Editors.Common.EditorBindableCollapsiblePanel, Maestro.Editors, Version=4.0.0.6143, Culture=neutral, PublicKeyToken=f526c48929fda856</value>
   </data>
 </root>
\ No newline at end of file

Modified: trunk/Tools/Maestro/Maestro.Editors/WebLayout/Commands/SearchCmdCtrl.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/WebLayout/Commands/SearchCmdCtrl.cs	2011-10-03 02:32:28 UTC (rev 6162)
+++ trunk/Tools/Maestro/Maestro.Editors/WebLayout/Commands/SearchCmdCtrl.cs	2011-10-04 06:04:59 UTC (rev 6163)
@@ -210,10 +210,20 @@
             UpdateColumns();
         }
 
+        class LayerItem
+        {
+            public string ResourceId { get; set; }
+            public string Name { get; set; }
+        }
+
         private void btnBrowseLayer_Click(object sender, EventArgs e)
         {
-            //FIXME: This doesn't properly show the specified display member. WTF?
-            var layer = GenericItemSelectionDialog.SelectItem(Properties.Resources.SelectLayer, Properties.Resources.SelectLayer, _layers.ToArray(), "Name", "Name");
+            var layers = new List<LayerItem>();
+            foreach (var l in _layers)
+            {
+                layers.Add(new LayerItem() { Name = l.Name, ResourceId = l.ResourceId });
+            }
+            var layer = GenericItemSelectionDialog.SelectItem(Properties.Resources.SelectLayer, Properties.Resources.SelectLayer, layers.ToArray(), "Name", "Name");
             if (layer != null)
             {
                 txtLayer.Tag = layer.ResourceId;

Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/ObjectModels/LayerInterfaces.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/ObjectModels/LayerInterfaces.cs	2011-10-03 02:32:28 UTC (rev 6162)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/ObjectModels/LayerInterfaces.cs	2011-10-04 06:04:59 UTC (rev 6163)
@@ -460,6 +460,20 @@
         void RemovePropertyMapping(INameStringPair pair);
 
         /// <summary>
+        /// Gets the property mapping at the specified index
+        /// </summary>
+        /// <param name="index"></param>
+        /// <returns></returns>
+        INameStringPair GetPropertyMappingAt(int index);
+
+        /// <summary>
+        /// Gets the property mapping for the feature class property
+        /// </summary>
+        /// <param name="name"></param>
+        /// <returns></returns>
+        INameStringPair GetPropertyMapping(string name);
+
+        /// <summary>
         /// Gets the position of the specified pair in the order of property mappings
         /// </summary>
         /// <param name="pair"></param>

Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/ObjectModels/VectorLayerDefinitionImpl.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/ObjectModels/VectorLayerDefinitionImpl.cs	2011-10-03 02:32:28 UTC (rev 6162)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/ObjectModels/VectorLayerDefinitionImpl.cs	2011-10-04 06:04:59 UTC (rev 6163)
@@ -1585,7 +1585,25 @@
             }
         }
 
+        INameStringPair IVectorLayerDefinition.GetPropertyMapping(string name)
+        {
+            foreach (var p in this.PropertyMapping)
+            {
+                if (p.Name == name)
+                    return p;
+            }
+            return null;
+        }
 
+        INameStringPair IVectorLayerDefinition.GetPropertyMappingAt(int index)
+        {
+            if (index < 0 || index >= this.PropertyMapping.Count)
+                throw new ArgumentOutOfRangeException();
+
+            var item = this.PropertyMapping[index];
+            return item;
+        }
+
         void IVectorLayerDefinition.AddVectorScaleRange(IVectorScaleRange range)
         {
             var r = range as VectorScaleRangeType;

Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Local/LocalConnection.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Local/LocalConnection.cs	2011-10-03 02:32:28 UTC (rev 6162)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Local/LocalConnection.cs	2011-10-04 06:04:59 UTC (rev 6163)
@@ -391,7 +391,12 @@
 
         public override UnmanagedDataList EnumerateUnmanagedData(string startpath, string filter, bool recursive, UnmanagedDataTypes type)
         {
-            throw new NotImplementedException();
+            var resSvc = GetResourceService();
+            //HACK: The SWIG wrapper breaks down on null string parameters (apparently). So coalesce them.
+            var br = resSvc.EnumerateUnmanagedData(startpath ?? string.Empty, recursive, type.ToString(), filter ?? string.Empty);
+            var result = (UnmanagedDataList)base.DeserializeObject(typeof(UnmanagedDataList), new MgReadOnlyStream(new GetByteReaderMethod(() => { return br; })));
+            LogMethodCall("MgResourceService::EnumerateUnmanagedData", true, startpath, recursive.ToString(), type.ToString(), filter);
+            return result;
         }
 
         public override string TestConnection(string featuresource)



More information about the mapguide-commits mailing list