public void CopyFrom(ScatterPlotStyle from, bool suppressChangeEvent) { this._shape = from._shape; this._style = from._style; if (null == this._dropLine) { this._dropLine = new CSPlaneIDList(); } else { this._dropLine.Clear(); } this._dropLine.AddClonedRange(from._dropLine); this._pen = null == from._pen ? null : (PenX)from._pen.Clone(); this._independentColor = from._independentColor; this._independentSymbolSize = from._independentSymbolSize; this._symbolSize = from._symbolSize; this._relativePenWidth = from._relativePenWidth; this._skipFreq = from._skipFreq; this._cachedPath = null == from._cachedPath ? null : (GraphicsPath)from._cachedPath.Clone(); this._cachedFillPath = from._cachedFillPath; this._cachedFillBrush = null == from._cachedFillBrush ? null : (BrushX)from._cachedFillBrush.Clone(); this._parent = from._parent; if (!suppressChangeEvent) { OnChanged(); } }
public ScatterPlotStyle(XYPlotScatterStyles.Shape shape, XYPlotScatterStyles.Style style, float size, float penWidth, Color penColor) { _shape = shape; _style = style; _dropLine = new CSPlaneIDList(); _pen = new PenX(penColor, penWidth); _symbolSize = size; _relativePenWidth = penWidth / size; _skipFreq = 1; // Cached values SetCachedValues(); CreateEventChain(); }
public ScatterPlotStyle() { this._shape = XYPlotScatterStyles.Shape.Square; this._style = XYPlotScatterStyles.Style.Solid; this._dropLine = new CSPlaneIDList(); this._pen = new PenX(Color.Black); this._independentColor = false; this._symbolSize = 8; this._relativePenWidth = 0.1f; this._skipFreq = 1; this._cachedFillPath = true; // since default is solid this._cachedFillBrush = new BrushX(Color.Black); this._cachedPath = GetPath(_shape, _style, _symbolSize); CreateEventChain(); }
public void CopyFrom(ScatterPlotStyle from, bool suppressChangeEvent) { this._shape = from._shape; this._style = from._style; if(null==this._dropLine) this._dropLine = new CSPlaneIDList(); else this._dropLine.Clear(); this._dropLine.AddClonedRange(from._dropLine); this._pen = null == from._pen ? null : (PenX)from._pen.Clone(); this._independentColor = from._independentColor; this._independentSymbolSize = from._independentSymbolSize; this._symbolSize = from._symbolSize; this._relativePenWidth = from._relativePenWidth; this._skipFreq = from._skipFreq; this._cachedPath = null == from._cachedPath ? null : (GraphicsPath)from._cachedPath.Clone(); this._cachedFillPath = from._cachedFillPath; this._cachedFillBrush = null == from._cachedFillBrush ? null : (BrushX)from._cachedFillBrush.Clone(); this._parent = from._parent; if (!suppressChangeEvent) OnChanged(); }
public static GraphicsPath GetPath(XYPlotScatterStyles.Shape sh, XYPlotScatterStyles.Style st, float size) { float sizeh = size / 2; GraphicsPath gp = new GraphicsPath(); switch (sh) { case XYPlotScatterStyles.Shape.Square: gp.AddRectangle(new RectangleF(-sizeh, -sizeh, size, size)); gp.StartFigure(); break; case XYPlotScatterStyles.Shape.Circle: gp.AddEllipse(-sizeh, -sizeh, size, size); gp.StartFigure(); break; case XYPlotScatterStyles.Shape.UpTriangle: gp.AddLine(0, -sizeh, 0.3301270189f * size, 0.5f * sizeh); gp.AddLine(0.43301270189f * size, 0.5f * sizeh, -0.43301270189f * size, 0.5f * sizeh); gp.CloseFigure(); break; case XYPlotScatterStyles.Shape.DownTriangle: gp.AddLine(-0.43301270189f * sizeh, -0.5f * sizeh, 0.43301270189f * size, -0.5f * sizeh); gp.AddLine(0.43301270189f * size, -0.5f * sizeh, 0, sizeh); gp.CloseFigure(); break; case XYPlotScatterStyles.Shape.Diamond: gp.AddLine(0, -sizeh, sizeh, 0); gp.AddLine(sizeh, 0, 0, sizeh); gp.AddLine(0, sizeh, -sizeh, 0); gp.CloseFigure(); break; case XYPlotScatterStyles.Shape.CrossPlus: gp.AddLine(-sizeh, 0, sizeh, 0); gp.StartFigure(); gp.AddLine(0, sizeh, 0, -sizeh); gp.StartFigure(); break; case XYPlotScatterStyles.Shape.CrossTimes: gp.AddLine(-sizeh, -sizeh, sizeh, sizeh); gp.StartFigure(); gp.AddLine(-sizeh, sizeh, sizeh, -sizeh); gp.StartFigure(); break; case XYPlotScatterStyles.Shape.Star: gp.AddLine(-sizeh, 0, sizeh, 0); gp.StartFigure(); gp.AddLine(0, sizeh, 0, -sizeh); gp.StartFigure(); gp.AddLine(-sizeh, -sizeh, sizeh, sizeh); gp.StartFigure(); gp.AddLine(-sizeh, sizeh, sizeh, -sizeh); gp.StartFigure(); break; case XYPlotScatterStyles.Shape.BarHorz: gp.AddLine(-sizeh, 0, sizeh, 0); gp.StartFigure(); break; case XYPlotScatterStyles.Shape.BarVert: gp.AddLine(0, -sizeh, 0, sizeh); gp.StartFigure(); break; } switch (st) { case XYPlotScatterStyles.Style.DotCenter: gp.AddEllipse(-0.125f * sizeh, -0.125f * sizeh, 0.125f * size, 0.125f * size); gp.StartFigure(); break; case XYPlotScatterStyles.Style.Plus: gp.AddLine(-sizeh, 0, sizeh, 0); gp.StartFigure(); gp.AddLine(0, sizeh, 0, -sizeh); gp.StartFigure(); break; case XYPlotScatterStyles.Style.Times: gp.AddLine(-sizeh, -sizeh, sizeh, sizeh); gp.StartFigure(); gp.AddLine(-sizeh, sizeh, sizeh, -sizeh); gp.StartFigure(); break; case XYPlotScatterStyles.Style.BarHorz: gp.AddLine(-sizeh, 0, sizeh, 0); gp.StartFigure(); break; case XYPlotScatterStyles.Style.BarVert: gp.AddLine(0, -sizeh, 0, sizeh); gp.StartFigure(); break; } return(gp); }