public void ApplyGroupStyles(PlotGroupStyleCollection externalGroups, PlotGroupStyleCollection localGroups) { if (this.IsColorReceiver) { ColorGroupStyle.ApplyStyle(externalGroups, localGroups, delegate(PlotColor c) { this.Color = c; }); } }
public override void ApplyStyles(PlotGroupStyleCollection externalGroups) { foreach (IG2DPlotStyle sps in _plotStyles) { sps.ApplyGroupStyles(externalGroups, _localGroups); } }
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)); }); } }
public void CollectLocalGroupStyles(PlotGroupStyleCollection externalGroups, PlotGroupStyleCollection localGroups) { if (this.IsColorProvider) { ColorGroupStyle.AddLocalGroupStyle(externalGroups, localGroups); } }
public void CollectLocalGroupStyles(PlotGroupStyleCollection externalGroups, PlotGroupStyleCollection localGroups) { foreach (var ps in this) { ps.CollectLocalGroupStyles(externalGroups, localGroups); } }
/// <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); } }
public G2DPlotItemController(G2DPlotItem doc, PlotGroupStyleCollection parent) { if (!InitializeDocument(doc, parent)) { throw new ArgumentException(); } }
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) }
/// <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); } } }
public void CollectExternalGroupStyles(PlotGroupStyleCollection externalGroups) { if (!_independentColor) { Graph.Plot.Groups.ColorGroupStyle.AddExternalGroupStyle(externalGroups); } }
public void CollectExternalGroupStyles(PlotGroupStyleCollection externalGroups) { foreach (IG2DPlotStyle ps in this) { ps.CollectExternalGroupStyles(externalGroups); } }
/// <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); }
public void CollectLocalGroupStyles(PlotGroupStyleCollection externalGroups, PlotGroupStyleCollection localGroups) { ColorGroupStyle.AddLocalGroupStyle(externalGroups, localGroups); DashPatternGroupStyle.AddLocalGroupStyle(externalGroups, localGroups); IgnoreMissingDataPointsGroupStyle.AddLocalGroupStyle(externalGroups, localGroups); LineConnection2DGroupStyle.AddLocalGroupStyle(externalGroups, localGroups); }
public void PrepareGroupStyles(PlotGroupStyleCollection externalGroups, PlotGroupStyleCollection localGroups, IPlotArea layer, Processed2DPlotData pdata) { foreach (IG2DPlotStyle ps in this) { ps.PrepareGroupStyles(externalGroups, localGroups, layer, pdata); } }
public void ApplyGroupStyles(PlotGroupStyleCollection externalGroups, PlotGroupStyleCollection localGroups) { foreach (IG2DPlotStyle ps in this) { ps.ApplyGroupStyles(externalGroups, localGroups); } }
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 } }
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); }
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"); }
public override void CollectStyles(PlotGroupStyleCollection styles) { // first add missing local group styles foreach (IG2DPlotStyle sps in _plotStyles) { sps.CollectExternalGroupStyles(styles); } }
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); } } }
public void CollectExternalGroupStyles(PlotGroupStyleCollection externalGroups) { if (IsColorProvider) { ColorGroupStyle.AddExternalGroupStyle(externalGroups); } ScatterSymbolGroupStyle.AddExternalGroupStyle(externalGroups); }
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); } } }
public PlotItemCollection() { _plotItems = new ObservableList <IGPlotItem>(); _plotItems.CollectionChanged += EhPlotItemsCollectionChanged; _plotGroupStyles = new PlotGroupStyleCollection() { ParentObject = this }; }
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); }
/// <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)); }
/// <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); }
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")); } }
/// <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); }
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); } } }
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) } }
/// <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)); }
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; }); } }
public override void ApplyGroupStyles(PlotGroupStyleCollection externalGroups) { }
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); } } }
public void CollectLocalGroupStyles(PlotGroupStyleCollection externalGroups, PlotGroupStyleCollection localGroups) { BarSizePosition3DGroupStyle.AddLocalGroupStyle(externalGroups, localGroups); }
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)); }
public override void CollectStyles(PlotGroupStyleCollection styles) { }
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 } }
public void CollectExternalGroupStyles(PlotGroupStyleCollection externalGroups) { }
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); } } }
public override void CollectStyles(PlotGroupStyleCollection styles) { // first add missing local group styles foreach (IG2DPlotStyle sps in _plotStyles) sps.CollectExternalGroupStyles(styles); }
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)); }
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; }); } }
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; }); }
public override void PrepareGroupStyles(PlotGroupStyleCollection externalGroups, IPlotArea layer) { }
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); }
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); }
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); } } }
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 }
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); } } }
public void CollectLocalGroupStyles(PlotGroupStyleCollection externalGroups, PlotGroupStyleCollection localGroups) { ColorGroupStyle.AddLocalGroupStyle(externalGroups, localGroups); SkipFrequencyGroupStyle.AddLocalGroupStyle(externalGroups, localGroups); // (local group style only) }
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); }
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; }); }
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 } }
public void CollectExternalGroupStyles(PlotGroupStyleCollection externalGroups) { BarSizePosition3DGroupStyle.AddExternalGroupStyle(externalGroups); }
public void CollectExternalGroupStyles(PlotGroupStyleCollection externalGroups) { if (!_independentColor) Graph.Plot.Groups.ColorGroupStyle.AddExternalGroupStyle(externalGroups); }
public void CollectExternalGroupStyles(PlotGroupStyleCollection externalGroups) { if (this.IsColorProvider) ColorGroupStyle.AddExternalGroupStyle(externalGroups); ScatterSymbolGroupStyle.AddExternalGroupStyle(externalGroups); }
public override void ApplyStyles(PlotGroupStyleCollection externalGroups) { foreach (IG2DPlotStyle sps in _plotStyles) sps.ApplyGroupStyles(externalGroups, _localGroups); }
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) }