Ejemplo n.º 1
0
 public void ApplyGroupStyles(PlotGroupStyleCollection externalGroups, PlotGroupStyleCollection localGroups)
 {
     if (this.IsColorReceiver)
     {
         ColorGroupStyle.ApplyStyle(externalGroups, localGroups, delegate(PlotColor c) { this.Color = c; });
     }
 }
Ejemplo n.º 2
0
 public override void ApplyStyles(PlotGroupStyleCollection externalGroups)
 {
     foreach (IG2DPlotStyle sps in _plotStyles)
     {
         sps.ApplyGroupStyles(externalGroups, _localGroups);
     }
 }
Ejemplo n.º 3
0
 public void PrepareGroupStyles(PlotGroupStyleCollection externalGroups, PlotGroupStyleCollection localGroups, IPlotArea layer, Processed2DPlotData pdata)
 {
     if (this.IsColorProvider)
     {
         ColorGroupStyle.PrepareStyle(externalGroups, localGroups, delegate() { return(PlotColors.Colors.GetPlotColor(this.Color)); });
     }
 }
Ejemplo n.º 4
0
 public void CollectLocalGroupStyles(PlotGroupStyleCollection externalGroups, PlotGroupStyleCollection localGroups)
 {
     if (this.IsColorProvider)
     {
         ColorGroupStyle.AddLocalGroupStyle(externalGroups, localGroups);
     }
 }
Ejemplo n.º 5
0
 public void CollectLocalGroupStyles(PlotGroupStyleCollection externalGroups, PlotGroupStyleCollection localGroups)
 {
     foreach (var ps in this)
     {
         ps.CollectLocalGroupStyles(externalGroups, localGroups);
     }
 }
Ejemplo n.º 6
0
 /// <summary>
 /// Collects all possible group styles that can be applied to this plot item in
 /// styles.
 /// </summary>
 /// <param name="styles">The collection of group styles.</param>
 public void CollectStyles(PlotGroupStyleCollection styles)
 {
     foreach (IGPlotItem pi in _plotItems)
     {
         pi.CollectStyles(styles);
     }
 }
Ejemplo n.º 7
0
 public G2DPlotItemController(G2DPlotItem doc, PlotGroupStyleCollection parent)
 {
     if (!InitializeDocument(doc, parent))
     {
         throw new ArgumentException();
     }
 }
Ejemplo n.º 8
0
 public void CollectLocalGroupStyles(PlotGroupStyleCollection externalGroups, PlotGroupStyleCollection localGroups)
 {
     ColorGroupStyle.AddLocalGroupStyle(externalGroups, localGroups);
     SymbolSizeGroupStyle.AddLocalGroupStyle(externalGroups, localGroups);
     ScatterSymbolGroupStyle.AddLocalGroupStyle(externalGroups, localGroups);
     SkipFrequencyGroupStyle.AddLocalGroupStyle(externalGroups, localGroups); // (local group style only)
 }
Ejemplo n.º 9
0
        /// <summary>
        /// Distibute changes made to one group style of the collection (at index <c>pivot</c> to all other members of the collection.
        /// </summary>
        /// <param name="pivot">Index of the group style that was changed. This style keeps it's properties.</param>
        /// <param name="layer"></param>
        /// <param name="pdata"></param>
        public void DistributeSubStyleChange(int pivot, IPlotArea layer, Processed2DPlotData pdata)
        {
            PlotGroupStyleCollection externGroup = new PlotGroupStyleCollection();
            PlotGroupStyleCollection localGroup  = new PlotGroupStyleCollection();

            // because we don't step, the order is essential only for PrepareStyles
            for (int i = 0; i < _innerList.Count; i++)
            {
                CollectLocalGroupStyles(externGroup, localGroup);
            }

            // prepare
            this[pivot].PrepareGroupStyles(externGroup, localGroup, layer, pdata);
            for (int i = 0; i < Count; i++)
            {
                if (i != pivot)
                {
                    this[i].PrepareGroupStyles(externGroup, localGroup, layer, pdata);
                }
            }

            // apply
            this[pivot].ApplyGroupStyles(externGroup, localGroup);
            for (int i = 0; i < Count; i++)
            {
                if (i != pivot)
                {
                    this[i].ApplyGroupStyles(externGroup, localGroup);
                }
            }
        }
Ejemplo n.º 10
0
 public void CollectExternalGroupStyles(PlotGroupStyleCollection externalGroups)
 {
     if (!_independentColor)
     {
         Graph.Plot.Groups.ColorGroupStyle.AddExternalGroupStyle(externalGroups);
     }
 }
Ejemplo n.º 11
0
 public void CollectExternalGroupStyles(PlotGroupStyleCollection externalGroups)
 {
     foreach (IG2DPlotStyle ps in this)
     {
         ps.CollectExternalGroupStyles(externalGroups);
     }
 }
Ejemplo n.º 12
0
        /// <summary>
        /// Prepares a new substyle (one that is not already in the collection) for becoming member of the collection. The substyle will get
        /// all distributes group properties (local only) of this style collection.
        /// </summary>
        /// <param name="newSubStyle">Sub style to prepare.</param>
        /// <param name="layer"></param>
        /// <param name="pdata"></param>
        public void PrepareNewSubStyle(IG2DPlotStyle newSubStyle, IPlotArea layer, Processed2DPlotData pdata)
        {
            PlotGroupStyleCollection externGroup = new PlotGroupStyleCollection();
            PlotGroupStyleCollection localGroup  = new PlotGroupStyleCollection();

            // because we don't step, the order is essential only for PrepareStyles
            for (int i = 0; i < _innerList.Count; i++)
            {
                this[i].CollectLocalGroupStyles(externGroup, localGroup);
            }
            newSubStyle.CollectLocalGroupStyles(externGroup, localGroup);



            // prepare
            for (int i = 0; i < Count; i++)
            {
                this[i].PrepareGroupStyles(externGroup, localGroup, layer, pdata);
            }
            newSubStyle.PrepareGroupStyles(externGroup, localGroup, layer, pdata);

            // apply
            for (int i = 0; i < Count; i++)
            {
                this[i].ApplyGroupStyles(externGroup, localGroup);
            }
            newSubStyle.ApplyGroupStyles(externGroup, localGroup);
        }
