Exemple #1
0
        private void handleAsDraggingColor(ColorEdit colorEdit, CurveDTO curveDTO)
        {
            var color = curveDTO.Color;

            colorEdit?.ClosePopup();
            gridControl.DoDragDrop(color, DragDropEffects.Copy);
            _downHitInfo = null;
        }
        public string ToolTipFor(CurveDTO curveDTO)
        {
            if (CurveNameDefinition == null || curveDTO.yData == null)
            {
                return(string.Empty);
            }

            return(CurveNameDefinition(curveDTO.yData));
        }
Exemple #3
0
        private void dropCurve(GridHitInfo hitInfo, CurveDTO curveBeingMoved)
        {
            if (!hitInRowIndicator(hitInfo))
            {
                return;
            }

            var targetCurveDTO = _gridBinderCurves.ElementAt(hitInfo.RowHandle);

            _presenter.MoveCurvesInLegend(curveBeingMoved, targetCurveDTO);
        }
        protected override void Context()
        {
            _view                  = A.Fake <ICurveSettingsView>();
            _dimensionFactory      = A.Fake <IDimensionFactory>();
            _applicationController = A.Fake <IApplicationController>();
            _chart                 = new CurveChart();
            A.CallTo(() => _dimensionFactory.MergedDimensionFor(A <IWithDimension> ._)).ReturnsLazily(x => x.GetArgument <IWithDimension>(0).Dimension);

            var dataRepo1 = DomainHelperForSpecs.SimulationDataRepositoryFor("Sim1");

            _datColumn1 = dataRepo1.FirstDataColumn();

            var dataRepo2 = DomainHelperForSpecs.SimulationDataRepositoryFor("Sim2");

            _datColumn2 = dataRepo2.FirstDataColumn();

            _curve1 = new Curve();
            _curve1.SetxData(dataRepo1.BaseGrid, _dimensionFactory);
            _curve1.SetyData(_datColumn1, _dimensionFactory);

            _curve2 = new Curve();
            _curve2.SetxData(dataRepo2.BaseGrid, _dimensionFactory);
            _curve2.SetyData(_datColumn2, _dimensionFactory);

            _chart.AddCurve(_curve1);
            _chart.AddCurve(_curve2);

            sut = new CurveSettingsPresenter(_view, _dimensionFactory, _applicationController);

            A.CallTo(() => _view.BindTo(A <IEnumerable <CurveDTO> > ._))
            .Invokes(x =>
            {
                _allCurveDTOs = x.GetArgument <IEnumerable <CurveDTO> >(0).ToList();
                _curveDTO1    = _allCurveDTOs.FirstOrDefault();
            });

            sut.Edit(_chart);
        }
Exemple #5
0
 private void handleAsDraggingCurve(CurveDTO curveDTO)
 {
     gridControl.DoDragDrop(curveDTO, DragDropEffects.Move);
     _downHitInfo = null;
 }
Exemple #6
0
 private void configureAxisTypeEditor(BaseEdit baseEdit, CurveDTO curve)
 {
     baseEdit.FillComboBoxEditorWith(_presenter.AllYAxisTypes);
 }
Exemple #7
0
 private void notifyCurvePropertyChange(CurveDTO curveDTO)
 {
     _presenter.NotifyCurvePropertyChange(curveDTO);
 }
 public void MoveCurvesInLegend(CurveDTO curveBeingMoved, CurveDTO targetCurve)
 {
     _chart.MoveCurvesInLegend(curveBeingMoved.Curve, targetCurve.Curve);
     NotifyCurvePropertyChange(targetCurve);
 }
 public void UpdateCurveColor(CurveDTO curveDTO, Color color)
 {
     curveDTO.Color = color;
     NotifyCurvePropertyChange(curveDTO);
 }
 public void SetCurveYData(CurveDTO curveDTO, DataColumn dataColumn)
 {
     _chart.SetyData(curveDTO.Curve, dataColumn, _dimensionFactory);
     NotifyCurvePropertyChange(curveDTO);
 }
 public void NotifyCurvePropertyChange(CurveDTO curveDTO)
 {
     this.DoWithinLatch(() =>
                        CurvePropertyChanged(this, new CurveEventArgs(curveDTO.Curve))
                        );
 }
 public void Remove(CurveDTO curveDTO) => RemoveCurve(this, new CurveEventArgs(curveDTO.Curve));