Exemple #1
0
        public override bool Apply(bool disposeController)
        {
            if (null != _detailController)
            {
                if (!_detailController.Apply(disposeController))
                {
                    return(false);
                }
            }

            _doc = (IColorProvider)_detailController.ModelObject;

            return(ApplyEnd(true, disposeController));
        }
        public override bool Apply(bool disposeController)
        {
            if (null != _scaleController && false == _scaleController.Apply(disposeController))
            {
                return(false);
            }

            if (null != _linkedScaleParameterController && false == _linkedScaleParameterController.Apply(disposeController))
            {
                return(false);
            }

            if (null != _rescalingController && false == _rescalingController.Apply(disposeController))
            {
                return(false);
            }

            if (null != _tickSpacingController && false == _tickSpacingController.Apply(disposeController))
            {
                return(false);
            }

            var lscale = _doc as LinkedScale;

            if (null != lscale)
            {
                lscale.LinkScaleType   = _view.LinkScaleType;
                lscale.LinkTickSpacing = _view.LinkTickSpacing;
            }

            return(ApplyEnd(true, disposeController)); // all ok
        }
Exemple #3
0
        public bool Apply()
        {
            // note: the order is essential here
            // first set the axis in the layer, _then_ apply the RescaleConditions

            m_Layer.LinkedScales.SetScale(m_axisNumber, _tempAxis);

            if (null != m_ScaleController)
            {
                if (false == m_ScaleController.Apply())
                {
                    return(false);
                }
            }

            if (null != m_BoundaryController)
            {
                if (false == m_BoundaryController.Apply())
                {
                    return(false);
                }
            }



            SetElements();



            return(true); // all ok
        }
        private bool ApplyCurrentController(bool force)
        {
            if (_currentController == null)
            {
                return(true);
            }

            if (!force && object.ReferenceEquals(_currentController, _lastControllerApplied))
            {
                return(true);
            }

            if (!_currentController.Apply(false))
            {
                return(false);
            }
            _lastControllerApplied = _currentController;

            if (object.ReferenceEquals(_currentController, _coordinateController))
            {
                //_doc.CoordinateSystem = (G2DCoordinateSystem)_coordinateController.ModelObject;
                SetCoordinateSystemDependentObjects();
            }
            else if (object.ReferenceEquals(_currentController, _layerPositionController))
            {
                _doc.Location.CopyFrom((IItemLocation)_currentController.ModelObject);
            }

            return(true);
        }
Exemple #5
0
        private bool ApplyCurrentController(bool force, bool disposeController)
        {
            if (_currentController == null)
            {
                return(true);
            }

            if (!force && object.ReferenceEquals(_currentController, _lastControllerApplied))
            {
                return(true);
            }

            if (!_currentController.Apply(disposeController))
            {
                return(false);
            }

            if (object.ReferenceEquals(_currentController, _layerPositionController))
            {
                _doc.Location = (IItemLocation)_currentController.ModelObject;
            }

            _lastControllerApplied = _currentController;

            return(true);
        }
        public bool Apply()
        {
            // read axis title
            _doc.TitleText = m_View.AxisTitle;

            if (null != _axisLineStyleController)
            {
                if (!_axisLineStyleController.Apply())
                {
                    return(false);
                }
                else
                {
                    _doc.AxisLineStyle = (AxisLineStyle)_axisLineStyleController.ModelObject;
                }
            }

            _doc.ShowMajorLabels = m_View.ShowMajorLabels;
            _doc.ShowMinorLabels = m_View.ShowMinorLabels;

            // if we have offset applying, create a brand new AxisStyle instance
            double offset = m_View.PositionOffset / 100;

            if (0 != offset)
            {
                AxisStyle newDoc = new AxisStyle(CSLineID.FromIDandFirstLogicalOffset(_doc.StyleID, offset));
                newDoc.CopyWithoutIdFrom(_doc);
                _doc = newDoc;
            }


            return(true); // all ok
        }
        public override bool Apply(bool disposeController)
        {
            if (null != _tickSpacingController && false == _tickSpacingController.Apply(disposeController))
            {
                return(false);
            }

            return(ApplyEnd(true, disposeController));
        }