Ejemplo n.º 13
0
 public void CollectLocalGroupStyles(PlotGroupStyleCollection externalGroups, PlotGroupStyleCollection localGroups)
 {
     ColorGroupStyle.AddLocalGroupStyle(externalGroups, localGroups);
     DashPatternGroupStyle.AddLocalGroupStyle(externalGroups, localGroups);
     IgnoreMissingDataPointsGroupStyle.AddLocalGroupStyle(externalGroups, localGroups);
     LineConnection2DGroupStyle.AddLocalGroupStyle(externalGroups, localGroups);
 }
Ejemplo n.º 14
0
 public void PrepareGroupStyles(PlotGroupStyleCollection externalGroups, PlotGroupStyleCollection localGroups, IPlotArea layer, Processed2DPlotData pdata)
 {
     foreach (IG2DPlotStyle ps in this)
     {
         ps.PrepareGroupStyles(externalGroups, localGroups, layer, pdata);
     }
 }
Ejemplo n.º 15
0
 public void ApplyGroupStyles(PlotGroupStyleCollection externalGroups, PlotGroupStyleCollection localGroups)
 {
     foreach (IG2DPlotStyle ps in this)
     {
         ps.ApplyGroupStyles(externalGroups, localGroups);
     }
 }
Ejemplo n.º 16
0
        public override void PrepareGroupStyles(PlotGroupStyleCollection externalGroups, IPlotArea layer)
        {
            Processed2DPlotData pdata = GetRangesAndPoints(layer);

            if (null == _localGroups)
            {
                _localGroups = new PlotGroupStyleCollection()
                {
                    ParentObject = this
                }
            }
            ;

            using (var suspendToken = _localGroups.SuspendGetToken())
            {
                _localGroups.Clear();

                // first add missing local group styles
                _plotStyles.CollectLocalGroupStyles(externalGroups, _localGroups);

                // for the newly created group styles BeginPrepare must be called
                _localGroups.BeginPrepare();

                // now prepare the groups
                _plotStyles.PrepareGroupStyles(externalGroups, _localGroups, layer, pdata);

                // for the group styles in the local group, PrepareStep and EndPrepare must be called,
                _localGroups.PrepareStep();
                _localGroups.EndPrepare();

                suspendToken.ResumeSilently(); // we are not interested in changes in the _localGroup
            }
        }
Ejemplo n.º 17
0
 public void CollectLocalGroupStyles(PlotGroupStyleCollection externalGroups, PlotGroupStyleCollection localGroups)
 {
     ColorGroupStyle.AddLocalGroupStyle(externalGroups, localGroups);
     SymbolSizeGroupStyle.AddLocalGroupStyle(externalGroups, localGroups);
     ScatterSymbolGroupStyle.AddLocalGroupStyle(externalGroups, localGroups); // here it is OK to add the local group style, even if _independentScatterSymbol is true
     SkipFrequencyGroupStyle.AddLocalGroupStyle(externalGroups, localGroups); // (local group style only)
     IgnoreMissingDataPointsGroupStyle.AddLocalGroupStyle(externalGroups, localGroups);
 }
Ejemplo n.º 18
0
		protected override IEnumerable<Main.DocumentNodeAndName> GetDocumentNodeChildrenWithName()
		{
			if (null != _plotStyles)
				yield return new Main.DocumentNodeAndName(_plotStyles, () => _plotStyles = null, "Style");

			if (null != _localGroups)
				yield return new Main.DocumentNodeAndName(_localGroups, () => _localGroups = null, "LocalPlotGroupStyles");
		}
Ejemplo n.º 19
0
 public override void CollectStyles(PlotGroupStyleCollection styles)
 {
     // first add missing local group styles
     foreach (IG2DPlotStyle sps in _plotStyles)
     {
         sps.CollectExternalGroupStyles(styles);
     }
 }
Ejemplo n.º 20
0
        public void ApplyGroupStyles(PlotGroupStyleCollection externalGroups, PlotGroupStyleCollection localGroups)
        {
            // IgnoreMissingDataPoints is the same for all sub plot styles
            IgnoreMissingDataPointsGroupStyle.ApplyStyle(externalGroups, localGroups, (ignoreMissingDataPoints) => _ignoreMissingDataPoints = ignoreMissingDataPoints);

            if (IsColorReceiver)
            {
                // try to get a constant color ...
                ColorGroupStyle.ApplyStyle(externalGroups, localGroups, delegate(NamedColor c)
                                           { Color = c; });
                // but if there is a color evaluation function, then use that function with higher priority
                if (!VariableColorGroupStyle.ApplyStyle(externalGroups, localGroups, delegate(Func <int, Color> evalFunc)
                                                        { _cachedColorForIndexFunction = evalFunc; }))
                {
                    _cachedColorForIndexFunction = null;
                }
            }

            if (!_independentScatterSymbol)
            {
                ScatterSymbolGroupStyle.ApplyStyle(externalGroups, localGroups, delegate(IScatterSymbol c)
                                                   { ScatterSymbol = c; });
            }

            // per Default, set the symbol size evaluation function to null
            _cachedSymbolSizeForIndexFunction = null;
            if (!_independentSymbolSize)
            {
                // try to get a constant symbol size ...
                SymbolSizeGroupStyle.ApplyStyle(externalGroups, localGroups, delegate(double size)
                                                { SymbolSize = size; });
                // but if there is an symbol size evaluation function, then use this with higher priority.
                if (!VariableSymbolSizeGroupStyle.ApplyStyle(externalGroups, localGroups, delegate(Func <int, double> evalFunc)
                                                             { _cachedSymbolSizeForIndexFunction = evalFunc; }))
                {
                    _cachedSymbolSizeForIndexFunction = null;
                }
            }

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

            // 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);
                }
            }
        }
