protected override void Context() { _view = A.Fake <IChartEditorView>(); _axisSettingsPresenter = A.Fake <IAxisSettingsPresenter>(); _chartSettingsPresenter = A.Fake <IChartSettingsPresenter>(); _chartExportSettingsPresenter = A.Fake <IChartExportSettingsPresenter>(); _curveSettingsPresenter = A.Fake <ICurveSettingsPresenter>(); _dataBrowserPresenter = A.Fake <IDataBrowserPresenter>(); _chartTemplateMenuPresenter = A.Fake <IChartTemplateMenuPresenter>(); _chartUpdater = A.Fake <IChartUpdater>(); _eventPublisher = A.Fake <IEventPublisher>(); _dimensionFactory = A.Fake <IDimensionFactory>(); sut = new ChartEditorPresenter(_view, _axisSettingsPresenter, _chartSettingsPresenter, _chartExportSettingsPresenter, _curveSettingsPresenter, _dataBrowserPresenter, _chartTemplateMenuPresenter, _chartUpdater, _eventPublisher, _dimensionFactory); sut.SetCurveNameDefinition(x => x.QuantityInfo.PathAsString); _chart = new CurveChart().WithAxes(); sut.Edit(_chart); _baseGrid = new BaseGrid("Time", DomainHelperForSpecs.TimeDimensionForSpecs()); _standardColumn = new DataColumn("Standard", DomainHelperForSpecs.ConcentrationDimensionForSpecs(), _baseGrid) { DataInfo = new DataInfo(ColumnOrigins.Calculation), }; A.CallTo(() => _dimensionFactory.MergedDimensionFor(_baseGrid)).Returns(_baseGrid.Dimension); A.CallTo(() => _dimensionFactory.MergedDimensionFor(_standardColumn)).Returns(_standardColumn.Dimension); }
public ChartEditorPresenter( IChartEditorView view, IAxisSettingsPresenter axisSettingsPresenter, IChartSettingsPresenter chartSettingsPresenter, IChartExportSettingsPresenter chartExportSettingsPresenter, ICurveSettingsPresenter curveSettingsPresenter, IDataBrowserPresenter dataBrowserPresenter, IChartTemplateMenuPresenter chartTemplateMenuPresenter, IChartUpdater chartUpdater, IEventPublisher eventPublisher, IDimensionFactory dimensionFactory, ICurveColorGroupingPresenter curveColorGroupingPresenter) : base(view) { _showDataColumnInDataBrowserDefinition = col => col.DataInfo.Origin != ColumnOrigins.BaseGrid; _axisSettingsPresenter = axisSettingsPresenter; _chartSettingsPresenter = chartSettingsPresenter; _chartExportSettingsPresenter = chartExportSettingsPresenter; _curveSettingsPresenter = curveSettingsPresenter; _curveColorGroupingPresenter = curveColorGroupingPresenter; _dataBrowserPresenter = dataBrowserPresenter; _chartTemplateMenuPresenter = chartTemplateMenuPresenter; _chartUpdater = chartUpdater; _eventPublisher = eventPublisher; _dimensionFactory = dimensionFactory; _presentersWithColumnSettings = new List <IPresenterWithColumnSettings> { _dataBrowserPresenter, _curveSettingsPresenter, _axisSettingsPresenter }; initPresentersWithColumnSettings(); _dataBrowserPresenter.UsedChanged += (o, e) => onDataBrowserUsedChanged(e); _dataBrowserPresenter.SelectionChanged += (o, e) => onSelectionChanged(e.Columns); _chartExportSettingsPresenter.ChartExportSettingsChanged += (o, e) => onChartPropertiesChanged(); _chartSettingsPresenter.ChartSettingsChanged += (o, e) => updateChart(); _curveSettingsPresenter.AddCurves += (o, e) => addCurvesForColumns(e.Columns); _curveSettingsPresenter.RemoveCurve += (o, e) => removeCurve(e.Curve); _curveSettingsPresenter.CurvePropertyChanged += (o, e) => updateChart(); _axisSettingsPresenter.AxisRemoved += (o, e) => onAxisRemoved(e.Axis); _axisSettingsPresenter.AxisAdded += (o, e) => onAxisAdded(); _axisSettingsPresenter.AxisPropertyChanged += (o, e) => updateChart(); _curveColorGroupingPresenter.ApplySelectedColorGrouping += (o, e) => onApplyColorGrouping(e.SelectedMetaData); AddSubPresenters(axisSettingsPresenter, chartSettingsPresenter, chartExportSettingsPresenter, curveSettingsPresenter, dataBrowserPresenter, curveColorGroupingPresenter); _view.SetAxisSettingsView(axisSettingsPresenter.View); _view.SetChartSettingsView(chartSettingsPresenter.View); _view.SetChartExportSettingsView(chartExportSettingsPresenter.View); _view.SetCurveSettingsView(curveSettingsPresenter.View); _view.SetCurveColorGroupingView(curveColorGroupingPresenter.View); _view.SetDataBrowserView(dataBrowserPresenter.View); }
public PopulationAnalysisChartSettingsPresenter(IPopulationAnalysisChartSettingsView view, IChartSettingsPresenter chartSettingsPresenter, IChartExportSettingsPresenter chartExportSettingsPresenter) : base(view) { _chartSettingsPresenter = chartSettingsPresenter; _chartExportSettingsPresenter = chartExportSettingsPresenter; view.SetChartSettingsView(chartSettingsPresenter.View); view.SetChartExportSettingsView(chartExportSettingsPresenter.View); view.AllowEditConfiguration = false; chartSettingsPresenter.NameVisible = false; AddSubPresenters(chartSettingsPresenter, chartExportSettingsPresenter); _subPresenterManager.InitializeWith(this); }
public ChartTemplateDetailsPresenter(IChartTemplateDetailsView view, IChartSettingsPresenter chartSettingsPresenter, ICurveTemplatePresenter curveTemplatePresenter, IAxisSettingsPresenter axisSettingsPresenter, IChartExportSettingsPresenter chartExportSettingsPresenter) : base(view) { _chartSettingsPresenter = chartSettingsPresenter; _curveTemplatePresenter = curveTemplatePresenter; _axisSettingsPresenter = axisSettingsPresenter; _axisSettingsPresenter.AxisRemoved += (o, e) => axisRemoved(e.Axis); _axisSettingsPresenter.AxisAdded += (o, e) => axisAdded(); _chartExportSettingsPresenter = chartExportSettingsPresenter; _view.SetChartSettingsView(_chartSettingsPresenter.View); _view.SetCurveTemplateView(_curveTemplatePresenter.View); _view.SetAxisSettingsView(_axisSettingsPresenter.View); _view.SetChartExportSettingsView(_chartExportSettingsPresenter.View); AddSubPresenters(_chartSettingsPresenter, _curveTemplatePresenter, _axisSettingsPresenter, _chartExportSettingsPresenter); }
public void AttachPresenter(IChartExportSettingsPresenter presenter) { _presenter = presenter; }