Exemple #8
0
        public bool Apply()
        {
            bool result = _instanceController == null || _instanceController.Apply();

            if (true == result)
            {
                _doc = _tempdoc;
            }
            return(result);
        }
        public override bool Apply(bool disposeController)
        {
            bool result = _instanceController == null || _instanceController.Apply(disposeController);

            if (result == true && null != _instanceController)
            {
                _doc = (G3DCoordinateSystem)_instanceController.ModelObject;
            }

            return(ApplyEnd(result, disposeController));
        }
        private bool ApplyCurrentController(bool force, bool disposeCurrentController)
        {
            if (_currentController == null)
            {
                return(true);
            }

            if (!force && object.ReferenceEquals(_currentController, _lastControllerApplied))
            {
                return(true);
            }

            if (!_currentController.Apply(disposeCurrentController))
            {
                return(false);
            }
            _lastControllerApplied = _currentController;

            if (object.ReferenceEquals(_currentController, _coordinateController))
            {
                var oldCoordinateSystem = _doc.CoordinateSystem;
                var newCoordinateSystem = (G3DCoordinateSystem)_coordinateController.ModelObject;

                if (oldCoordinateSystem is G3DCartesicCoordinateSystem && newCoordinateSystem is G3DCartesicCoordinateSystem)
                {
                    // before we officially changing the new coordinate system, we change the axis positions
                    _doc.AxisStyles.UpdateCoordinateSystemKeepingAxisPositions(
                        newCoordinateSystem,
                        oldAxisLineID => G3DCartesicCoordinateSystem.FindCorrespondingCSLineIDWhenChangingCoordinateSystem((G3DCartesicCoordinateSystem)oldCoordinateSystem, oldAxisLineID, (G3DCartesicCoordinateSystem)newCoordinateSystem),
                        (oldAxisLineID, oldAxisSide, newAxisLineID) => G3DCartesicCoordinateSystem.FindCorrespondingAxisSideWhenChangingCoordinateSystem((G3DCartesicCoordinateSystem)oldCoordinateSystem, oldAxisLineID, oldAxisSide, (G3DCartesicCoordinateSystem)newCoordinateSystem, newAxisLineID)
                        );
                }
                _doc.CoordinateSystem = newCoordinateSystem;
                SetCoordinateSystemDependentObjects();
            }

            if (object.ReferenceEquals(_currentController, _layerPositionController))
            {
                _doc.Location = (IItemLocation)_currentController.ModelObject;
            }
            else if (_currentPageName == "GridStyle")
            {
                var gp = (GridPlane)_currentController.ModelObject;
                _doc.GridPlanes[_currentPlaneID] = gp.IsUsed ? gp : null;
            }

            return(true);
        }
Exemple #11
0
        public override bool Apply(bool disposeController)
        {
            // read axis title
            _doc.TitleText = _view.AxisTitle;

            if (null != _axisLineStyleController)
            {
                if (!_axisLineStyleController.Apply(disposeController))
                {
                    return(false);
                }
                else
                {
                    _doc.AxisLineStyle = (AxisLineStyle)_axisLineStyleController.ModelObject;
                }
            }

            if (_view.ShowMajorLabels)
            {
                _doc.ShowMajorLabels(_context);
            }
            else
            {
                _doc.HideMajorLabels();
            }

            if (_view.ShowMinorLabels)
            {
                _doc.ShowMinorLabels(_context);
            }
            else
            {
                _doc.HideMinorLabels();
            }

            if (_tickSpacingController != null && !_tickSpacingController.Apply(disposeController))
            {
                return(false);
            }
            if (_view.ShowCustomTickSpacing && null != _tickSpacingController)
            {
                _doc.TickSpacing = (Altaxo.Graph.Scales.Ticks.TickSpacing)_tickSpacingController.ModelObject;
            }

            return(ApplyEnd(true, disposeController)); // all ok
        }
        public bool Apply()
        {
            if (null != _interpolationDetailController && false == _interpolationDetailController.Apply())
            {
                return(false);
            }

            if (_view != null)
            {
                _doc.NumberOfPoints        = _numberOfPoints;
                _doc.XOrg                  = _xOrg;
                _doc.XEnd                  = _xEnd;
                _doc.InterpolationInstance = this._interpolationInstance;

                return(true);
            }

            return(true);
        }
        public bool Apply(bool disposeController)
        {
            if (null != _interpolationDetailController && false == _interpolationDetailController.Apply(disposeController))
            {
                return(false);
            }

            if (null == _interpolationInstance || null == _numberOfPoints || null == _xOrg || null == _xEnd)
            {
                return(false);
            }

            _doc.NumberOfPoints        = (int)_numberOfPoints;
            _doc.XOrg                  = (double)_xOrg;
            _doc.XEnd                  = (double)_xEnd;
            _doc.InterpolationInstance = _interpolationInstance;

            return(true);
        }