Ejemplo n.º 21
0
        public void CollectExternalGroupStyles(PlotGroupStyleCollection externalGroups)
        {
            if (IsColorProvider)
            {
                ColorGroupStyle.AddExternalGroupStyle(externalGroups);
            }

            ScatterSymbolGroupStyle.AddExternalGroupStyle(externalGroups);
        }
Ejemplo n.º 22
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; });

            if (ColorLinkage.Independent != _fillColorLinkage)
            {
                if (null == _fillBrush)
                {
                    _fillBrush = new BrushX(NamedColors.Black);
                }

                if (_fillColorLinkage == ColorLinkage.Dependent)
                {
                    ColorGroupStyle.ApplyStyle(externalGroups, localGroups, delegate(NamedColor c)
                                               { _fillBrush.Color = c; });
                }
                else if (ColorLinkage.PreserveAlpha == _fillColorLinkage)
                {
                    ColorGroupStyle.ApplyStyle(externalGroups, localGroups, delegate(NamedColor c)
                                               { _fillBrush.Color = c.NewWithAlphaValue(_fillBrush.Color.Color.A); });
                }
            }
            if (ColorLinkage.Independent != _frameColorLinkage)
            {
                if (null == _framePen)
                {
                    ChildSetMember(ref _framePen, new PenX(NamedColors.Black));
                }

                if (_frameColorLinkage == ColorLinkage.Dependent)
                {
                    ColorGroupStyle.ApplyStyle(externalGroups, localGroups, delegate(NamedColor c)
                                               { _framePen.Color = c; });
                }
                else if (ColorLinkage.PreserveAlpha == _fillColorLinkage)
                {
                    ColorGroupStyle.ApplyStyle(externalGroups, localGroups, delegate(NamedColor c)
                                               { _framePen.Color = c.NewWithAlphaValue(_framePen.Color.Color.A); });
                }
            }

            // 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);
                }
            }
        }
Ejemplo n.º 23
0
 public PlotItemCollection()
 {
     _plotItems = new ObservableList <IGPlotItem>();
     _plotItems.CollectionChanged += EhPlotItemsCollectionChanged;
     _plotGroupStyles              = new PlotGroupStyleCollection()
     {
         ParentObject = this
     };
 }
Ejemplo n.º 24
0
        public void CollectLocalGroupStyles(PlotGroupStyleCollection externalGroups, PlotGroupStyleCollection localGroups)
        {
            ColorGroupStyle.AddLocalGroupStyle(externalGroups, localGroups);

            if (!_independentSkipFrequency)
            {
                SkipFrequencyGroupStyle.AddLocalGroupStyle(externalGroups, localGroups); // (local group style only)
            }
            IgnoreMissingDataPointsGroupStyle.AddLocalGroupStyle(externalGroups, localGroups);
        }
Ejemplo n.º 25
0
        /// <summary>
        /// Prepare group styles forward, from the first to the last item.
        /// The function is called recursively for child PlotItemCollections, but only up in the hierarchy.
        /// This function therefore has no influence on items down in hierarchie, i.e. parental PlotItemCollections.
        /// </summary>
        /// <param name="parentGroupStyles">The parent plot group style collection.</param>
        /// <param name="layer">The plot layer.</param>
        /// <remarks>The preparation is used for:
        /// <para>BarGraph: to count items, calculating the width and position of each item afterwards.</para>
        /// <para>It is <b>not</b> used to enumerate colors, line styles etc., since this is done during the Apply stage.</para>
        /// </remarks>
        protected void PrepareGroupStylesForward_HierarchyUpOnly(PlotGroupStyleCollection parentGroupStyles, Graph3D.IPlotArea layer)
        {
            bool transferFromParentStyles =
                parentGroupStyles != null &&
                parentGroupStyles.Count != 0 &&
                parentGroupStyles.DistributeToChildGroups &&
                _plotGroupStyles.InheritFromParentGroups;

            // Announce the local plot group styles, that we start preparing
            _plotGroupStyles.BeginPrepare();

            //string thisname = Main.DocumentPath.GetPathString(this, int.MaxValue);
            //System.Diagnostics.Debug.WriteLine(string.Format("{0}:Begin:PrepareFWHUO", thisname));

            // if TransferFromParentStyles was choosen, transfer some of the plot group settings of the parental plot group styles to the local styles
            if (transferFromParentStyles)
            {
                PlotGroupStyleCollection.TransferFromTo(parentGroupStyles, _plotGroupStyles);
                //System.Diagnostics.Debug.WriteLine(string.Format("{0}:Begin:PrepareFWHUO (transfer from parent style", thisname));
            }

            // for each PlotItem in this collection, announce the preparation, using the local plot group style collection
            // after each item, announce a step to the plot group styles, so that the properties (like color etc.) can be stepped forward
            int last = _plotItems.Count - 1;

            for (int i = 0; i <= last; i++)
            {
                IGPlotItem pi = _plotItems[i];
                if (pi is PlotItemCollection)
                {
                    var pic = (PlotItemCollection)pi;
                    pic.PrepareGroupStylesForward_HierarchyUpOnly(_plotGroupStyles, layer);
                    _plotGroupStyles.PrepareStepIfForeignSteppingFalse(((PlotItemCollection)pi)._plotGroupStyles);
                }
                else
                {
                    pi.PrepareGroupStyles(_plotGroupStyles, layer);
                    _plotGroupStyles.PrepareStep();
                }
            }

            // after all our own PlotItems are prepared now,
            // if TransferFromParentStyles was choosen, transfer our own plot group settings back to the parental plot group styles
            // so that the parental plot group can continue i.e. with the color etc.
            if (transferFromParentStyles)
            {
                PlotGroupStyleCollection.TransferFromTo(_plotGroupStyles, parentGroupStyles);
                //System.Diagnostics.Debug.WriteLine(string.Format("{0}:End:PrepareFWHUO (transfer back to parent style", thisname));
            }

            // after preparation of all plot items is done, announce the end of preparation,
            // some of the calculations can be done only now.
            _plotGroupStyles.EndPrepare();
            //System.Diagnostics.Debug.WriteLine(string.Format("{0}:End:PrepareFWHUO", thisname));
        }
