Example #1
0
 public void CollectLocalGroupStyles(PlotGroupStyleCollection externalGroups, PlotGroupStyleCollection localGroups)
 {
     ColorGroupStyle.AddLocalGroupStyle(externalGroups, localGroups);
     DashPatternGroupStyle.AddLocalGroupStyle(externalGroups, localGroups);
     IgnoreMissingDataPointsGroupStyle.AddLocalGroupStyle(externalGroups, localGroups);
     LineConnection2DGroupStyle.AddLocalGroupStyle(externalGroups, localGroups);
 }
Example #2
0
        public void PrepareGroupStyles(PlotGroupStyleCollection externalGroups, PlotGroupStyleCollection localGroups, IPlotArea layer, Processed3DPlotData pdata)
        {
            if (IsColorProvider)
            {
                ColorGroupStyle.PrepareStyle(externalGroups, localGroups, delegate()
                                             { return(Color); });
            }

            if (!_independentDashStyle)
            {
                DashPatternGroupStyle.PrepareStyle(externalGroups, localGroups, delegate
                                                   { return(LinePen.DashPattern ?? DashPatternListManager.Instance.BuiltinDefaultSolid); });
            }
        }
Example #3
0
        public void PrepareGroupStyles(PlotGroupStyleCollection externalGroups, PlotGroupStyleCollection localGroups, IPlotArea layer, Processed2DPlotData pdata)
        {
            if (IsColorProvider)
            {
                ColorGroupStyle.PrepareStyle(externalGroups, localGroups, delegate()
                                             { return(Color); });
            }

            if (!_independentDashStyle)
            {
                DashPatternGroupStyle.PrepareStyle(externalGroups, localGroups, delegate
                                                   { return(LinePen.DashPattern); });
            }

            IgnoreMissingDataPointsGroupStyle.PrepareStyle(externalGroups, localGroups, () => _ignoreMissingDataPoints);
            LineConnection2DGroupStyle.PrepareStyle(externalGroups, localGroups, () => new Tuple <ILineConnectionStyle, bool>(_connectionStyle, _connectCircular));
        }
Example #4
0
        public void ApplyGroupStyles(PlotGroupStyleCollection externalGroups, PlotGroupStyleCollection localGroups)
        {
            // SkipFrequency should be the same for all sub plot styles
            if (!_independentSkipFreq)
            {
                _skipFreq = 1;
                SkipFrequencyGroupStyle.ApplyStyle(externalGroups, localGroups, delegate(int c)
                                                   { _skipFreq = c; });
            }

            if (IsColorReceiver)
            {
                ColorGroupStyle.ApplyStyle(externalGroups, localGroups, delegate(NamedColor c)
                                           { Color = c; });
            }

            if (!_independentDashStyle)
            {
                DashPatternGroupStyle.ApplyStyle(externalGroups, localGroups, delegate(IDashPattern c)
                                                 { _linePen = LinePen.WithDashPattern(c); });
            }

            if (!_independentSymbolSize)
            {
                _symbolSize = 0;
                SymbolSizeGroupStyle.ApplyStyle(externalGroups, localGroups, delegate(double size)
                                                { _symbolSize = size; });
            }

            // symbol size
            if (!_independentSymbolSize)
            {
                _symbolSize = 0;
                SymbolSizeGroupStyle.ApplyStyle(externalGroups, localGroups, delegate(double size)
                                                { _symbolSize = size; });

                // but if there is an symbol size evaluation function, then use this with higher priority.
                _cachedSymbolSizeForIndexFunction = null;
                VariableSymbolSizeGroupStyle.ApplyStyle(externalGroups, localGroups, delegate(Func <int, double> evalFunc)
                                                        { _cachedSymbolSizeForIndexFunction = evalFunc; });
            }
            else
            {
                _cachedSymbolSizeForIndexFunction = null;
            }
        }