Exemple #14
0
        public override bool Apply(bool disposeController)
        {
            bool result = false;

            var node = _tabItemList.FirstSelectedNode;

            _currentlySelectedController = node == null ? null : node.Tag as IMVCAController;

            if (null != _currentlySelectedController)
            {
                result = _currentlySelectedController.Apply(disposeController);
            }

            if (result)
            {
                if (_currentlySelectedController == _entireTableQueryController)
                {
                    SelectionStatement = _entireTableQueryController.SelectionStatement;
                }
                else if (_currentlySelectedController == _queryDesignerController)
                {
                    SelectionStatement = _queryDesignerController.SelectionStatement;
                }
                else if (_currentlySelectedController == _arbitrarySqlQueryController)
                {
                    SelectionStatement = _arbitrarySqlQueryController.SelectionStatement;
                }
            }
            else
            {
                return(false);
            }

            if (_connectionStringValidIndicator.IsConnectionStringValid)
            {
                InsertConnectionStringAtBeginningOfList(_staticConnectionStringList, ConnectionString);
            }

            bool isValid = null != _doc.ConnectionString && !_doc.ConnectionString.IsEmpty && !string.IsNullOrEmpty(_doc.SelectionStatement);

            return(ApplyEnd(isValid, disposeController));
        }
Exemple #15
0
        public override bool Apply(bool disposeController)
        {
            if (null != _scaleController)
            {
                if (false == _scaleController.Apply(disposeController))
                {
                    return(false);
                }
            }

            if (null != _rescalingController)
            {
                if (false == _rescalingController.Apply(disposeController))
                {
                    return(false);
                }
            }

            return(ApplyEnd(true, disposeController));
        }
        private bool ApplyCurrentController(bool force, bool disposeCurrentController)
        {
            if (_currentController == null)
            {
                return(true);
            }

            if (!force && object.ReferenceEquals(_currentController, _lastControllerApplied))
            {
                return(true);
            }

            if (!_currentController.Apply(disposeCurrentController))
            {
                return(false);
            }
            _lastControllerApplied = _currentController;

            if (object.ReferenceEquals(_currentController, _coordinateController))
            {
                _doc.CoordinateSystem = (G2DCoordinateSystem)_coordinateController.ModelObject;
                SetCoordinateSystemDependentObjects();
            }

            if (object.ReferenceEquals(_currentController, _layerPositionController))
            {
                _doc.Location = (IItemLocation)_currentController.ModelObject;
            }
            else if (_currentPageName == "GridStyle")
            {
                var gp = (GridPlane)_currentController.ModelObject;
                _doc.GridPlanes[_currentPlaneID] = gp.IsUsed ? gp : null;
            }

            return(true);
        }