Ejemplo n.º 26
0
        /// <summary>
        /// Plots selected data columns of a table.
        /// </summary>
        /// <param name="table">The source table.</param>
        /// <param name="selectedColumns">The data columns of the table that should be plotted.</param>
        /// <param name="graph">The graph document to plot into.</param>
        /// <param name="templatePlotStyle">The plot style which is the template for all plot items.</param>
        /// <param name="groupStyles">The group styles for the newly built plot item collection.</param>
        public static Altaxo.Gui.Graph.Gdi.Viewing.IGraphController Plot(
            DataTable table,
            IAscendingIntegerCollection selectedColumns,
            Graph.Gdi.GraphDocument graph,
            G2DPlotStyleCollection templatePlotStyle,
            PlotGroupStyleCollection groupStyles)
        {
            List <IGPlotItem> pilist = CreatePlotItems(table, selectedColumns, templatePlotStyle);
            // now create a new Graph with this plot associations
            var gc      = Current.ProjectService.CreateNewGraph(graph);
            var xylayer = gc.Doc.RootLayer.Layers.OfType <Altaxo.Graph.Gdi.XYPlotLayer>().First();

            // Set x and y axes according to the first plot item in the list
            if (pilist.Count > 0 && (pilist[0] is XYColumnPlotItem))
            {
                var firstitem = (XYColumnPlotItem)pilist[0];
                if (firstitem.Data.XColumn is TextColumn)
                {
                    xylayer.Scales[0] = new TextScale();
                }
                else if (firstitem.Data.XColumn is DateTimeColumn)
                {
                    xylayer.Scales[0] = new DateTimeScale();
                }

                if (firstitem.Data.YColumn is TextColumn)
                {
                    xylayer.Scales[1] = new TextScale();
                }
                else if (firstitem.Data.YColumn is DateTimeColumn)
                {
                    xylayer.Scales[1] = new DateTimeScale();
                }
            }

            var newPlotGroup = new PlotItemCollection(xylayer.PlotItems);

            foreach (IGPlotItem pi in pilist)
            {
                newPlotGroup.Add(pi);
            }
            if (groupStyles != null)
            {
                newPlotGroup.GroupStyles = groupStyles;
            }
            else
            {
                newPlotGroup.CollectStyles(newPlotGroup.GroupStyles);
            }

            xylayer.PlotItems.Add(newPlotGroup);

            return(gc);
        }
Ejemplo n.º 27
0
        protected override IEnumerable <Main.DocumentNodeAndName> GetDocumentNodeChildrenWithName()
        {
            if (null != _plotStyles)
            {
                yield return(new Main.DocumentNodeAndName(_plotStyles, () => _plotStyles = null, "Style"));
            }

            if (null != _localGroups)
            {
                yield return(new Main.DocumentNodeAndName(_localGroups, () => _localGroups = null, "LocalPlotGroupStyles"));
            }
        }
Ejemplo n.º 28
0
        /// <summary>
        /// Plots selected data columns of a table.
        /// </summary>
        /// <param name="table">The source table.</param>
        /// <param name="selectedColumns">The data columns of the table that should be plotted.</param>
        /// <param name="graph">The graph document to plot into.</param>
        /// <param name="templatePlotStyle">The plot style which is the template for all plot items.</param>
        /// <param name="groupStyles">The group styles for the newly built plot item collection.</param>
        public static IGraphController Plot(DataTable table,
                                            IAscendingIntegerCollection selectedColumns,
                                            Graph.Gdi.GraphDocument graph,
                                            G2DPlotStyleCollection templatePlotStyle,
                                            PlotGroupStyleCollection groupStyles)
        {
            List <IGPlotItem> pilist = CreatePlotItems(table, selectedColumns, templatePlotStyle);

            // now create a new Graph with this plot associations
            Altaxo.Graph.GUI.IGraphController gc = Current.ProjectService.CreateNewGraph(graph);
            // Set x and y axes according to the first plot item in the list
            if (pilist.Count > 0 && (pilist[0] is XYColumnPlotItem))
            {
                XYColumnPlotItem firstitem = (XYColumnPlotItem)pilist[0];
                if (firstitem.Data.XColumn is TextColumn)
                {
                    gc.Doc.Layers[0].LinkedScales.SetScale(0, new Graph.Scales.TextScale());
                }
                else if (firstitem.Data.XColumn is DateTimeColumn)
                {
                    gc.Doc.Layers[0].LinkedScales.SetScale(0, new Graph.Scales.DateTimeScale());
                }

                if (firstitem.Data.YColumn is TextColumn)
                {
                    gc.Doc.Layers[0].LinkedScales.SetScale(1, new Graph.Scales.TextScale());
                }
                else if (firstitem.Data.YColumn is DateTimeColumn)
                {
                    gc.Doc.Layers[0].LinkedScales.SetScale(1, new Graph.Scales.DateTimeScale());
                }
            }


            PlotItemCollection newPlotGroup = new PlotItemCollection(gc.Doc.Layers[0].PlotItems);

            foreach (IGPlotItem pi in pilist)
            {
                newPlotGroup.Add(pi);
            }
            if (groupStyles != null)
            {
                newPlotGroup.GroupStyles = groupStyles;
            }
            else
            {
                newPlotGroup.CollectStyles(newPlotGroup.GroupStyles);
            }

            gc.Doc.Layers[0].PlotItems.Add(newPlotGroup);

            return(gc);
        }
