[mapguide-commits] r7170 - trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Thematics

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Mon Oct 29 09:42:51 PDT 2012


Author: jng
Date: 2012-10-29 09:42:50 -0700 (Mon, 29 Oct 2012)
New Revision: 7170

Modified:
   trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Thematics/ColorBrewer.cs
   trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Thematics/ThemeCreator.cs
   trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Thematics/ThemeCreator.designer.cs
   trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Thematics/ThemeCreator.resx
Log:
#2143: Add support for flipping the order of ColorBrewer color ramps.

Modified: trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Thematics/ColorBrewer.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Thematics/ColorBrewer.cs	2012-10-29 16:30:16 UTC (rev 7169)
+++ trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Thematics/ColorBrewer.cs	2012-10-29 16:42:50 UTC (rev 7170)
@@ -295,5 +295,10 @@
                     return m_set.ToString();
             }
         }
+
+        internal void Flip()
+        {
+            this.Colors.Reverse();
+        }
     }
 }

Modified: trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Thematics/ThemeCreator.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Thematics/ThemeCreator.cs	2012-10-29 16:30:16 UTC (rev 7169)
+++ trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Thematics/ThemeCreator.cs	2012-10-29 16:42:50 UTC (rev 7170)
@@ -697,11 +697,13 @@
 
         private void GradientColors_CheckedChanged(object sender, EventArgs e)
         {
+            btnFlipColorBrewer.Enabled = false;
             RefreshPreview();
         }
 
         private void ColorBrewerColors_CheckedChanged(object sender, EventArgs e)
         {
+            btnFlipColorBrewer.Enabled = true;
             RefreshPreview();
         }
 
@@ -911,6 +913,11 @@
 
         private void ColorBrewerDataType_SelectedIndexChanged(object sender, EventArgs e)
         {
+            LoadColorBrewerOptions();
+        }
+
+        private void LoadColorBrewerOptions()
+        {
             string prevSet = ColorBrewerColorSet.Text;
             ColorBrewerColorSet.Items.Clear();
 
@@ -934,5 +941,13 @@
             m_editor.OpenUrl("http://colorbrewer.org/");
         }
 
+        private void btnFlipColorBrewer_Click(object sender, EventArgs e)
+        {
+            foreach (var cb in m_colorBrewer)
+            {
+                cb.Flip();
+            }
+            LoadColorBrewerOptions();
+        }
     }
 }

Modified: trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Thematics/ThemeCreator.designer.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Thematics/ThemeCreator.designer.cs	2012-10-29 16:30:16 UTC (rev 7169)
+++ trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Thematics/ThemeCreator.designer.cs	2012-10-29 16:42:50 UTC (rev 7170)
@@ -43,6 +43,7 @@
             this.GroupPanel = new System.Windows.Forms.Panel();
             this.RuleCountPanel = new System.Windows.Forms.Panel();
             this.DisplayGroup = new System.Windows.Forms.GroupBox();
+            this.btnFlipColorBrewer = new System.Windows.Forms.Button();
             this.ColorBrewerPanel = new System.Windows.Forms.Panel();
             this.label3 = new System.Windows.Forms.Label();
             this.ColorBrewerDataType = new System.Windows.Forms.ComboBox();
@@ -176,6 +177,7 @@
             // DisplayGroup
             // 
             resources.ApplyResources(this.DisplayGroup, "DisplayGroup");
+            this.DisplayGroup.Controls.Add(this.btnFlipColorBrewer);
             this.DisplayGroup.Controls.Add(this.ColorBrewerPanel);
             this.DisplayGroup.Controls.Add(this.ColorBrewerLabel);
             this.DisplayGroup.Controls.Add(this.panel2);
@@ -184,6 +186,13 @@
             this.DisplayGroup.Name = "DisplayGroup";
             this.DisplayGroup.TabStop = false;
             // 
+            // btnFlipColorBrewer
+            // 
+            resources.ApplyResources(this.btnFlipColorBrewer, "btnFlipColorBrewer");
+            this.btnFlipColorBrewer.Name = "btnFlipColorBrewer";
+            this.btnFlipColorBrewer.UseVisualStyleBackColor = true;
+            this.btnFlipColorBrewer.Click += new System.EventHandler(this.btnFlipColorBrewer_Click);
+            // 
             // ColorBrewerPanel
             // 
             this.ColorBrewerPanel.Controls.Add(this.label3);
