public virtual void Paint(GraphicsLayer.IGraphics g, int width, int height) { var bounds = ComputeBounds(g, width, height); if (!string.IsNullOrEmpty(_label)) { if (Color.Equals(default(GraphicsLayer.ARGB))) { if (IsUniversal) { g.FillEllipse(UniversalVertexFillBrushColor, bounds); } } else { g.FillEllipse(Color, bounds); } g.DrawEllipse(_IsSelected ? BoundarySelectedPenColor : BoundaryPenColor, bounds, _IsSelected ? BoundarySelectedPenWidth : 1); g.DrawString(_label, LabelFont, LabelBrushColor, bounds); } else { if (Color.Equals(default(GraphicsLayer.ARGB))) { g.FillEllipse(IsUniversal ? UniversalVertexFillBrushColor : DefaultFillBrushColor, bounds); } else { g.FillEllipse(Color, bounds); } g.DrawEllipse(_IsSelected ? BoundarySelectedPenColor : BoundaryPenColor, bounds, _IsSelected ? BoundarySelectedPenWidth : 1); } }
public virtual void Paint(GraphicsLayer.IGraphics g, int width, int height) { var bounds = ComputeBounds(g, width, height); if (!string.IsNullOrEmpty(_label)) { if (Color.Equals(default(GraphicsLayer.ARGB))) { if (IsUniversal) { g.FillEllipse(UniversalVertexFillBrushColor, bounds); } } else { g.FillEllipse(Color, bounds); } g.DrawEllipse(_IsSelected ? BoundarySelectedPenColor : BoundaryPenColor, bounds, _IsSelected ? BoundarySelectedPenWidth : 1); g.DrawString(_label, LabelFont, LabelBrushColor, bounds); } else { if (Color.Equals(default(GraphicsLayer.ARGB))) { g.FillEllipse(IsUniversal ? UniversalVertexFillBrushColor : DefaultFillBrushColor, bounds); } else { g.FillEllipse(Color, bounds); } g.DrawEllipse(_IsSelected ? BoundarySelectedPenColor : BoundaryPenColor, bounds, _IsSelected ? BoundarySelectedPenWidth : 1); } if (_showIndex) { var cx = (bounds.Left + bounds.Right) / 2; var cy = (bounds.Bottom + bounds.Top) / 2; var r = Math.Max(bounds.Width, bounds.Height) / 2 + 5; var bb = new GraphicsLayer.Box(cx + r * Math.Cos(IndexAngle) - 5, cy + r * Math.Sin(IndexAngle) - 5, 10, 10); g.DrawString(ParentIndex.ToString(), IndexFont, IndexBrushColor, bb); } }