Ejemplo n.º 29
0
        public void ApplyGroupStyles(PlotGroupStyleCollection externalGroups, PlotGroupStyleCollection localGroups)
        {
            // IgnoreMissingDataPoints is the same for all sub plot styles
            IgnoreMissingDataPointsGroupStyle.ApplyStyle(externalGroups, localGroups, (ignoreMissingDataPoints) => _ignoreMissingDataPoints = ignoreMissingDataPoints);

            _cachedColorForIndexFunction      = null;
            _cachedSymbolSizeForIndexFunction = null;
            // color
            if (!_independentColor)
            {
                ColorGroupStyle.ApplyStyle(externalGroups, localGroups, delegate(NamedColor c)
                                           { _strokePen.Color = 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; });
            }

            if (!_independentSkipFrequency)
            {
                SkipFrequencyGroupStyle.ApplyStyle(externalGroups, localGroups, delegate(int c)
                                                   { SkipFrequency = c; });
            }

            // 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);
                }
            }
        }
Ejemplo n.º 30
0
        public void CollectLocalGroupStyles(PlotGroupStyleCollection externalGroups, PlotGroupStyleCollection localGroups)
        {
            if (!_independentColor)
            {
                Graph.Plot.Groups.ColorGroupStyle.AddLocalGroupStyle(externalGroups, localGroups);
            }

            if (!_independentSkipFrequency)
            {
                SkipFrequencyGroupStyle.AddLocalGroupStyle(externalGroups, localGroups); // (local group only)
            }
        }
Ejemplo n.º 31
0
        /// <summary>
        /// Plots selected data columns of a table.
        /// </summary>
        /// <param name="table">The source table.</param>
        /// <param name="selectedColumns">The data columns of the table that should be plotted.</param>
        /// <param name="templatePlotStyle">The plot style which is the template for all plot items.</param>
        /// <param name="groupStyles">The group styles for the newly built plot item collection.</param>
        public static IGraphController Plot(DataTable table,
                                            IAscendingIntegerCollection selectedColumns,
                                            G2DPlotStyleCollection templatePlotStyle,
                                            PlotGroupStyleCollection groupStyles)
        {
            Altaxo.Graph.Gdi.GraphDocument graph = new Altaxo.Graph.Gdi.GraphDocument();
            Altaxo.Graph.Gdi.XYPlotLayer   layer = new Altaxo.Graph.Gdi.XYPlotLayer(graph.DefaultLayerPosition, graph.DefaultLayerSize);
            layer.CreateDefaultAxes();
            graph.Layers.Add(layer);
            Current.Project.GraphDocumentCollection.Add(graph);

            return(Plot(table, selectedColumns, graph, templatePlotStyle, groupStyles));
        }
Ejemplo n.º 32
0
		public void ApplyGroupStyles(PlotGroupStyleCollection externalGroups, PlotGroupStyleCollection localGroups)
		{
			if (this.IsColorReceiver)
			{
				// try to get a constant color ...
				ColorGroupStyle.ApplyStyle(externalGroups, localGroups, delegate (NamedColor c) { this.Color = c; });
				// but if there is a color evaluation function, then use that function with higher priority
				if (!VariableColorGroupStyle.ApplyStyle(externalGroups, localGroups, delegate (Func<int, Color> evalFunc) { _cachedColorForIndexFunction = evalFunc; }))
					_cachedColorForIndexFunction = null;
			}

			// try to get the symbol size ...
			if (!_independentSymbolSize)
			{
				_cachedSymbolSize = 0;
				SymbolSizeGroupStyle.ApplyStyle(externalGroups, localGroups, delegate (double size) { this._cachedSymbolSize = size; });
				// but if there is an symbol size evaluation function, then use this with higher priority.
				if (!VariableSymbolSizeGroupStyle.ApplyStyle(externalGroups, localGroups, delegate (Func<int, double> evalFunc) { _cachedSymbolSizeForIndexFunction = evalFunc; }))
					_cachedSymbolSizeForIndexFunction = null;
			}
			else
			{
				_cachedSymbolSize = _symbolSize;
			}

			// SkipFrequency should be the same for all sub plot styles, so there is no "private" property
			if (!_independentSkipFreq)
			{
				_skipFreq = 1;
				SkipFrequencyGroupStyle.ApplyStyle(externalGroups, localGroups, delegate (int c) { this._skipFreq = c; });
			}
		}
Ejemplo n.º 33
0
		public override void ApplyGroupStyles(PlotGroupStyleCollection externalGroups)
		{
		}
