Example #1
0
        private void ChangeDependentVariable()
        {
            switch (_currentMethod)
            {
            case EquallySpacedIntervalSpecificationMethod.StartEndCount:
                _interval = GetInterval();
                _view.InitializeInterval(GUIConversion.ToString(_interval));
                break;

            case EquallySpacedIntervalSpecificationMethod.StartEndInterval:
                _count = GetCount();
                _view.InitializeCount(GUIConversion.ToString(_count));
                break;

            case EquallySpacedIntervalSpecificationMethod.StartCountInterval:
                _end = GetEnd();
                _view.InitializeEnd(GUIConversion.ToString(_end));
                break;

            case EquallySpacedIntervalSpecificationMethod.EndCountInterval:
                _start = GetStart();
                _view.InitializeStart(GUIConversion.ToString(_start));
                break;

            default:
                throw new ArgumentException("method unknown");
            }
        }
Example #2
0
 public void InitializeMargins(double top, double left, double bottom, double right)
 {
     this._edTopMargin.Text    = GUIConversion.ToString(top);
     this._edBottomMargin.Text = GUIConversion.ToString(bottom);
     this._edRightMargin.Text  = GUIConversion.ToString(right);
     this._edLeftMargin.Text   = GUIConversion.ToString(left);
 }
Example #3
0
        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;
            }
        }
Example #4
0
 private void EhIntervalValidating(CancelEventArgs e)
 {
     if (_currentMethod == EquallySpacedIntervalSpecificationMethod.StartEndInterval)
     {
         if (((_end > _start) && _interval < 0) || ((_end < _start) && _interval > 0))
         {
             _interval = -_interval;
             _count    = GetCount();
         }
         RoundCountToIntegerAndAdjustInterval();
         _view.InitializeInterval(GUIConversion.ToString(_interval));
         _view.InitializeCount(GUIConversion.ToString(_count));
     }
 }
Example #5
0
        protected virtual void InitView()
        {
            _view.SetLabel1("Org:");
            _view.SetLabel2("End:");
            _view.SetLabel3("Span:");

            _view.SetChoice1(_choices, (int)_orgRescaling);
            _view.SetChoice2(_choices, (int)_endRescaling);
            _view.SetChoice3(_choices, (int)_spanRescaling);


            _view.SetValue1(GUIConversion.ToString(_org));
            _view.SetValue2(GUIConversion.ToString(_end));
            _view.SetValue3(GUIConversion.ToString(_span));

            SetEnableState();
        }
Example #6
0
        private void EhCountValidating(CancelEventArgs e)
        {
            switch (_currentMethod)
            {
            case EquallySpacedIntervalSpecificationMethod.StartCountInterval:
            case EquallySpacedIntervalSpecificationMethod.EndCountInterval:
                RoundCountToInteger();
                _view.InitializeCount(GUIConversion.ToString(_count));
                break;

            case EquallySpacedIntervalSpecificationMethod.StartEndCount:
                RoundCountToIntegerAndAdjustInterval();
                _view.InitializeInterval(GUIConversion.ToString(_interval));
                _view.InitializeCount(GUIConversion.ToString(_count));
                break;
            }
        }
Example #7
0
        protected override void Initialize(bool initData)
        {
            base.Initialize(initData);
            if (initData)
            {
                _currentMethod = _doc.Method;
                _start         = _doc.Start;
                _end           = _doc.End;
                _count         = _doc.Count;
                _interval      = _doc.Interval;
            }
            if (null != _view)
            {
                _view.InitializeMethod(_currentMethod);
                EhMethodChanged(_currentMethod);

                // Start, End, Count, Interval initialisieren
                string sStart = null, sEnd = null, sCount = null, sInterval = null;

                if (!double.IsNaN(_start))
                {
                    sStart = GUIConversion.ToString(_start);
                }

                if (!double.IsNaN(_end))
                {
                    sStart = GUIConversion.ToString(_end);
                }

                if (!double.IsNaN(_count))
                {
                    sStart = GUIConversion.ToString(_count);
                }

                if (!double.IsNaN(_interval))
                {
                    sStart = GUIConversion.ToString(_interval);
                }

                _view.InitializeStart(sStart);
                _view.InitializeStart(sEnd);
                _view.InitializeStart(sCount);
                _view.InitializeStart(sInterval);
            }
        }
