Index: Core/Components/src/Core.Components.DotSpatial/Converter/MapDataHelper.cs
===================================================================
diff -u -r67284323e2785c651633d9c52049ba12a9c70e6a -r87ac68e11e89dda424f6fe34e145ee901cdc4e5c
--- Core/Components/src/Core.Components.DotSpatial/Converter/MapDataHelper.cs (.../MapDataHelper.cs) (revision 67284323e2785c651633d9c52049ba12a9c70e6a)
+++ Core/Components/src/Core.Components.DotSpatial/Converter/MapDataHelper.cs (.../MapDataHelper.cs) (revision 87ac68e11e89dda424f6fe34e145ee901cdc4e5c)
@@ -50,8 +50,11 @@
case PointSymbol.Triangle:
shape = PointShape.Triangle;
break;
+ case PointSymbol.Diamond:
+ shape = PointShape.Diamond;
+ break;
default:
- throw new InvalidEnumArgumentException("symbol",
+ throw new InvalidEnumArgumentException(nameof(symbol),
(int) symbol,
typeof(PointShape));
}
Index: Core/Components/src/Core.Components.Gis/Data/MapPointData.cs
===================================================================
diff -u -r7fc5e21f72a83b37ad5e4daca553fca84fe140ab -r87ac68e11e89dda424f6fe34e145ee901cdc4e5c
--- Core/Components/src/Core.Components.Gis/Data/MapPointData.cs (.../MapPointData.cs) (revision 7fc5e21f72a83b37ad5e4daca553fca84fe140ab)
+++ Core/Components/src/Core.Components.Gis/Data/MapPointData.cs (.../MapPointData.cs) (revision 87ac68e11e89dda424f6fe34e145ee901cdc4e5c)
@@ -34,7 +34,7 @@
public class MapPointData : FeatureBasedMapData
{
///
- /// Creates a new instance of .
+ /// Creates a new instance of with default styling.
///
/// The name of the .
/// Thrown when is
Index: Core/Components/src/Core.Components.Gis/Properties/Resources.Designer.cs
===================================================================
diff -u -r67284323e2785c651633d9c52049ba12a9c70e6a -r87ac68e11e89dda424f6fe34e145ee901cdc4e5c
--- Core/Components/src/Core.Components.Gis/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 67284323e2785c651633d9c52049ba12a9c70e6a)
+++ Core/Components/src/Core.Components.Gis/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 87ac68e11e89dda424f6fe34e145ee901cdc4e5c)
@@ -109,6 +109,24 @@
}
///
+ /// Looks up a localized string similar to Cirkel.
+ ///
+ internal static string Circle_DisplayName {
+ get {
+ return ResourceManager.GetString("Circle_DisplayName", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Ruit.
+ ///
+ internal static string Diamond_DisplayName {
+ get {
+ return ResourceManager.GetString("Diamond_DisplayName", resourceCulture);
+ }
+ }
+
+ ///
/// Looks up a localized string similar to Esri World - Reliƫf.
///
internal static string EsriWorldShadedRelief_DisplayName {
@@ -145,6 +163,24 @@
}
///
+ /// Looks up a localized string similar to Vierkant.
+ ///
+ internal static string Square_DisplayName {
+ get {
+ return ResourceManager.GetString("Square_DisplayName", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Driekhoek.
+ ///
+ internal static string Triangle_DisplayName {
+ get {
+ return ResourceManager.GetString("Triangle_DisplayName", resourceCulture);
+ }
+ }
+
+ ///
/// Looks up a localized string similar to <niet bepaald>.
///
internal static string WmtsMapData_Unconfigured_name {
Index: Core/Components/src/Core.Components.Gis/Properties/Resources.resx
===================================================================
diff -u -r7fc071aa21ada037052184432c734ce79adf5c8c -r87ac68e11e89dda424f6fe34e145ee901cdc4e5c
--- Core/Components/src/Core.Components.Gis/Properties/Resources.resx (.../Resources.resx) (revision 7fc071aa21ada037052184432c734ce79adf5c8c)
+++ Core/Components/src/Core.Components.Gis/Properties/Resources.resx (.../Resources.resx) (revision 87ac68e11e89dda424f6fe34e145ee901cdc4e5c)
@@ -141,4 +141,16 @@
De transparantie moet in het bereik {0} liggen.
+
+ Cirkel
+
+
+ Ruit
+
+
+ Vierkant
+
+
+ Driekhoek
+
\ No newline at end of file
Index: Core/Components/src/Core.Components.Gis/Style/PointStyle.cs
===================================================================
diff -u -rbc95cdad1e44d37f5792bd526408db32c018c291 -r87ac68e11e89dda424f6fe34e145ee901cdc4e5c
--- Core/Components/src/Core.Components.Gis/Style/PointStyle.cs (.../PointStyle.cs) (revision bc95cdad1e44d37f5792bd526408db32c018c291)
+++ Core/Components/src/Core.Components.Gis/Style/PointStyle.cs (.../PointStyle.cs) (revision 87ac68e11e89dda424f6fe34e145ee901cdc4e5c)
@@ -49,11 +49,11 @@
///
/// Gets the point size.
///
- public double Size { get; private set; }
+ public double Size { get; set; }
///
/// Gets the point symbol.
///
- public PointSymbol Symbol { get; private set; }
+ public PointSymbol Symbol { get; set; }
}
}
\ No newline at end of file
Index: Core/Components/src/Core.Components.Gis/Style/PointSymbol.cs
===================================================================
diff -u -r67284323e2785c651633d9c52049ba12a9c70e6a -r87ac68e11e89dda424f6fe34e145ee901cdc4e5c
--- Core/Components/src/Core.Components.Gis/Style/PointSymbol.cs (.../PointSymbol.cs) (revision 67284323e2785c651633d9c52049ba12a9c70e6a)
+++ Core/Components/src/Core.Components.Gis/Style/PointSymbol.cs (.../PointSymbol.cs) (revision 87ac68e11e89dda424f6fe34e145ee901cdc4e5c)
@@ -19,15 +19,23 @@
// Stichting Deltares and remain full property of Stichting Deltares at all times.
// All rights reserved.
+using Core.Common.Utils.Attributes;
+using Core.Components.Gis.Properties;
+
namespace Core.Components.Gis.Style
{
///
/// All symbols supported by .
///
public enum PointSymbol
{
+ [ResourcesDisplayName(typeof(Resources), nameof(Resources.Circle_DisplayName))]
Circle,
+ [ResourcesDisplayName(typeof(Resources), nameof(Resources.Square_DisplayName))]
Square,
- Triangle
+ [ResourcesDisplayName(typeof(Resources), nameof(Resources.Triangle_DisplayName))]
+ Triangle,
+ [ResourcesDisplayName(typeof(Resources), nameof(Resources.Diamond_DisplayName))]
+ Diamond
}
}
\ No newline at end of file
Index: Core/Components/test/Core.Components.DotSpatial.Test/Converter/MapDataHelperTest.cs
===================================================================
diff -u -r67284323e2785c651633d9c52049ba12a9c70e6a -r87ac68e11e89dda424f6fe34e145ee901cdc4e5c
--- Core/Components/test/Core.Components.DotSpatial.Test/Converter/MapDataHelperTest.cs (.../MapDataHelperTest.cs) (revision 67284323e2785c651633d9c52049ba12a9c70e6a)
+++ Core/Components/test/Core.Components.DotSpatial.Test/Converter/MapDataHelperTest.cs (.../MapDataHelperTest.cs) (revision 87ac68e11e89dda424f6fe34e145ee901cdc4e5c)
@@ -61,6 +61,16 @@
}
[Test]
+ public void Convert_Diamond_ReturnDiamond()
+ {
+ // Call
+ PointShape symbol = MapDataHelper.Convert(PointSymbol.Diamond);
+
+ // Assert
+ Assert.AreEqual(PointShape.Diamond, symbol);
+ }
+
+ [Test]
public void Convert_InvalidPointSymbol_ThrowsInvalidEnumArgumentException()
{
// Call
Index: Core/Plugins/src/Core.Plugins.Map/PropertyClasses/MapPointDataProperties.cs
===================================================================
diff -u -r7fc5e21f72a83b37ad5e4daca553fca84fe140ab -r87ac68e11e89dda424f6fe34e145ee901cdc4e5c
--- Core/Plugins/src/Core.Plugins.Map/PropertyClasses/MapPointDataProperties.cs (.../MapPointDataProperties.cs) (revision 7fc5e21f72a83b37ad5e4daca553fca84fe140ab)
+++ Core/Plugins/src/Core.Plugins.Map/PropertyClasses/MapPointDataProperties.cs (.../MapPointDataProperties.cs) (revision 87ac68e11e89dda424f6fe34e145ee901cdc4e5c)
@@ -23,8 +23,10 @@
using System.Drawing;
using System.Drawing.Design;
using Core.Common.Gui.Attributes;
+using Core.Common.Utils;
using Core.Common.Utils.Attributes;
using Core.Components.Gis.Data;
+using Core.Components.Gis.Style;
using Core.Plugins.Map.Converters;
using Core.Plugins.Map.Properties;
using Core.Plugins.Map.UITypeEditors;
@@ -89,18 +91,29 @@
{
return data.Style.Size;
}
+ set
+ {
+ data.Style.Size = value;
+ data.NotifyObservers();
+ }
}
[PropertyOrder(9)]
[ResourcesCategory(typeof(Resources), nameof(Resources.Categories_Styling))]
[ResourcesDisplayName(typeof(Resources), nameof(Resources.MapPointData_Symbol_Displayname))]
[ResourcesDescription(typeof(Resources), nameof(Resources.MapPointData_Symbol_Description))]
- public string Symbol
+ [TypeConverter(typeof(EnumTypeConverter))]
+ public PointSymbol Symbol
{
get
{
- return data.Style.Symbol.ToString();
+ return data.Style.Symbol;
}
+ set
+ {
+ data.Style.Symbol = value;
+ data.NotifyObservers();
+ }
}
public override string Type
Index: Core/Plugins/test/Core.Plugins.Map.Test/PropertyClasses/MapPointDataPropertiesTest.cs
===================================================================
diff -u -r7fc5e21f72a83b37ad5e4daca553fca84fe140ab -r87ac68e11e89dda424f6fe34e145ee901cdc4e5c
--- Core/Plugins/test/Core.Plugins.Map.Test/PropertyClasses/MapPointDataPropertiesTest.cs (.../MapPointDataPropertiesTest.cs) (revision 7fc5e21f72a83b37ad5e4daca553fca84fe140ab)
+++ Core/Plugins/test/Core.Plugins.Map.Test/PropertyClasses/MapPointDataPropertiesTest.cs (.../MapPointDataPropertiesTest.cs) (revision 87ac68e11e89dda424f6fe34e145ee901cdc4e5c)
@@ -24,13 +24,13 @@
using System.Linq;
using Core.Common.Base;
using Core.Common.TestUtil;
+using Core.Common.Utils;
using Core.Components.Gis.Data;
using Core.Components.Gis.Features;
using Core.Components.Gis.Geometries;
using Core.Components.Gis.Style;
using Core.Plugins.Map.Converters;
using Core.Plugins.Map.PropertyClasses;
-using Core.Plugins.Map.UITypeEditors;
using NUnit.Framework;
using Rhino.Mocks;
@@ -105,15 +105,14 @@
PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(sizeProperty,
"Stijl",
"Grootte",
- "De grootte van de symbolen waarmee deze kaartlaag wordt weergegeven.",
- true);
+ "De grootte van de symbolen waarmee deze kaartlaag wordt weergegeven.");
PropertyDescriptor symbolProperty = dynamicProperties[symbolPropertyIndex];
+ Assert.IsInstanceOf(symbolProperty.Converter);
PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(symbolProperty,
"Stijl",
"Symbool",
- "Het symbool waarmee deze kaartlaag wordt weergegeven.",
- true);
+ "Het symbool waarmee deze kaartlaag wordt weergegeven.");
}
[Test]
@@ -139,14 +138,14 @@
Assert.AreEqual(color.ToString(), properties.StrokeColor);
Assert.AreEqual(size, properties.StrokeThickness);
Assert.AreEqual(size, properties.Size);
- Assert.AreEqual(symbol.ToString(), properties.Symbol);
+ Assert.AreEqual(symbol, properties.Symbol);
}
[Test]
public void SetProperties_IndividualProperties_UpdateDataAndNotifyObservers()
{
// Setup
- const int numberOfChangedProperties = 1;
+ const int numberOfChangedProperties = 3;
var mocks = new MockRepository();
var observerMock = mocks.StrictMock();
observerMock.Expect(o => o.UpdateObserver()).Repeat.Times(numberOfChangedProperties);
@@ -162,12 +161,19 @@
};
Color newColor = Color.Blue;
+ const double newSize = 6;
+ PointSymbol newSymbol = PointSymbol.Diamond;
// Call
properties.Color = newColor;
+ properties.Size = newSize;
+ properties.Symbol = newSymbol;
+
// Assert
Assert.AreEqual(newColor, mapPointData.Style.Color);
+ Assert.AreEqual(newSize, mapPointData.Style.Size);
+ Assert.AreEqual(newSymbol, mapPointData.Style.Symbol);
mocks.VerifyAll();
}
}