Ejemplo n.º 34
0
		public void ApplyGroupStyles(PlotGroupStyleCollection externalGroups, PlotGroupStyleCollection localGroups)
		{
			_cachedColorForIndexFunction = null;
			_cachedSymbolSizeForIndexFunction = null;
			// color
			if (!_independentColor)
			{
				ColorGroupStyle.ApplyStyle(externalGroups, localGroups, delegate (NamedColor c) { _strokePen = _strokePen.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; });
			}

			if (!_independentSkipFrequency)
				SkipFrequencyGroupStyle.ApplyStyle(externalGroups, localGroups, delegate (int c) { this.SkipFrequency = c; });

			// symbol size
			if (!_independentSymbolSize)
			{
				this._symbolSize = 0;
				SymbolSizeGroupStyle.ApplyStyle(externalGroups, localGroups, delegate (double size) { this._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;
			_cachedLogicalShiftZ = 0;
			if (!_independentOnShiftingGroupStyles)
			{
				var shiftStyle = PlotGroupStyle.GetFirstStyleToApplyImplementingInterface<IShiftLogicalXYZGroupStyle>(externalGroups, localGroups);
				if (null != shiftStyle)
				{
					shiftStyle.Apply(out _cachedLogicalShiftX, out _cachedLogicalShiftY, out _cachedLogicalShiftZ);
				}
			}
		}
Ejemplo n.º 35
0
		public void CollectLocalGroupStyles(PlotGroupStyleCollection externalGroups, PlotGroupStyleCollection localGroups)
		{
			BarSizePosition3DGroupStyle.AddLocalGroupStyle(externalGroups, localGroups);
		}
Ejemplo n.º 36
0
		public void PrepareGroupStyles(PlotGroupStyleCollection externalGroups, PlotGroupStyleCollection localGroups, IPlotArea layer, Processed2DPlotData pdata)
		{
			if (this._fillColorLinkage == ColorLinkage.Dependent && this._fillBrush != null)
				ColorGroupStyle.PrepareStyle(externalGroups, localGroups, delegate () { return this._fillBrush.Color; });
			else if (this._frameColorLinkage == ColorLinkage.Dependent && this._framePen != null)
				ColorGroupStyle.PrepareStyle(externalGroups, localGroups, delegate () { return this._framePen.Color; });

			IgnoreMissingDataPointsGroupStyle.PrepareStyle(externalGroups, localGroups, () => _ignoreMissingDataPoints);
			LineConnection2DGroupStyle.PrepareStyle(externalGroups, localGroups, () => new Tuple<ILineConnectionStyle, bool>(_connectionStyle, _connectCircular));
		}
Ejemplo n.º 37
0
		public override void CollectStyles(PlotGroupStyleCollection styles)
		{
		}
Ejemplo n.º 38
0
		public override void PrepareGroupStyles(PlotGroupStyleCollection externalGroups, IPlotArea layer)
		{
			Processed2DPlotData pdata = GetRangesAndPoints(layer);
			if (null == _localGroups)
				_localGroups = new PlotGroupStyleCollection() { ParentObject = this };

			using (var suspendToken = _localGroups.SuspendGetToken())
			{
				_localGroups.Clear();

				// first add missing local group styles
				_plotStyles.CollectLocalGroupStyles(externalGroups, _localGroups);

				// for the newly created group styles BeginPrepare must be called
				_localGroups.BeginPrepare();

				// now prepare the groups
				_plotStyles.PrepareGroupStyles(externalGroups, _localGroups, layer, pdata);

				// for the group styles in the local group, PrepareStep and EndPrepare must be called,
				_localGroups.PrepareStep();
				_localGroups.EndPrepare();

				suspendToken.ResumeSilently(); // we are not interested in changes in the _localGroup
			}
		}
Ejemplo n.º 39
0
		public void CollectExternalGroupStyles(PlotGroupStyleCollection externalGroups)
		{
		}
Ejemplo n.º 40
0
		public void ApplyGroupStyles(PlotGroupStyleCollection externalGroups, PlotGroupStyleCollection localGroups)
		{
			// IgnoreMissingDataPoints is the same for all sub plot styles
			IgnoreMissingDataPointsGroupStyle.ApplyStyle(externalGroups, localGroups, (ignoreMissingDataPoints) => this._ignoreMissingDataPoints = ignoreMissingDataPoints);

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

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

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

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

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

			// symbol size
			if (!_independentSymbolSize)
			{
				this._symbolSize = 0;
				SymbolSizeGroupStyle.ApplyStyle(externalGroups, localGroups, delegate (double size) { this._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);
				}
			}
		}
Ejemplo n.º 41
0
		public override void CollectStyles(PlotGroupStyleCollection styles)
		{
			// first add missing local group styles
			foreach (IG2DPlotStyle sps in _plotStyles)
				sps.CollectExternalGroupStyles(styles);
		}
Ejemplo n.º 42
0
		public void PrepareGroupStyles(PlotGroupStyleCollection externalGroups, PlotGroupStyleCollection localGroups, IPlotArea layer, Processed2DPlotData pdata)
		{
			if (this.IsColorProvider)
				ColorGroupStyle.PrepareStyle(externalGroups, localGroups, delegate () { return this.Color; });

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

			IgnoreMissingDataPointsGroupStyle.PrepareStyle(externalGroups, localGroups, () => _ignoreMissingDataPoints);
			LineConnection2DGroupStyle.PrepareStyle(externalGroups, localGroups, () => new Tuple<ILineConnectionStyle, bool>(_connectionStyle, _connectCircular));
		}
Ejemplo n.º 43
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; });
			}
		}