Example #5
0
        public override bool Apply(bool disposeController)
        {
            bool color     = _view.PlotGroupColor;
            bool linestyle = _view.PlotGroupLineType;
            bool symbol    = _view.PlotGroupSymbol;
            bool serial    = !_view.PlotGroupConcurrently;

            ColorGroupStyle         newColorGroupStyle         = null;
            DashPatternGroupStyle   newLineStyleGroupStyle     = null;
            ScatterSymbolGroupStyle newScatterSymbolGroupStyle = null;

            if (_doc.ContainsType(typeof(ColorGroupStyle)))
            {
                newColorGroupStyle = (ColorGroupStyle)_doc.GetPlotGroupStyle(typeof(ColorGroupStyle)).Clone();
                _doc.RemoveType(typeof(ColorGroupStyle));
            }
            if (_doc.ContainsType(typeof(DashPatternGroupStyle)))
            {
                newLineStyleGroupStyle = (DashPatternGroupStyle)_doc.GetPlotGroupStyle(typeof(DashPatternGroupStyle)).Clone();
                _doc.RemoveType(typeof(DashPatternGroupStyle));
            }
            if (_doc.ContainsType(typeof(ScatterSymbolGroupStyle)))
            {
                newScatterSymbolGroupStyle = (ScatterSymbolGroupStyle)_doc.GetPlotGroupStyle(typeof(ScatterSymbolGroupStyle)).Clone();
                _doc.RemoveType(typeof(ScatterSymbolGroupStyle));
            }

            if (color)
            {
                newColorGroupStyle = newColorGroupStyle ?? ColorGroupStyle.NewExternalGroupStyle();
                newColorGroupStyle.IsStepEnabled = true;
                _doc.Add(newColorGroupStyle);
            }
            if (linestyle)
            {
                newLineStyleGroupStyle = newLineStyleGroupStyle ?? new DashPatternGroupStyle();
                newLineStyleGroupStyle.IsStepEnabled = true;

                if (serial && color)
                {
                    _doc.Add(newLineStyleGroupStyle, typeof(ColorGroupStyle));
                }
                else
                {
                    _doc.Add(newLineStyleGroupStyle);
                }
            }
            if (symbol)
            {
                newScatterSymbolGroupStyle = newScatterSymbolGroupStyle ?? new ScatterSymbolGroupStyle();
                newScatterSymbolGroupStyle.IsStepEnabled = true;

                if (serial && linestyle)
                {
                    _doc.Add(newScatterSymbolGroupStyle, typeof(DashPatternGroupStyle));
                }
                else if (serial && color)
                {
                    _doc.Add(newScatterSymbolGroupStyle, typeof(ColorGroupStyle));
                }
                else
                {
                    _doc.Add(newScatterSymbolGroupStyle);
                }
            }

            _doc.PlotGroupStrictness = _view.PlotGroupStrict;

            return(ApplyEnd(true, disposeController));
        }
Example #6
0
        public void ApplyGroupStyles(PlotGroupStyleCollection externalGroups, PlotGroupStyleCollection localGroups)
        {
            // IgnoreMissingDataPoints is the same for all sub plot styles
            IgnoreMissingDataPointsGroupStyle.ApplyStyle(externalGroups, localGroups, (ignoreMissingDataPoints) => _ignoreMissingDataPoints = ignoreMissingDataPoints);

            // LineConnectionStyle is the same for all sub plot styles
            LineConnection2DGroupStyle.ApplyStyle(externalGroups, localGroups, (lineConnection, connectCircular) => { _connectionStyle = lineConnection; _connectCircular = connectCircular; });

            // SkipFrequency should be the same for all sub plot styles
            if (!_independentSkipFrequency)
            {
                _skipFrequency = 1;
                SkipFrequencyGroupStyle.ApplyStyle(externalGroups, localGroups, delegate(int c)
                                                   { _skipFrequency = c; });
            }

            if (IsColorReceiver)
            {
                ColorGroupStyle.ApplyStyle(externalGroups, localGroups, delegate(NamedColor c)
                                           { Color = c; });
            }

            if (!_independentDashStyle)
            {
                DashPatternGroupStyle.ApplyStyle(externalGroups, localGroups, delegate(IDashPattern c)
                                                 { _linePen.DashPattern = c; });
            }

            if (!_independentSymbolSize)
            {
                _symbolSize = 0;
                SymbolSizeGroupStyle.ApplyStyle(externalGroups, localGroups, delegate(double size)
                                                { _symbolSize = size; });
            }

            // symbol size
            if (!_independentSymbolSize)
            {
                _symbolSize = 0;
                SymbolSizeGroupStyle.ApplyStyle(externalGroups, localGroups, delegate(double size)
                                                { _symbolSize = size; });

                // but if there is an symbol size evaluation function, then use this with higher priority.
                _cachedSymbolSizeForIndexFunction = null;
                VariableSymbolSizeGroupStyle.ApplyStyle(externalGroups, localGroups, delegate(Func <int, double> evalFunc)
                                                        { _cachedSymbolSizeForIndexFunction = evalFunc; });
            }
            else
            {
                _cachedSymbolSizeForIndexFunction = null;
            }

            // Shift the items ?
            _cachedLogicalShiftX = 0;
            _cachedLogicalShiftY = 0;
            if (!_independentOnShiftingGroupStyles)
            {
                var shiftStyle = PlotGroupStyle.GetFirstStyleToApplyImplementingInterface <IShiftLogicalXYGroupStyle>(externalGroups, localGroups);
                if (null != shiftStyle)
                {
                    shiftStyle.Apply(out _cachedLogicalShiftX, out _cachedLogicalShiftY);
                }
            }
        }
Example #7
0
 public void CollectLocalGroupStyles(PlotGroupStyleCollection externalGroups, PlotGroupStyleCollection localGroups)
 {
     ColorGroupStyle.AddLocalGroupStyle(externalGroups, localGroups);
     DashPatternGroupStyle.AddLocalGroupStyle(externalGroups, localGroups);
 }