// Copyright (C) Stichting Deltares 2017. All rights reserved. // // This file is part of Ringtoets. // // Ringtoets 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.Drawing; using System.Drawing.Drawing2D; using Core.Components.Charting.Data; using Core.Components.Charting.Styles; using Ringtoets.Common.Forms.Views; using Ringtoets.Revetment.Data; using Ringtoets.Revetment.Forms.Properties; using RingtoetsCommonFormsResources = Ringtoets.Common.Forms.Properties.Resources; namespace Ringtoets.Revetment.Forms { /// /// Factory for creating based on information used as /// wave conditions input. /// internal static class WaveConditionsChartDataFactory { /// /// Create with default styling for lower boundary revetment. /// /// The created . public static ChartLineData CreateLowerRevetmentBoundaryChartData() { return new ChartLineData(Resources.WaveConditionsChartDataFactory_LowerBoundaryRevetment_DisplayName) { Style = GetRevetmentBoundaryStyle() }; } /// /// Create with default styling for upper boundary revetment. /// /// The created . public static ChartLineData CreateUpperRevetmentBoundaryChartData() { return new ChartLineData(Resources.WaveConditionsChartDataFactory_UpperBoundaryRevetment_DisplayName) { Style = GetRevetmentBoundaryStyle() }; } /// /// Create with default styling for revetment. /// /// The created . public static ChartLineData CreateRevetmentChartData() { return new ChartLineData(Resources.WaveConditionsChartDataFactory_Revetment_DisplayName) { Style = GetRevetmentBoundaryStyle() }; } /// /// Updates the name of based on . /// /// The to update the name for. /// The used for obtaining the name. /// A default name is set (the same as in ) when: /// /// is null; /// the foreshore profile in is null; /// the foreshore profile should not be used. /// /// public static void UpdateForeshoreGeometryChartDataName(ChartLineData chartData, WaveConditionsInput input) { chartData.Name = input?.ForeshoreProfile != null && input.UseForeshore ? string.Format(RingtoetsCommonFormsResources.ChartDataFactory_Create_DataIdentifier_0_DataTypeDisplayName_1_, input.ForeshoreProfile.Name, RingtoetsCommonFormsResources.Foreshore_DisplayName) : RingtoetsCommonFormsResources.Foreshore_DisplayName; } private static ChartLineStyle GetRevetmentBoundaryStyle() { return new ChartLineStyle(Color.Gray, 2, DashStyle.Solid); } } }