Ejemplo n.º 44
0
		public void PrepareGroupStyles(PlotGroupStyleCollection externalGroups, PlotGroupStyleCollection localGroups, IPlotArea layer, Processed3DPlotData pdata)
		{
			// first, we have to calculate the span of logical values from the minimum logical value to the maximum logical value
			int numberOfItems = 0;

			if (null != pdata)
			{
				double minLogicalX = double.MaxValue;
				double maxLogicalX = double.MinValue;
				double minLogicalY = double.MaxValue;
				double maxLogicalY = double.MinValue;
				foreach (int originalRowIndex in pdata.RangeList.OriginalRowIndices())
				{
					numberOfItems++;

					double logicalX = layer.XAxis.PhysicalVariantToNormal(pdata.GetXPhysical(originalRowIndex));
					if (logicalX < minLogicalX)
						minLogicalX = logicalX;
					if (logicalX > maxLogicalX)
						maxLogicalX = logicalX;

					double logicalY = layer.YAxis.PhysicalVariantToNormal(pdata.GetXPhysical(originalRowIndex));
					if (logicalY < minLogicalY)
						minLogicalY = logicalY;
					if (logicalY > maxLogicalY)
						maxLogicalY = logicalY;
				}

				BarSizePosition3DGroupStyle.IntendToApply(externalGroups, localGroups, numberOfItems, minLogicalX, maxLogicalX, minLogicalY, maxLogicalY);
			}
			BarSizePosition3DGroupStyle bwp = PlotGroupStyle.GetStyleToInitialize<BarSizePosition3DGroupStyle>(externalGroups, localGroups);
			if (null != bwp)
				bwp.Initialize(_barShiftStrategy, _barShiftMaxNumberOfItemsInOneDirection, _relInnerGapX, _relOuterGapX, _relInnerGapY, _relOuterGapY);

			if (!_independentColor) // else if is used here because fill color has precedence over frame color
				ColorGroupStyle.PrepareStyle(externalGroups, localGroups, delegate () { return this._pen.Color; });
		}
Ejemplo n.º 45
0
		public override void PrepareGroupStyles(PlotGroupStyleCollection externalGroups, IPlotArea layer)
		{
		}
Ejemplo n.º 46
0
    public override void PrepareStyles(PlotGroupStyleCollection externalGroups, IPlotArea layer)
    {
      Processed2DPlotData pdata = GetRangesAndPoints(layer);
      _localGroups = new PlotGroupStyleCollection();
      
      // first add missing local group styles
      foreach (IG2DPlotStyle sps in _plotStyles)
        sps.CollectLocalGroupStyles(externalGroups, _localGroups);

      // now prepare the groups
      
      foreach (IG2DPlotStyle sps in _plotStyles)
        sps.PrepareGroupStyles(externalGroups, _localGroups, layer, pdata);
    }
Ejemplo n.º 47
0
		public void PrepareGroupStyles(PlotGroupStyleCollection externalGroups, PlotGroupStyleCollection localGroups, IPlotArea layer, Processed2DPlotData pdata)
		{
			if (this.IsColorProvider)
				ColorGroupStyle.PrepareStyle(externalGroups, localGroups, delegate () { return this.LabelBrush.Color; });
			else if (this.IsBackgroundColorProvider)
				ColorGroupStyle.PrepareStyle(externalGroups, localGroups, delegate () { return this._backgroundStyle.Brush.Color; });

			// SkipFrequency should be the same for all sub plot styles, so there is no "private" property
			if (!_independentSkipFrequency)
				SkipFrequencyGroupStyle.PrepareStyle(externalGroups, localGroups, delegate () { return _skipFrequency; });

			// IgnoreMissingDataPoints should be the same for all sub plot styles, so there is no "private" property
			IgnoreMissingDataPointsGroupStyle.PrepareStyle(externalGroups, localGroups, () => _ignoreMissingDataPoints);
		}
Ejemplo n.º 48
0
		public void ApplyGroupStyles(PlotGroupStyleCollection externalGroups, PlotGroupStyleCollection localGroups)
		{
			// IgnoreMissingDataPoints is the same for all sub plot styles
			IgnoreMissingDataPointsGroupStyle.ApplyStyle(externalGroups, localGroups, (ignoreMissingDataPoints) => this._ignoreMissingDataPoints = ignoreMissingDataPoints);


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

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

			// Color
			_cachedColorForIndexFunction = null;

			if (this.IsColorReceiver)
			{
				// try to get a constant color ...
				ColorGroupStyle.ApplyStyle(externalGroups, localGroups, delegate (NamedColor c) { this.LabelBrush.Color = c; });
			}

			if (this.IsBackgroundColorReceiver)
			{
				if (this._backgroundColorLinkage == ColorLinkage.Dependent)
					ColorGroupStyle.ApplyStyle(externalGroups, localGroups, delegate (NamedColor c) { this._backgroundStyle.Brush.Color = c; });
				else if (this._backgroundColorLinkage == ColorLinkage.PreserveAlpha)
					ColorGroupStyle.ApplyStyle(externalGroups, localGroups, delegate (NamedColor c) { this._backgroundStyle.Brush.Color = c.NewWithAlphaValue(_backgroundStyle.Brush.Color.Color.A); });
			}

			if (this.IsColorReceiver || this.IsBackgroundColorReceiver)
			{
				// 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; });
			}

			// 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);
				}
			}
		}
Ejemplo n.º 49
0
		public void CollectLocalGroupStyles(PlotGroupStyleCollection externalGroups, PlotGroupStyleCollection localGroups)
		{
			ColorGroupStyle.AddLocalGroupStyle(externalGroups, localGroups);
			DashPatternGroupStyle.AddLocalGroupStyle(externalGroups, localGroups);
			IgnoreMissingDataPointsGroupStyle.AddLocalGroupStyle(externalGroups, localGroups);
			LineConnection2DGroupStyle.AddLocalGroupStyle(externalGroups, localGroups);
		}
Ejemplo n.º 50
0
		public void PrepareGroupStyles(PlotGroupStyleCollection externalGroups, PlotGroupStyleCollection localGroups, IPlotArea layer, Processed3DPlotData pdata)
		{
			if (!_independentColor)
				Graph.Plot.Groups.ColorGroupStyle.PrepareStyle(externalGroups, localGroups, delegate () { return this._strokePen.Color; });

			if (!_independentSkipFrequency)
				SkipFrequencyGroupStyle.PrepareStyle(externalGroups, localGroups, delegate () { return SkipFrequency; });

			// note: symbol size and barposition are only applied, but not prepared
			// this item can not be used as provider of a symbol size
		}