Example #8
0
        protected override void Initialize(bool initData)
        {
            base.Initialize(initData);

            if (_view != null)
            {
                _view.MajorTicks = GUIConversion.ToString(_doc.MajorTickSpan);
                _view.MinorTicks = _doc.MinorTicks;
                _view.ZeroLever  = _doc.ZeroLever;
                _view.MinGrace   = _doc.OrgGrace;
                _view.MaxGrace   = _doc.EndGrace;

                _snapTicksToOrg.Clear();
                _snapTicksToEnd.Clear();

                foreach (BoundaryTickSnapping s in Enum.GetValues(typeof(BoundaryTickSnapping)))
                {
                    _snapTicksToOrg.Add(new SelectableListNode(Current.Gui.GetUserFriendlyName(s), s, s == _doc.SnapOrgToTick));
                    _snapTicksToEnd.Add(new SelectableListNode(Current.Gui.GetUserFriendlyName(s), s, s == _doc.SnapEndToTick));
                }

                _view.SnapTicksToOrg = _snapTicksToOrg;
                _view.SnapTicksToEnd = _snapTicksToEnd;

                _view.TargetNumberMajorTicks = _doc.TargetNumberOfMajorTicks;
                _view.TargetNumberMinorTicks = _doc.TargetNumberOfMinorTicks;

                _view.TransfoOffset = GUIConversion.ToString(_doc.TransformationOffset);
                _view.DivideBy      = GUIConversion.ToString(_doc.TransformationDivider);
                _view.TransfoOperationIsMultiply = _doc.TransformationOperationIsMultiply;

                _view.SuppressMajorTickValues    = GUIConversion.ToString(_doc.SuppressedMajorTicks.ByValues);
                _view.SuppressMinorTickValues    = GUIConversion.ToString(_doc.SuppressedMinorTicks.ByValues);
                _view.SuppressMajorTicksByNumber = GUIConversion.ToString(_doc.SuppressedMajorTicks.ByNumbers);
                _view.SuppressMinorTicksByNumber = GUIConversion.ToString(_doc.SuppressedMinorTicks.ByNumbers);

                _view.AddMajorTickValues = GUIConversion.ToString(_doc.AdditionalMajorTicks.Values);
                _view.AddMinorTickValues = GUIConversion.ToString(_doc.AdditionalMinorTicks.Values);
            }
        }
        private SelectableListNodeList GetResolutions(double actualResolution)
        {
            var resolutions = new SortedList <double, object>();

            foreach (int res in Resolutions)
            {
                resolutions.Add(res, null);
            }

            if (!resolutions.ContainsKey(actualResolution))
            {
                resolutions.Add(actualResolution, null);
            }

            var result = new SelectableListNodeList();

            foreach (double res in resolutions.Keys)
            {
                result.Add(new SelectableListNode(GUIConversion.ToString(res), res, res == actualResolution));
            }

            return(result);
        }
Example #10
0
 public void InitializeSpacing(double horzSpacing, double vertSpacing)
 {
     this._edRowSpacing.Text    = GUIConversion.ToString(horzSpacing);
     this._edColumnSpacing.Text = GUIConversion.ToString(vertSpacing);
 }
Example #11
0
 public void InitializeRowsColumns(int numRows, int numColumns)
 {
     this._edNumberOfRows.Text    = GUIConversion.ToString(numRows);
     this._edNumberOfColumns.Text = GUIConversion.ToString(numColumns);
 }
 public void InitializeSpacing(double rowSpacing, double columnSpacing)
 {
     _edRowSpacing.Text    = GUIConversion.ToString(columnSpacing);
     _edColumnSpacing.Text = GUIConversion.ToString(rowSpacing);
 }