@@ -364,5 +373,6 @@
         private System.Windows.Forms.ComboBox ColorBrewerDataType;
         private System.Windows.Forms.LinkLabel ColorBrewerLabel;
         private System.Windows.Forms.CheckBox chkUseFirstRuleAsTemplate;
+        private System.Windows.Forms.Button btnFlipColorBrewer;
     }
 }
\ No newline at end of file

Modified: trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Thematics/ThemeCreator.resx
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Thematics/ThemeCreator.resx	2012-10-29 16:30:16 UTC (rev 7169)
+++ trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Thematics/ThemeCreator.resx	2012-10-29 16:42:50 UTC (rev 7170)
@@ -441,6 +441,33 @@
   <data name="DisplayGroup.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
     <value>Top, Left, Right</value>
   </data>
+  <data name="btnFlipColorBrewer.Enabled" type="System.Boolean, mscorlib">
+    <value>False</value>
+  </data>
+  <data name="btnFlipColorBrewer.Location" type="System.Drawing.Point, System.Drawing">
+    <value>112, 78</value>
+  </data>
+  <data name="btnFlipColorBrewer.Size" type="System.Drawing.Size, System.Drawing">
+    <value>148, 23</value>
+  </data>
+  <data name="btnFlipColorBrewer.TabIndex" type="System.Int32, mscorlib">
+    <value>10</value>
+  </data>
+  <data name="btnFlipColorBrewer.Text" xml:space="preserve">
+    <value>Flip ColorBrewer Colors</value>
+  </data>
+  <data name=">>btnFlipColorBrewer.Name" xml:space="preserve">
+    <value>btnFlipColorBrewer</value>
+  </data>
+  <data name=">>btnFlipColorBrewer.Type" xml:space="preserve">
+    <value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </data>
+  <data name=">>btnFlipColorBrewer.Parent" xml:space="preserve">
+    <value>DisplayGroup</value>
+  </data>
+  <data name=">>btnFlipColorBrewer.ZOrder" xml:space="preserve">
+    <value>0</value>
+  </data>
   <data name="label3.AutoSize" type="System.Boolean, mscorlib">
     <value>True</value>
   </data>
@@ -529,7 +556,7 @@
     <value>DisplayGroup</value>
   </data>
   <data name=">>ColorBrewerPanel.ZOrder" xml:space="preserve">
-    <value>0</value>
+    <value>1</value>
   </data>
   <data name="ColorBrewerLabel.AutoSize" type="System.Boolean, mscorlib">
     <value>True</value>
@@ -556,7 +583,7 @@
     <value>DisplayGroup</value>
   </data>
   <data name=">>ColorBrewerLabel.ZOrder" xml:space="preserve">
-    <value>1</value>
+    <value>2</value>
   </data>
   <data name="GradientToColor.Location" type="System.Drawing.Point, System.Drawing">
     <value>112, 0</value>
@@ -646,7 +673,7 @@
     <value>DisplayGroup</value>
   </data>
   <data name=">>panel2.ZOrder" xml:space="preserve">
-    <value>2</value>
+    <value>3</value>
   </data>
   <data name="ColorBrewerColors.AutoSize" type="System.Boolean, mscorlib">
     <value>True</value>
@@ -670,7 +697,7 @@
     <value>DisplayGroup</value>
   </data>
   <data name=">>ColorBrewerColors.ZOrder" xml:space="preserve">
-    <value>3</value>
+    <value>4</value>
   </data>
   <data name="GradientColors.AutoSize" type="System.Boolean, mscorlib">
     <value>True</value>
@@ -697,7 +724,7 @@
     <value>DisplayGroup</value>
   </data>
   <data name=">>GradientColors.ZOrder" xml:space="preserve">
-    <value>4</value>
+    <value>5</value>
   </data>
   <data name="DisplayGroup.Location" type="System.Drawing.Point, System.Drawing">
     <value>8, 152</value>



More information about the mapguide-commits mailing list