Ejemplo n.º 51
0
		public void ApplyGroupStyles(PlotGroupStyleCollection externalGroups, PlotGroupStyleCollection localGroups)
		{
			// IgnoreMissingDataPoints is the same for all sub plot styles
			IgnoreMissingDataPointsGroupStyle.ApplyStyle(externalGroups, localGroups, (ignoreMissingDataPoints) => this._ignoreMissingDataPoints = ignoreMissingDataPoints);

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

			if (ColorLinkage.Independent != _fillColorLinkage)
			{
				if (null == _fillBrush)
					_fillBrush = new BrushX(NamedColors.Black);

				if (_fillColorLinkage == ColorLinkage.Dependent)
					ColorGroupStyle.ApplyStyle(externalGroups, localGroups, delegate (NamedColor c) { _fillBrush.Color = c; });
				else if (ColorLinkage.PreserveAlpha == _fillColorLinkage)
					ColorGroupStyle.ApplyStyle(externalGroups, localGroups, delegate (NamedColor c) { _fillBrush.Color = c.NewWithAlphaValue(_fillBrush.Color.Color.A); });
			}
			if (ColorLinkage.Independent != _frameColorLinkage)
			{
				if (null == _framePen)
					ChildSetMember(ref _framePen, new PenX(NamedColors.Black));

				if (_frameColorLinkage == ColorLinkage.Dependent)
					ColorGroupStyle.ApplyStyle(externalGroups, localGroups, delegate (NamedColor c) { _framePen.Color = c; });
				else if (ColorLinkage.PreserveAlpha == _fillColorLinkage)
					ColorGroupStyle.ApplyStyle(externalGroups, localGroups, delegate (NamedColor c) { _framePen.Color = c.NewWithAlphaValue(_framePen.Color.Color.A); });
			}

			// 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);
				}
			}
		}
Ejemplo n.º 52
0
		public void CollectLocalGroupStyles(PlotGroupStyleCollection externalGroups, PlotGroupStyleCollection localGroups)
		{
			ColorGroupStyle.AddLocalGroupStyle(externalGroups, localGroups);
			SkipFrequencyGroupStyle.AddLocalGroupStyle(externalGroups, localGroups); // (local group style only)
		}
Ejemplo n.º 53
0
		public void CollectLocalGroupStyles(PlotGroupStyleCollection externalGroups, PlotGroupStyleCollection localGroups)
		{
			if (this.IsColorProvider)
				ColorGroupStyle.AddLocalGroupStyle(externalGroups, localGroups);

			SkipFrequencyGroupStyle.AddLocalGroupStyle(externalGroups, localGroups); // (local group style only)
			IgnoreMissingDataPointsGroupStyle.AddLocalGroupStyle(externalGroups, localGroups);
		}
Ejemplo n.º 54
0
		public void PrepareGroupStyles(PlotGroupStyleCollection externalGroups, PlotGroupStyleCollection localGroups, IPlotArea layer, Processed3DPlotData pdata)
		{
			if (this.IsColorProvider)
				ColorGroupStyle.PrepareStyle(externalGroups, localGroups, delegate () { return this.Color; });

			// SkipFrequency should be the same for all sub plot styles, so there is no "private" property
			if (!_independentSkipFreq)
				SkipFrequencyGroupStyle.PrepareStyle(externalGroups, localGroups, delegate () { return _skipFreq; });
		}
Ejemplo n.º 55
0
		public override void ApplyGroupStyles(PlotGroupStyleCollection externalGroups)
		{
			using (var suspendToken = _localGroups.SuspendGetToken())
			{
				// for externalGroups, BeginApply was called already in the PlotItemCollection, for localGroups it has to be called here
				_localGroups.BeginApply();

				_plotStyles.ApplyGroupStyles(externalGroups, _localGroups);

				// for externalGroups, EndApply is called later in the PlotItemCollection, for localGroups it has to be called here
				_localGroups.EndApply();

				suspendToken.ResumeSilently(); // we are not interested in changes in the _localGroup
			}
		}
Ejemplo n.º 56
0
		public void CollectExternalGroupStyles(PlotGroupStyleCollection externalGroups)
		{
			BarSizePosition3DGroupStyle.AddExternalGroupStyle(externalGroups);
		}
Ejemplo n.º 57
0
		public void CollectExternalGroupStyles(PlotGroupStyleCollection externalGroups)
		{
			if (!_independentColor)
				Graph.Plot.Groups.ColorGroupStyle.AddExternalGroupStyle(externalGroups);
		}
Ejemplo n.º 58
0
		public void CollectExternalGroupStyles(PlotGroupStyleCollection externalGroups)
		{
			if (this.IsColorProvider)
				ColorGroupStyle.AddExternalGroupStyle(externalGroups);

			ScatterSymbolGroupStyle.AddExternalGroupStyle(externalGroups);
		}
Ejemplo n.º 59
0
 public override void ApplyStyles(PlotGroupStyleCollection externalGroups)
 {
   
   foreach (IG2DPlotStyle sps in _plotStyles)
     sps.ApplyGroupStyles(externalGroups, _localGroups);
 }
Ejemplo n.º 60
0
		public void CollectLocalGroupStyles(PlotGroupStyleCollection externalGroups, PlotGroupStyleCollection localGroups)
		{
			if (!_independentColor)
				Graph.Plot.Groups.ColorGroupStyle.AddLocalGroupStyle(externalGroups, localGroups);

			if (!_independentSkipFrequency)
				SkipFrequencyGroupStyle.AddLocalGroupStyle(externalGroups, localGroups); // (local group only)
		}