Exemple #17
0
        public override bool Apply(bool disposeController)
        {
            _doc.Position       = _view.DocPosition;
            _doc.ScaleNumber    = _view.ScaleNumber;
            _doc.ScaleSpanType  = _view.ScaleSpanType;
            _doc.ScaleSpanValue = _view.ScaleSpanValue;

            // Scale/ticks
            _doc.ScaleType = _view.ScaleSegmentType;
            if (null != _tickSpacingController && false == _tickSpacingController.Apply(disposeController))
            {
                return(false);
            }
            _doc.TickSpacing = _tempTickSpacing;

            // Title/format
            if (false == _axisStyleControllerGlue.AxisStyleController.Apply(disposeController))
            {
                return(false);
            }

            if (null != _axisStyleControllerGlue.MajorLabelCondController && false == _axisStyleControllerGlue.MajorLabelCondController.Apply(disposeController))
            {
                return(false);
            }

            if (null != _axisStyleControllerGlue.MinorLabelCondController && false == _axisStyleControllerGlue.MinorLabelCondController.Apply(disposeController))
            {
                return(false);
            }

            _doc.BackgroundPadding = _view.BackgroundPadding;
            _doc.Background        = _view.SelectedBackground;

            return(ApplyEnd(true, disposeController));
        }
Exemple #18
0
        bool ApplyCurrentController(bool force)
        {
            if (_currentController == null)
            {
                return(true);
            }

            if (!force && object.ReferenceEquals(_currentController, _lastControllerApplied))
            {
                return(true);
            }

            if (!_currentController.Apply())
            {
                return(false);
            }
            _lastControllerApplied = _currentController;

            if (object.ReferenceEquals(_currentController, _coordinateController))
            {
                _doc.CoordinateSystem = (G2DCoordinateSystem)_coordinateController.ModelObject;
                SetCoordinateSystemDependentObjects();
            }
            else if (_currentPageName == "TitleAndFormat")
            {
                // if we have enabled/disabled some items, we must update the enable states of the minor/major controllers
                AxisStyle axstyle = (AxisStyle)_currentController.ModelObject;
                if (_currentAxisID == axstyle.StyleID)
                {
                    _enableMajorLabels[axstyle.StyleID] = axstyle.ShowMajorLabels;
                    _enableMinorLabels[axstyle.StyleID] = axstyle.ShowMinorLabels;
                }
                else // than we have applied a position offset, and the old StyleID is no longer valid
                {
                    _doc.AxisStyles.Remove(_currentAxisID);
                    _doc.AxisStyles.Add(axstyle);
                    _currentAxisID = axstyle.StyleID; // take this for axstyle
                    SetCoordinateSystemDependentObjects();
                    SetEdgeSecondaryChoice();         // update left side list of choices
                    SetCurrentTabController(true);    // we must simulate a page change in order to update the title-format tab page
                }
            }
            else if (_currentPageName == "MajorLabels")
            {
                if (!_enableMajorLabels[_currentAxisID] && _doc.AxisStyles.Contains(_currentAxisID))
                {
                    _doc.AxisStyles[_currentAxisID].ShowMajorLabels = false;
                }
                if (_TitleFormatController.ContainsKey(_currentAxisID))
                {
                    _TitleFormatController.Remove(_currentAxisID);
                }
            }
            else if (_currentPageName == "MinorLabels")
            {
                if (!_enableMinorLabels[_currentAxisID] && _doc.AxisStyles.Contains(_currentAxisID))
                {
                    _doc.AxisStyles[_currentAxisID].ShowMinorLabels = false;
                }

                if (_TitleFormatController.ContainsKey(_currentAxisID))
                {
                    _TitleFormatController.Remove(_currentAxisID);
                }
            }
            else if (_currentPageName == "GridStyle")
            {
                GridPlane gp = (GridPlane)_currentController.ModelObject;
                this._doc.GridPlanes[_currentPlaneID] = gp.IsUsed ? gp : null;
            }

            return(true);
        }
Exemple #19
0
        public override bool Apply(bool disposeController)
        {
            bool result = _instanceController == null || _instanceController.Apply(disposeController);

            return(ApplyEnd(result, disposeController));
        }