protected override void Initialize(bool initData) { base.Initialize(initData); if (initData) { _dataSourceOptionsController = (IMVCANController)Current.Gui.GetControllerAndControl(new object[] { _doc.ImportOptions }, typeof(IMVCANController), UseDocument.Directly); _processOptionsController = (IMVCANController)Current.Gui.GetControllerAndControl(new object[] { _doc.DataSourceOptions }, typeof(IMVCANController), UseDocument.Directly); _processDataController = new ConvertXYVToMatrixDataController() { UseDocumentCopy = UseDocument.Directly }; _processDataController.InitializeDocument(_doc.InputData); Current.Gui.FindAndAttachControlTo(_processDataController); } if (null != _view) { _view.SetImportOptionsControl(_dataSourceOptionsController.ViewObject); _view.SetProcessOptionsControl(_processOptionsController.ViewObject); if (null != _processDataController) { _view.SetProcessDataControl(_processDataController.ViewObject); } } }
protected override void Initialize(bool initData) { base.Initialize(initData); if (initData) { _scaleController = new DensityScaleController(newScale => _doc.Scale = (NumericalScale)newScale) { UseDocumentCopy = UseDocument.Directly }; _scaleController.InitializeDocument(_doc.Scale); _colorProviderController = new ColorProviderController(newColorProvider => _doc.ColorProvider = newColorProvider) { UseDocumentCopy = UseDocument.Directly }; _colorProviderController.InitializeDocument(_doc.ColorProvider); } if (_view != null) { _scaleController.ViewObject = _view.DensityScaleView; _colorProviderController.ViewObject = _view.ColorProviderView; _view.ClipToLayer = _doc.ClipToLayer; } }
protected override void Initialize(bool initData) { base.Initialize(initData); if (initData) { _scaleController = new DensityScaleController(newScale => _doc.ColorScale = (NumericalScale)newScale) { UseDocumentCopy = UseDocument.Directly }; _scaleController.InitializeDocument(_doc.ColorScale ?? new LinearScale()); _colorProviderController = new ColorProviderController(newColorProvider => _doc.ColorProvider = newColorProvider) { UseDocumentCopy = UseDocument.Directly }; _colorProviderController.InitializeDocument(_doc.ColorProvider); _materialController = new MaterialController() { UseDocumentCopy = UseDocument.Directly }; _materialController.InitializeDocument(_doc.Material); } if (_view != null) { _scaleController.ViewObject = _view.ColorScaleView; _view.IsCustomColorScaleUsed = null != _doc.ColorScale; _colorProviderController.ViewObject = _view.ColorProviderView; if (null == _materialController.ViewObject) _materialController.ViewObject = _view.MaterialViewObject; _view.ClipToLayer = _doc.ClipToLayer; } }
private void CreateSubController() { if (_doc is ItemLocationDirect) { ItemLocationDirectController ctrl; _subController = ctrl = new ItemLocationDirectController() { UseDocumentCopy = UseDocument.Directly }; if (IsRootLayerPosition) { ctrl.ShowAnchorElements(false, false); ctrl.ShowPositionElements(false, false); } _subController.InitializeDocument(_doc, _layer.ParentLayerSize); } else if (_doc is ItemLocationByGrid) { if (null == _layer.ParentLayer) { throw new InvalidOperationException("This should not be happen; the calling routine must ensure that ItemLocationDirect is used when no parent layer is present"); } _layer.ParentLayer.CreateGridIfNullOrEmpty(); _subController = new ItemLocationByGridController() { UseDocumentCopy = UseDocument.Directly }; _subController.InitializeDocument(_doc, _layer.ParentLayer.Grid); } Current.Gui.FindAndAttachControlTo(_subController); }
protected override void Initialize(bool initData) { base.Initialize(initData); if (initData) { // Label sides _labelSides = new Collections.SelectableListNodeList { new Collections.SelectableListNode("Automatic", null, null == _doc.LabelSide) }; var list = new List <Collections.SelectableListNode>(); if (_doc.CachedAxisInformation != null) { list.Add(new Collections.SelectableListNode(_doc.CachedAxisInformation.NameOfFirstDownSide, CSAxisSide.FirstDown, _doc.LabelSide == CSAxisSide.FirstDown)); list.Add(new Collections.SelectableListNode(_doc.CachedAxisInformation.NameOfFirstUpSide, CSAxisSide.FirstUp, _doc.LabelSide == CSAxisSide.FirstUp)); } list.Sort((x, y) => string.Compare(x.Text, y.Text)); _labelSides.AddRange(list); // horizontal and vertical alignment _alignmentChoicesX = new Collections.SelectableListNodeList(_doc.AlignmentX); _alignmentChoicesY = new Collections.SelectableListNodeList(_doc.AlignmentY); _alignmentChoicesZ = new Collections.SelectableListNodeList(_doc.AlignmentZ); // label formatting type var labelTypes = Altaxo.Main.Services.ReflectionService.GetNonAbstractSubclassesOf(typeof(Altaxo.Graph.Graph3D.LabelFormatting.ILabelFormatting)); _labelStyles = new Collections.SelectableListNodeList(); for (int i = 0; i < labelTypes.Length; ++i) { _labelStyles.Add(new Collections.SelectableListNode(labelTypes[i].Name, labelTypes[i], labelTypes[i] == _doc.LabelFormat.GetType())); } _labelFormattingSpecificController = (IMVCANController)Current.Gui.GetControllerAndControl(new object[] { _doc.LabelFormat }, typeof(IMVCANController), UseDocument.Directly); } if (null != _view) { _view.LabelFont = _doc.Font; _view.LabelMaterial = _doc.Brush; _view.AlignmentX_Initialize(_alignmentChoicesX); _view.AlignmentY_Initialize(_alignmentChoicesY); _view.AlignmentZ_Initialize(_alignmentChoicesY); _view.AutomaticAlignment = _doc.AutomaticAlignment; _view.RotationX = _doc.RotationX; _view.RotationY = _doc.RotationY; _view.RotationZ = _doc.RotationZ; _view.OffsetX = _doc.OffsetX; _view.OffsetY = _doc.OffsetY; _view.OffsetZ = _doc.OffsetZ; _view.Background = _doc.BackgroundStyle; _view.SuppressedLabelsByValue = GUIConversion.ToString(_doc.SuppressedLabels.ByValues); _view.SuppressedLabelsByNumber = GUIConversion.ToString(_doc.SuppressedLabels.ByNumbers); _view.PrefixText = _doc.PrefixText; _view.PostfixText = _doc.SuffixText; _view.LabelSides = _labelSides; _view.LabelStyle_Initialize(_labelStyles); _view.LabelFormattingSpecificGuiControl = null == _labelFormattingSpecificController ? null : _labelFormattingSpecificController.ViewObject; } }
protected override void Initialize(bool initData) { base.Initialize(initData); if (initData) { _itemList = new SelectableListNodeList(); foreach (var d in _doc.GroupedObjects) { var node = new SelectableListNode(d.GetType().ToString(), d, false); _itemList.Add(node); } _locationController = (IMVCANController)Current.Gui.GetController(new object[] { _doc.Location }, typeof(IMVCANController), UseDocument.Directly); Current.Gui.FindAndAttachControlTo(_locationController); } if (_view != null) { _view.InitializeItemList(_itemList); _view.LocationView = _locationController.ViewObject; } }
public void AnnounceEnabledChanged(bool enableState) { if (true == enableState && null == _controller) { if (null == _controller) { TModel document = _creationAction(); _controller = _controllerCreationAction(document, _useDocumentCopy); if (null != _view) { _view.ConditionalView = _controller.ViewObject; } } } else if (false == enableState && null != _controller) // view is disabled { _removalAction(); _controller = null; if (null != _view) { _view.ConditionalView = null; } } if (null != _view) { _view.IsConditionalViewEnabled = enableState; } }
protected override void Initialize(bool initData) { base.Initialize(initData); if (initData) { _dataController = new DecomposeByColumnContentDataController() { UseDocumentCopy = UseDocument.Directly }; _dataController.InitializeDocument(_doc.Data); _optionsController = new DecomposeByColumnContentOptionsController { UseDocumentCopy = UseDocument.Directly }; _optionsController.InitializeDocument(_doc.Options); Current.Gui.FindAndAttachControlTo(_dataController); Current.Gui.FindAndAttachControlTo(_optionsController); } if (null != _view) { _view.SetDataControl(_dataController.ViewObject); _view.SetOptionsControl(_optionsController.ViewObject); } }
protected override void Initialize(bool initData) { base.Initialize(initData); if (initData) { _binningTypes.Clear(); var binningTypes = Altaxo.Main.Services.ReflectionService.GetNonAbstractSubclassesOf(typeof(IBinning)); foreach (var type in binningTypes) { _binningTypes.Add(new SelectableListNode(type.ToString(), type, type == _doc.CreationOptions.Binning.GetType())); } if (null != _binningController) { _binningController.Dispose(); _binningController = null; } _binningController = (IMVCANController)Current.Gui.GetControllerAndControl(new object[] { _doc.CreationOptions.Binning }, typeof(IMVCANController), UseDocument.Directly); } if (null != _view) { _view.Errors = _doc.Errors; _view.Warnings = _doc.Warnings; _view.NumberOfValuesOriginal = _doc.NumberOfValuesOriginal; _view.NumberOfValuesFiltered = _doc.NumberOfValuesFiltered; _view.NumberOfNaNValues = _doc.NumberOfNaNValues; _view.NumberOfInfiniteValues = _doc.NumberOfInfiniteValues; _view.MinimumValue = _doc.MinimumValue; _view.MaximumValue = _doc.MaximumValue; _view.IgnoreNaNValues = _doc.CreationOptions.IgnoreNaN; _view.IgnoreInfiniteValues = _doc.CreationOptions.IgnoreInfinity; _view.IgnoreValuesBelowLowerBoundary = _doc.CreationOptions.LowerBoundaryToIgnore.HasValue; _view.IsLowerBoundaryInclusive = _doc.CreationOptions.IsLowerBoundaryInclusive; if (_doc.CreationOptions.LowerBoundaryToIgnore.HasValue) { _view.LowerBoundary = _doc.CreationOptions.LowerBoundaryToIgnore.Value; } _view.IgnoreValuesAboveUpperBoundary = _doc.CreationOptions.UpperBoundaryToIgnore.HasValue; _view.IsUpperBoundaryInclusive = _doc.CreationOptions.IsUpperBoundaryInclusive; if (_doc.CreationOptions.UpperBoundaryToIgnore.HasValue) { _view.UpperBoundary = _doc.CreationOptions.UpperBoundaryToIgnore.Value; } _view.BinningType = _binningTypes; _view.UseAutomaticBinning = !_doc.CreationOptions.IsUserDefinedBinningType; _view.BinningView = _binningController.ViewObject; } }
public override IEnumerable <ControllerAndSetNullMethod> GetSubControllers() { yield return(new ControllerAndSetNullMethod(_dataSourceOptionsController, () => _dataSourceOptionsController = null)); yield return(new ControllerAndSetNullMethod(_fourierTransformationOptionsController, () => _fourierTransformationOptionsController = null)); yield return(new ControllerAndSetNullMethod(_inputDataController, () => _inputDataController = null)); }
public override IEnumerable <ControllerAndSetNullMethod> GetSubControllers() { yield return(new ControllerAndSetNullMethod(_layerPositionController, () => _layerPositionController = null)); yield return(new ControllerAndSetNullMethod(_layerGraphItemsController, () => _layerGraphItemsController = null)); yield return(new ControllerAndSetNullMethod(_layerGridController, () => _layerGridController = null)); }
private void InitializeDataView() { _dataController = new XYZMeshedColumnPlotDataController { UseDocumentCopy = UseDocument.Directly }; _dataController.InitializeDocument(_doc.Data); Current.Gui.FindAndAttachControlTo(_dataController); _innerController.AddTab("Data", _dataController, _dataController.ViewObject); }
public override IEnumerable <ControllerAndSetNullMethod> GetSubControllers() { yield return(new ControllerAndSetNullMethod(_grid1, () => _grid1 = null)); yield return(new ControllerAndSetNullMethod(_grid2, () => _grid2 = null)); yield return(new ControllerAndSetNullMethod(_background, () => _background = null)); yield return(new ControllerAndSetNullMethod(_innerController, () => _innerController = null)); }
private void InitializeOptionView() { _optionsController = new Gdi.Plot.DensityImagePlotItemOptionController() { UseDocumentCopy = UseDocument.Directly }; _optionsController.InitializeDocument(_doc); Current.Gui.FindAndAttachControlTo(_optionsController); _innerController.AddTab("Options", _optionsController, _optionsController.ViewObject); }
public override IEnumerable <ControllerAndSetNullMethod> GetSubControllers() { yield return(new ControllerAndSetNullMethod(_styleController, () => _styleController = null)); yield return(new ControllerAndSetNullMethod(_optionsController, () => _optionsController = null)); yield return(new ControllerAndSetNullMethod(_dataController, () => _dataController = null)); yield return(new ControllerAndSetNullMethod(_innerController, () => _innerController = null)); }
private void SetCurrentTabController(bool pageChanged) { switch (_currentPageName) { case "GraphicItems": if (pageChanged) { _view.SelectTab(_currentPageName); } if (null == _layerGraphItemsController) { _layerGraphItemsController = (IMVCANController)Current.Gui.GetControllerAndControl(new object[] { _doc.GraphObjects }, typeof(IMVCANController), UseDocument.Directly); } _currentController = _layerGraphItemsController; _view.CurrentContent = _currentController.ViewObject; break; case "Position": if (pageChanged) { _view.SelectTab(_currentPageName); } if (null == _layerPositionController) { _layerPositionController = new LayerPositionController() { UseDocumentCopy = UseDocument.Directly }; _layerPositionController.InitializeDocument(_doc.Location, _doc); Current.Gui.FindAndAttachControlTo(_layerPositionController); } _currentController = _layerPositionController; _view.CurrentContent = _layerPositionController.ViewObject; break; case "HostGrid": if (pageChanged) { _view.SelectTab(_currentPageName); } if (null == _layerGridController) { _layerGridController = new GridPartitioningController() { UseDocumentCopy = UseDocument.Directly }; _layerGridController.InitializeDocument(_doc.Grid, _doc); Current.Gui.FindAndAttachControlTo(_layerGridController); } _currentController = _layerGridController; _view.CurrentContent = _layerGridController.ViewObject; break; } }
public bool InitializeDocument(params object[] args) { if (null == args || args.Length == 0 || !(args[0] is TModel)) { return(false); } _controller = _controllerCreationAction((TModel)args[0], _useDocumentCopy); Initialize(true); return(true); }
private void EhSeparationStrategyChanged() { var selNode = _separationStrategyList.FirstSelectedNode; if (null == selNode) { return; } var sepType = (Type)selNode.Tag; if (null != _doc.SeparationStrategy && _doc.SeparationStrategy.GetType() == sepType && null != _separationStrategyInstanceController) { return; } if (_separationStrategyInstanceController != null) { if (_separationStrategyInstanceController.Apply(false)) { var oldSep = (IAsciiSeparationStrategy)_separationStrategyInstanceController.ModelObject; _separationStrategyInstances[oldSep.GetType()] = oldSep; } } IAsciiSeparationStrategy sep; if (_separationStrategyInstances.ContainsKey(sepType)) { sep = _separationStrategyInstances[sepType]; } else { sep = (IAsciiSeparationStrategy)System.Activator.CreateInstance((Type)selNode.Tag); _separationStrategyInstances.Add(sep.GetType(), sep); } _doc.SeparationStrategy = sep; _separationStrategyInstanceController = (IMVCANController)Current.Gui.GetController(new object[] { sep }, typeof(IMVCANController)); object view = null; if (null != _separationStrategyInstanceController) { Current.Gui.FindAndAttachControlTo(_separationStrategyInstanceController); view = _separationStrategyInstanceController.ViewObject; } if (null != _view) { _view.AsciiSeparationStrategyDetailView = view; } }
protected override void Initialize(bool initData) { base.Initialize(initData); if (initData) { _dataProxyController = (IMVCANController)Current.Gui.GetControllerAndControl(new object[] { _doc.DataTableMatrix }, typeof(IMVCANController), UseDocument.Directly); } if (null != _view) { _view.SetDataView(_dataProxyController.ViewObject); } }
private void Initialize(bool initData) { if (initData) { _dataController = new MasterCurveCreationDataController(); _dataController.InitializeDocument(_doc.ColumnGroups); Current.Gui.FindAndAttachControlTo(_dataController); } if (null != _view) { _view.InitializeDataTab(_dataController.ViewObject); } }
private void InitializeStyleControllerList() { // Clear the previous controller cache _styleControllerList.Clear(); // start to create new controllers for (int i = 0; i < _doc.Style.Count; i++) { IMVCANController ctrl = GetStyleController(_doc.Style[i]); _styleControllerList.Add(ctrl); } _dataController.SetAdditionalPlotColumns(GetAdditionalColumns()); }
public void EhView_LabelStyleChanged() { var type = (System.Type)_labelStyles.FirstSelectedNode.Tag; if (_doc.LabelFormat.GetType() != type) { _doc.LabelFormat = (Altaxo.Graph.Graph3D.LabelFormatting.ILabelFormatting)Activator.CreateInstance(type); _labelFormattingSpecificController = (IMVCANController)Current.Gui.GetControllerAndControl(new object[] { _doc.LabelFormat }, typeof(IMVCANController), UseDocument.Directly); if (null != _view) { _view.LabelFormattingSpecificGuiControl = null == _labelFormattingSpecificController ? null : _labelFormattingSpecificController.ViewObject; } } }
protected override void Initialize(bool initData) { base.Initialize(initData); if (initData) { _locationController = (IMVCANController)Current.Gui.GetController(new object[] { _doc.Location }, typeof(IMVCANController), UseDocument.Directly); Current.Gui.FindAndAttachControlTo(_locationController); } if (_view != null) { _view.DocPen = _doc.Pen; _view.LocationView = _locationController.ViewObject; } }
IMVCANController GetStyleController(IG2DPlotStyle style) { if (_styleControllerDictionary.ContainsKey(style)) { return(_styleControllerDictionary[style]); } IMVCANController ct = (IMVCANController)Current.Gui.GetControllerAndControl(new object[] { style }, typeof(IMVCANController), UseDocument.Directly); if (ct != null) { _styleControllerDictionary.Add(style, ct); } return(ct); }
protected override void Initialize(bool initData) { base.Initialize(initData); if (initData) { //_doc.SourceFileName _commonImportOptionsController = (IMVCANController)Current.Gui.GetControllerAndControl(new object[] { _doc.ImportOptions }, typeof(IMVCANController), UseDocument.Directly); _specificImportOptionsController = (IMVCANController)Current.Gui.GetControllerAndControl(new object[] { _doc.AsciiImportOptions, new AsciiImportOptionsAnalysisDataProvider(this) }, typeof(IMVCANController), UseDocument.Directly); _specificImportSourceController = new MultipleFilesController(); _specificImportSourceController.InitializeDocument(_doc.SourceFileNames); Current.Gui.FindAndAttachControlTo(_specificImportSourceController); } if (null != _view) { } }
protected override void Initialize(bool initData) { base.Initialize(initData); if (initData) { if (null == _groupStyles && null != _doc.ParentCollection) { _groupStyles = _doc.ParentCollection.GroupStyles; } var plotGroupController = new PlotGroupCollectionController(); plotGroupController.InitializeDocument(_groupStyles); plotGroupController.GroupStyleChanged += new WeakActionHandler(EhPlotGroupChanged, (handler) => plotGroupController.GroupStyleChanged -= handler); _plotGroupController = plotGroupController; // find the style collection controller _styleCollectionController = (IXYPlotStyleCollectionController)Current.Gui.GetControllerAndControl(new object[] { _doc.Style }, typeof(IXYPlotStyleCollectionController), UseDocument.Directly); _styleCollectionController.CollectionChangeCommit += new EventHandler(_styleCollectionController_CollectionChangeCommit); _styleCollectionController.StyleEditRequested += new Action <int>(_styleCollectionController_StyleEditRequested); // Initialize the data controller _dataController = (IMVCANController)Current.Gui.GetControllerAndControl(new object[] { _doc.DataObject, _doc }, typeof(IMVCANController), UseDocument.Directly); // Initialize the style controller list InitializeStyleControllerList(); } if (null != _view) { if (null == _plotGroupController.ViewObject) { Current.Gui.FindAndAttachControlTo(_plotGroupController); } _view.SetPlotGroupCollectionView(_plotGroupController.ViewObject); // add the style controller _view.SetPlotStyleView(_styleCollectionController.ViewObject); View_SetAllTabViews(); } }
public void AnnounceEnabledChanged(bool enableState) { _isInEnabledState = enableState; if (enableState) { if (null != _controllerForEnabledState) { _view.ConditionalView = _controllerForEnabledState.ViewObject; } else // document and controller have to be constructed { TModel document = _documentCreationActionForEnabledState(); _controllerForEnabledState = _controllerCreationAction(document, _useDocumentCopy); if (null != _view) { _view.ConditionalView = _controllerForEnabledState.ViewObject; } } } else // disabled { if (null != _controllerForDisabledState) { _view.ConditionalView = _controllerForDisabledState.ViewObject; } else // document and controller have to be constructed { TModel document = _documentCreationActionForDisabledState(); _controllerForDisabledState = _controllerCreationAction(document, _useDocumentCopy); if (null != _view) { _view.ConditionalView = _controllerForEnabledState.ViewObject; } } } if (null != _view) { _view.IsConditionalViewEnabled = enableState; } }
/// <summary> /// Initialize the controller with the document. If successfull, the function has to return true. /// Here, you can give two arguments. The first is the document for the enabled state, the second is the document to show in the disabled state. /// </summary> /// <param name="args">The arguments neccessary to create the controller. Normally, the first argument is the document, the second can be the parent of the document and so on.</param> /// <returns> /// Returns <see langword="true" /> if successfull; otherwise <see langword="false" />. /// </returns> public bool InitializeDocument(params object[] args) { if (null != args && args.Length >= 1 && null != args[0] && (args[0] is TModel)) { _controllerForEnabledState = _controllerCreationAction((TModel)args[0], _useDocumentCopy); _isInEnabledState = true; } else { _isInEnabledState = false; } if (null != args && args.Length >= 2 && null != args[1] && (args[1] is TModel)) { _controllerForDisabledState = _controllerCreationAction((TModel)args[1], _useDocumentCopy); } Initialize(true); return(true); }
protected override void Initialize(bool initData) { base.Initialize(initData); if (initData) { _dataSourceOptionsController = (IMVCANController)Current.Gui.GetControllerAndControl(new object[] { _doc.ImportOptions }, typeof(IMVCANController), UseDocument.Directly); _fourierTransformationOptionsController = (IMVCANController)Current.Gui.GetControllerAndControl(new object[] { _doc.FourierTransformation2DOptions }, typeof(IMVCANController), UseDocument.Directly); _inputDataController = (IMVCANController)Current.Gui.GetControllerAndControl(new object[] { _doc.InputData }, typeof(IMVCANController), UseDocument.Directly); } if (null != _view) { _view.SetImportOptionsControl(_dataSourceOptionsController.ViewObject); _view.SetFourierTransformation2DOptionsControl(_fourierTransformationOptionsController.ViewObject); if (null != _inputDataController) { _view.SetInputDataControl(_inputDataController.ViewObject); } } }
protected override void Initialize(bool initData) { base.Initialize(initData); if (initData) { _grid1 = new XYGridStyleController() { UseDocumentCopy = UseDocument.Directly }; _grid1.InitializeDocument(_doc.GridStyleFirst ?? new GridStyle() { ShowGrid = false }); Current.Gui.FindAndAttachControlTo(_grid1); var c1 = new ControlViewElement(GridName(_doc.PlaneID.InPlaneAxisNumber1), _grid1, _grid1.ViewObject); _grid2 = new XYGridStyleController() { UseDocumentCopy = UseDocument.Directly }; _grid2.InitializeDocument(_doc.GridStyleSecond ?? new GridStyle() { ShowGrid = false }); Current.Gui.FindAndAttachControlTo(_grid2); var c2 = new ControlViewElement(GridName(_doc.PlaneID.InPlaneAxisNumber2), _grid2, _grid2.ViewObject); _background = new BrushControllerAdvanced() { UseDocumentCopy = UseDocument.Directly }; _background.InitializeDocument(_doc.Background ?? BrushX.Empty); Current.Gui.FindAndAttachControlTo(_background); var c3 = new ControlViewElement("Background", _background, _background.ViewObject); _innerController = new MultiChildController(new ControlViewElement[] { c1, c2, c3 }, false); } }
void InitializeStyle() { _styleController = (IMVCANController)Current.Gui.GetControllerAndControl(new object[] { _tempdoc.Style }, typeof(IMVCANController), UseDocument.Directly); this.AddTab("Style", _styleController, _styleController.ViewObject); }
void InitializeStyles() { // Clear the previous controller cache _additionalPlotStyle = null; if (_combinedScatterLineGroupController != null) { _combinedScatterLineGroupController.ChildControlChanged -= EhView_ActiveChildControlChanged; _combinedScatterLineGroupController = null; } _styleControllerList.Clear(); // start to create new controllers if (_tempdoc.Style.Count > 0) { bool addHelperStyle = NeedsHelperStyle(); bool useCombinedTab = UseCombinedScatterLineGroupTab(); if (useCombinedTab) { List<ControlViewElement> combList = new List<ControlViewElement>(); // create the controllers IMVCANController ct1 = GetStyleController(_tempdoc.Style[0]); _styleControllerList.Add(ct1); if (addHelperStyle) { IPlotArea layer = Main.DocumentPath.GetRootNodeImplementing<IPlotArea>(_doc); // add either line or scatter if (_tempdoc.Style[0] is LinePlotStyle) { ScatterPlotStyle scatterStyle = new ScatterPlotStyle(); scatterStyle.ParentObject = _tempdoc.Style; _tempdoc.Style.PrepareNewSubStyle(scatterStyle, layer, _doc.GetRangesAndPoints(layer)); _additionalPlotStyle = scatterStyle; scatterStyle.Shape = Altaxo.Graph.Gdi.Plot.Styles.XYPlotScatterStyles.Shape.NoSymbol; _additionalPlotStyleController = GetStyleController( _additionalPlotStyle); combList.Add(new ControlViewElement("Symbol", _additionalPlotStyleController)); combList.Add(new ControlViewElement("Line", ct1)); } else { LinePlotStyle lineStyle = new LinePlotStyle(); lineStyle.ParentObject = _tempdoc.Style; _tempdoc.Style.PrepareNewSubStyle(lineStyle, layer, _doc.GetRangesAndPoints(layer)); _additionalPlotStyle = lineStyle; lineStyle.Connection = Altaxo.Graph.Gdi.Plot.Styles.XYPlotLineStyles.ConnectionStyle.NoLine; _additionalPlotStyleController = GetStyleController( _additionalPlotStyle ); combList.Add(new ControlViewElement("Symbol", ct1)); combList.Add(new ControlViewElement("Line", _additionalPlotStyleController)); } } else // no helper style, i.e. second style is line style { // create the controllers IMVCANController ct2 = GetStyleController( _tempdoc.Style[1] ); _styleControllerList.Add(ct2); combList.Add(new ControlViewElement("Symbol", ct1)); combList.Add(new ControlViewElement("Line", ct2)); } combList.Add(new ControlViewElement(string.Empty, this, this._plotGroupView)); _combinedScatterLineGroupController = new Common.MultiChildController(combList.ToArray(), true); Current.Gui.FindAndAttachControlTo(_combinedScatterLineGroupController); string title; if(null!=_additionalPlotStyle) title = string.Format("#{0}:{1}", 1, Current.Gui.GetUserFriendlyClassName(_tempdoc.Style[0].GetType())); else title = "#1&&2:Symbol&&Line"; AddTab(title, _combinedScatterLineGroupController, _combinedScatterLineGroupController.ViewObject); _combinedScatterLineGroupController.ChildControlChanged += this.EhView_ActiveChildControlChanged; } // if use CombinedTab // now the remaining styles int start = useCombinedTab ? (addHelperStyle ? 1 : 2) : 0; for (int i = start; i < _tempdoc.Style.Count; i++) { IMVCANController ctrl = GetStyleController( _tempdoc.Style[i] ); _styleControllerList.Add(ctrl); string title = string.Format("#{0}:{1}", (i + 1),Current.Gui.GetUserFriendlyClassName(_tempdoc.Style[i].GetType())); AddTab(title, ctrl, ctrl != null ? ctrl.ViewObject : null); } } base.SetElements(false); }
public NonlinearFitController(NonlinearFitDocument doc) { _doc = doc; _parameterController = (IMVCANController)Current.Gui.GetControllerAndControl(new object[] { _doc.CurrentParameters }, typeof(IMVCANController)); _fitEnsembleController = (IFitEnsembleController)Current.Gui.GetControllerAndControl(new object[] { _doc.FitEnsemble }, typeof(IFitEnsembleController)); _funcselController = new FitFunctionSelectionController(_doc.FitEnsemble.Count == 0 ? null : _doc.FitEnsemble[0].FitFunction); Current.Gui.FindAndAttachControlTo(_funcselController); { var fitEnsemble = _doc.FitEnsemble; fitEnsemble.Changed += new WeakEventHandler(EhFitEnsemble_Changed, handler => fitEnsemble.Changed -= handler); } _generationInterval = new Common.EquallySpacedInterval(); _generationIntervalController = new Common.EquallySpacedIntervalController(); _generationIntervalController.InitializeDocument(_generationInterval); }
private void EhAxisStyleControllerDirty(IMVCANController ctrl) { MajorLabelCondController.AnnounceEnabledChanged(_doc[AxisInformation.Identifier].AreMajorLabelsEnabled); MinorLabelCondController.AnnounceEnabledChanged(_doc[AxisInformation.Identifier].AreMinorLabelsEnabled); }
void MakeAdditionalPlotStylePermanent() { IG2DPlotStyle additionalPlotStyle = _additionalPlotStyle; _additionalPlotStyle = null; if (additionalPlotStyle is LinePlotStyle) { _tempdoc.Style.Insert(1, additionalPlotStyle); _styleControllerList.Insert(1, _additionalPlotStyleController); _additionalPlotStyleController = null; DistributeStyleChange(1); _styleCollectionController.InitializeDocument(_tempdoc.Style); } else if(additionalPlotStyle is ScatterPlotStyle) { _tempdoc.Style.Insert(0, additionalPlotStyle); _styleControllerList.Insert(0, _additionalPlotStyleController); _additionalPlotStyleController = null; DistributeStyleChange(0); _styleCollectionController.InitializeDocument(_tempdoc.Style); } }
private void EhAxisStyleControllerDirty(IMVCANController ctrl) { MajorLabelCondController.AnnounceEnabledChanged(_doc.AreMajorLabelsEnabled); MinorLabelCondController.AnnounceEnabledChanged(_doc.AreMinorLabelsEnabled); }