Beispiel #1
0
        public void ApplyGroupStyles(Altaxo.Graph.Gdi.Plot.Groups.PlotGroupStyleCollection externalGroups, Altaxo.Graph.Gdi.Plot.Groups.PlotGroupStyleCollection localGroups)
        {
            // color
            if (!_independentColor)
            {
                ColorGroupStyle.ApplyStyle(externalGroups, localGroups, delegate(PlotColor c) { this._strokePen.Color = c; });
            }

            // SkipFrequency should be the same for all sub plot styles, so there is no "private" property
            SkipFrequencyGroupStyle.ApplyStyle(externalGroups, localGroups, delegate(int c) { this.SkipFrequency = c; });

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

            // bar position
            BarWidthPositionGroupStyle bwp = PlotGroupStyle.GetStyleToApply <BarWidthPositionGroupStyle>(externalGroups, localGroups);

            if (null != bwp && !_doNotShiftHorizontalPosition)
            {
                double innerGapW, outerGapW, width, lpos;
                bwp.Apply(out innerGapW, out outerGapW, out width, out lpos);
                _cachedLogicalShiftOfIndependent = lpos + width / 2;
            }
            else
            {
                _cachedLogicalShiftOfIndependent = 0;
            }
        }
Beispiel #2
0
        public void ApplyGroupStyles(PlotGroupStyleCollection externalGroups, PlotGroupStyleCollection localGroups)
        {
            BarWidthPositionGroupStyle bwp = PlotGroupStyle.GetStyleToApply <BarWidthPositionGroupStyle>(externalGroups, localGroups);

            if (null != bwp)
            {
                bwp.Apply(out _relInnerGapWidth, out _relOuterGapWidth, out _width, out _position);
            }

            if (this.IsColorReceiver)
            {
                ColorGroupStyle.ApplyStyle(externalGroups, localGroups, delegate(PlotColor c) { this._fillBrush.Color = c; });
            }
        }
Beispiel #3
0
        public void ApplyGroupStyles(PlotGroupStyleCollection externalGroups, PlotGroupStyleCollection localGroups)
        {
            _cachedColorForIndexFunction = null;

            BarSizePosition2DGroupStyle bwp = PlotGroupStyle.GetStyleToApply <BarSizePosition2DGroupStyle>(externalGroups, localGroups);

            if (null != bwp)
            {
                bwp.Apply(out _relInnerGapX, out _relOuterGapX, out _xSizeLogical, out _xOffsetLogical);
            }

            if (!_independentFillColor)
            {
                if (null == _fillBrush)
                {
                    _fillBrush = new BrushX(Drawing.ColorManagement.ColorSetManager.Instance.BuiltinDarkPlotColors[0]);
                }
                ColorGroupStyle.ApplyStyle(externalGroups, localGroups, delegate(NamedColor c)
                                           { _fillBrush.Color = c; });

                // but if there is a color evaluation function, then use that function with higher priority
                VariableColorGroupStyle.ApplyStyle(externalGroups, localGroups, delegate(Func <int, Color> evalFunc)
                                                   { _cachedColorForIndexFunction = evalFunc; });
            }

            if (!_independentFrameColor)
            {
                if (null == _framePen)
                {
                    _framePen = new PenX(Drawing.ColorManagement.ColorSetManager.Instance.BuiltinDarkPlotColors[0]);
                }
                ColorGroupStyle.ApplyStyle(externalGroups, localGroups, delegate(NamedColor c)
                                           { _framePen.Color = c; });

                // but if there is a color evaluation function, then use that function with higher priority
                VariableColorGroupStyle.ApplyStyle(externalGroups, localGroups, delegate(Func <int, Color> evalFunc)
                                                   { _cachedColorForIndexFunction = evalFunc; });
            }
        }
Beispiel #4
0
        public void ApplyGroupStyles(PlotGroupStyleCollection externalGroups, PlotGroupStyleCollection localGroups)
        {
            _cachedColorForIndexFunction = null;

            BarSizePosition3DGroupStyle bwp = PlotGroupStyle.GetStyleToApply <BarSizePosition3DGroupStyle>(externalGroups, localGroups);

            if (null != bwp)
            {
                bwp.Apply(
                    out _barShiftStrategy, out _barShiftMaxNumberOfItemsInOneDirection,
                    out _relInnerGapX, out _relOuterGapX, out _xSizeLogical, out _xOffsetLogical,
                    out _relInnerGapY, out _relOuterGapY, out _ySizeLogical, out _yOffsetLogical);
            }

            if (!_independentColor)
            {
                ColorGroupStyle.ApplyStyle(externalGroups, localGroups, delegate(NamedColor c)
                                           { _pen = _pen.WithColor(c); });

                // but if there is a color evaluation function, then use that function with higher priority
                VariableColorGroupStyle.ApplyStyle(externalGroups, localGroups, delegate(Func <int, System.Drawing.Color> evalFunc)
                                                   { _cachedColorForIndexFunction = evalFunc; });
            }
        }