Index: Riskeer/Integration/src/Riskeer.Integration.Forms/Riskeer.Integration.Forms.csproj =================================================================== diff -u -r51c955b9d1fd44b643c32b670aa048245b76a8de -rd04957276dbeb07bf0ab6189ad7d77385b8f20ca --- Riskeer/Integration/src/Riskeer.Integration.Forms/Riskeer.Integration.Forms.csproj (.../Riskeer.Integration.Forms.csproj) (revision 51c955b9d1fd44b643c32b670aa048245b76a8de) +++ Riskeer/Integration/src/Riskeer.Integration.Forms/Riskeer.Integration.Forms.csproj (.../Riskeer.Integration.Forms.csproj) (revision d04957276dbeb07bf0ab6189ad7d77385b8f20ca) @@ -52,7 +52,7 @@ True Resources.resx - + UserControl Fisheye: Tag d04957276dbeb07bf0ab6189ad7d77385b8f20ca refers to a dead (removed) revision in file `Riskeer/Integration/src/Riskeer.Integration.Forms/Views/AssessmentSectionBaseView.Designer.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag d04957276dbeb07bf0ab6189ad7d77385b8f20ca refers to a dead (removed) revision in file `Riskeer/Integration/src/Riskeer.Integration.Forms/Views/AssessmentSectionBaseView.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag d04957276dbeb07bf0ab6189ad7d77385b8f20ca refers to a dead (removed) revision in file `Riskeer/Integration/src/Riskeer.Integration.Forms/Views/AssessmentSectionBaseView.resx'. Fisheye: No comparison available. Pass `N' to diff? Index: Riskeer/Integration/src/Riskeer.Integration.Forms/Views/AssessmentSectionReferenceLineView.Designer.cs =================================================================== diff -u --- Riskeer/Integration/src/Riskeer.Integration.Forms/Views/AssessmentSectionReferenceLineView.Designer.cs (revision 0) +++ Riskeer/Integration/src/Riskeer.Integration.Forms/Views/AssessmentSectionReferenceLineView.Designer.cs (revision d04957276dbeb07bf0ab6189ad7d77385b8f20ca) @@ -0,0 +1,64 @@ +// Copyright (C) Stichting Deltares 2021. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +namespace Riskeer.Integration.Forms.Views +{ + partial class AssessmentSectionReferenceLineView + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + #region Component Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.riskeerMapControl = new Riskeer.Common.Forms.Views.RiskeerMapControl(); + this.SuspendLayout(); + // + // riskeerMapControl + // + this.riskeerMapControl.Dock = System.Windows.Forms.DockStyle.Fill; + this.riskeerMapControl.Location = new System.Drawing.Point(0, 0); + this.riskeerMapControl.Name = "riskeerMapControl"; + this.riskeerMapControl.Size = new System.Drawing.Size(150, 150); + this.riskeerMapControl.TabIndex = 0; + // + // AssessmentSectionView + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.riskeerMapControl); + this.Name = "AssessmentSectionReferenceLineView"; + this.ResumeLayout(false); + + } + + #endregion + + private Riskeer.Common.Forms.Views.RiskeerMapControl riskeerMapControl; + } +} Index: Riskeer/Integration/src/Riskeer.Integration.Forms/Views/AssessmentSectionReferenceLineView.cs =================================================================== diff -u --- Riskeer/Integration/src/Riskeer.Integration.Forms/Views/AssessmentSectionReferenceLineView.cs (revision 0) +++ Riskeer/Integration/src/Riskeer.Integration.Forms/Views/AssessmentSectionReferenceLineView.cs (revision d04957276dbeb07bf0ab6189ad7d77385b8f20ca) @@ -0,0 +1,129 @@ +// Copyright (C) Stichting Deltares 2021. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using System.Windows.Forms; +using Core.Common.Base; +using Core.Components.Gis.Data; +using Core.Components.Gis.Forms; +using Riskeer.Common.Forms.Factories; +using Riskeer.Integration.Data; +using Riskeer.Integration.Forms.Properties; + +namespace Riskeer.Integration.Forms.Views +{ + /// + /// This class is a view showing map data for an assessment section. + /// + public partial class AssessmentSectionReferenceLineView : UserControl, IMapView + { + private readonly AssessmentSection assessmentSection; + + private readonly MapLineData referenceLineMapData; + + private Observer assessmentSectionObserver; + private Observer referenceLineObserver; + + /// + /// Creates a new instance of . + /// + /// The assessment section to show the data for. + /// Thrown when + /// is null. + public AssessmentSectionReferenceLineView(AssessmentSection assessmentSection) + { + if (assessmentSection == null) + { + throw new ArgumentNullException(nameof(assessmentSection)); + } + + InitializeComponent(); + + this.assessmentSection = assessmentSection; + + CreateObservers(); + + var mapDataCollection = new MapDataCollection(Resources.AssessmentSectionMap_DisplayName); + referenceLineMapData = RiskeerMapDataFactory.CreateReferenceLineMapData(); + + mapDataCollection.Add(referenceLineMapData); + + SetAllMapDataFeatures(); + riskeerMapControl.SetAllData(mapDataCollection, assessmentSection.BackgroundData); + } + + public object Data { get; set; } + + public IMapControl Map + { + get + { + return riskeerMapControl.MapControl; + } + } + + protected override void Dispose(bool disposing) + { + assessmentSectionObserver.Dispose(); + referenceLineObserver.Dispose(); + + if (disposing) + { + components?.Dispose(); + } + + base.Dispose(disposing); + } + + private void CreateObservers() + { + assessmentSectionObserver = new Observer(UpdateReferenceLineMapData) + { + Observable = assessmentSection + }; + + referenceLineObserver = new Observer(UpdateReferenceLineMapData) + { + Observable = assessmentSection.ReferenceLine + }; + } + + private void SetAllMapDataFeatures() + { + SetReferenceLineMapData(); + } + + #region ReferenceLine MapData + + private void UpdateReferenceLineMapData() + { + SetReferenceLineMapData(); + referenceLineMapData.NotifyObservers(); + } + + private void SetReferenceLineMapData() + { + referenceLineMapData.Features = RiskeerMapDataFeaturesFactory.CreateReferenceLineFeatures(assessmentSection.ReferenceLine, assessmentSection.Id, assessmentSection.Name); + } + + #endregion + } +} \ No newline at end of file Index: Riskeer/Integration/src/Riskeer.Integration.Forms/Views/AssessmentSectionReferenceLineView.resx =================================================================== diff -u --- Riskeer/Integration/src/Riskeer.Integration.Forms/Views/AssessmentSectionReferenceLineView.resx (revision 0) +++ Riskeer/Integration/src/Riskeer.Integration.Forms/Views/AssessmentSectionReferenceLineView.resx (revision d04957276dbeb07bf0ab6189ad7d77385b8f20ca) @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file Index: Riskeer/Integration/src/Riskeer.Integration.Plugin/RiskeerPlugin.cs =================================================================== diff -u -re081bb0f2a909508a43d27e21ce4f864d6ce003b -rd04957276dbeb07bf0ab6189ad7d77385b8f20ca --- Riskeer/Integration/src/Riskeer.Integration.Plugin/RiskeerPlugin.cs (.../RiskeerPlugin.cs) (revision e081bb0f2a909508a43d27e21ce4f864d6ce003b) +++ Riskeer/Integration/src/Riskeer.Integration.Plugin/RiskeerPlugin.cs (.../RiskeerPlugin.cs) (revision d04957276dbeb07bf0ab6189ad7d77385b8f20ca) @@ -509,11 +509,11 @@ CreateInstance = section => new AssessmentSectionView(section) }; - yield return new ViewInfo + yield return new ViewInfo { GetViewName = (view, context) => RiskeerFormsResources.AssessmentSectionMap_DisplayName, Image = RiskeerFormsResources.Map, - CreateInstance = context => new AssessmentSectionBaseView(context.WrappedData) + CreateInstance = context => new AssessmentSectionReferenceLineView(context.WrappedData) }; yield return CreateFailureMechanismWithDetailedAssessmentViewInfo(