public SymbolDoubleEllipse() { Syncfusion.Windows.Forms.Diagram.Ellipse ellipse; ellipse = new Syncfusion.Windows.Forms.Diagram.Ellipse(0, 0, 15, 15); ellipse.FillStyle.Color = Color.Blue; this.AppendChild(ellipse); ellipse = new Syncfusion.Windows.Forms.Diagram.Ellipse(3, 3, 10, 10); ellipse.FillStyle.Color = Color.LightGray; this.AppendChild(ellipse); this.EditStyle.AllowSelect = false; }
/// <summary> /// Initialize the Diagram /// </summary> protected void InitailizeDiagram() { Layer rectanglelayer = CreateLayer("Rectangle Layer"); Layer ellipselayer = CreateLayer("Ellipse Layer"); Layer roundRectlayer = CreateLayer("RoundRect Layer"); float rectPinPointX = 50, ellipsePinPointX = 300, roundRectPinPointX = 550, PinPointY = 75; for (int i = 0; i < 4; i++) { Syncfusion.Windows.Forms.Diagram.Rectangle rect = new Syncfusion.Windows.Forms.Diagram.Rectangle(rectPinPointX, PinPointY, 200, 50); rect.FillStyle.Color = Color.FromArgb(240, 242, 240); rect.FillStyle.ForeColor = Color.White; rect.FillStyle.Type = FillStyleType.LinearGradient; rect.LineStyle.LineColor = Color.DarkGray; //rect.Name = "Rectangle" + (i + 1); AddLabel(rect.Name, rect); diagram1.Model.AppendChild(rect); rectanglelayer.Nodes.Add(rect); rect.Layers.Add(rectanglelayer); Syncfusion.Windows.Forms.Diagram.Ellipse ellipse = new Syncfusion.Windows.Forms.Diagram.Ellipse(ellipsePinPointX, PinPointY, 200, 50); ellipse.FillStyle.Color = Color.FromArgb(240, 242, 240); ellipse.FillStyle.ForeColor = Color.White; ellipse.FillStyle.Type = FillStyleType.LinearGradient; ellipse.LineStyle.LineColor = Color.DarkGray; // ellipse.Name = "Ellipse" + (i + 1); AddLabel(ellipse.Name, ellipse); diagram1.Model.AppendChild(ellipse); ellipselayer.Nodes.Add(ellipse); ellipse.Layers.Add(ellipselayer); Syncfusion.Windows.Forms.Diagram.RoundRect roundRect = new Syncfusion.Windows.Forms.Diagram.RoundRect(roundRectPinPointX, PinPointY, 200, 50, MeasureUnits.Pixel); roundRect.FillStyle.Color = Color.FromArgb(240, 242, 240); roundRect.FillStyle.ForeColor = Color.White; roundRect.FillStyle.Type = FillStyleType.LinearGradient; roundRect.LineStyle.LineColor = Color.DarkGray; // roundRect.Name = "RoundRect" + (i + 1); AddLabel(roundRect.Name, roundRect); diagram1.Model.AppendChild(roundRect); roundRectlayer.Nodes.Add(roundRect); roundRect.Layers.Add(roundRectlayer); PinPointY += 125; } }
public EllipseRectGroup(int number, string header, string content, Color HeaderColor, Color ContentColor, Color HeaderBackColor, Color ContentBackColor) { RectangleF rect = new RectangleF(55, 3, 290, 45); TextNode nodeRectHeader = new TextNode(header, rect); nodeRectHeader.BackgroundStyle.Color = HeaderBackColor; nodeRectHeader.LineStyle.LineWidth = 0; nodeRectHeader.FontStyle.Size = 14; nodeRectHeader.FontStyle.Bold = false; nodeRectHeader.FontStyle.Italic = true; nodeRectHeader.FontColorStyle.Color = HeaderColor; nodeRectHeader.ReadOnly = true; nodeRectHeader.HorizontalAlignment = StringAlignment.Near; nodeRectHeader.VerticalAlignment = StringAlignment.Center; rect = new RectangleF(0, 50, 350, 90); TextNode nodeRectContent = new TextNode(content, rect); nodeRectContent.BackgroundStyle.Color = ContentBackColor; nodeRectContent.LineStyle.LineWidth = 1; nodeRectContent.FontStyle.Size = 11; nodeRectContent.FontStyle.Bold = false; nodeRectContent.FontColorStyle.Color = ContentColor; nodeRectContent.ReadOnly = true; Syncfusion.Windows.Forms.Diagram.Ellipse numberEllipse = new Syncfusion.Windows.Forms.Diagram.Ellipse(5, 3, 35, 35); numberEllipse.FillStyle.Color = Color.White; Syncfusion.Windows.Forms.Diagram.Label lble = new Syncfusion.Windows.Forms.Diagram.Label(); lble.Text = number.ToString(); lble.SizeToNode = true; lble.Position = Position.Center; lble.FontStyle.Size = 12; lble.FontStyle.Bold = true; numberEllipse.Labels.Add(lble); Syncfusion.Windows.Forms.Diagram.Rectangle nodeRectBorder = new Syncfusion.Windows.Forms.Diagram.Rectangle(0, 0, 350, 50); nodeRectBorder.FillStyle.Color = Color.LightBlue; nodeRectBorder.LineStyle.LineWidth = 1; this.AppendChild(nodeRectBorder); this.AppendChild(numberEllipse); this.AppendChild(nodeRectHeader); this.AppendChild(nodeRectContent); this.EditStyle.AllowSelect = false; }
public HeaderandEllipse(int number, string content, Color ContentColor, Color Background, int fontsize) { RectangleF rect = new RectangleF(55, 3, 140, 45); TextNode txtContent = new TextNode(content, rect); txtContent.BackgroundStyle.Color = Color.LightBlue; txtContent.LineStyle.LineWidth = 0; txtContent.FontStyle.Size = fontsize; txtContent.FontStyle.Bold = true; txtContent.FontStyle.Italic = true; txtContent.FontColorStyle.Color = ContentColor; txtContent.ReadOnly = true; txtContent.HorizontalAlignment = StringAlignment.Near; txtContent.VerticalAlignment = StringAlignment.Center; Syncfusion.Windows.Forms.Diagram.Ellipse numberEllipse = new Syncfusion.Windows.Forms.Diagram.Ellipse(5, 3, 35, 35); numberEllipse.FillStyle.Color = Color.White; Syncfusion.Windows.Forms.Diagram.Label lble = new Syncfusion.Windows.Forms.Diagram.Label(); lble.Text = number.ToString(); lble.SizeToNode = true; lble.Position = Position.Center; lble.FontStyle.Size = 12; lble.FontStyle.Bold = true; numberEllipse.Labels.Add(lble); Syncfusion.Windows.Forms.Diagram.Rectangle nodeRectBorder = new Syncfusion.Windows.Forms.Diagram.Rectangle(0, 0, 200, 50); nodeRectBorder.FillStyle.Color = Background; nodeRectBorder.LineStyle.LineWidth = 1; //nodeRectBorder.EnableCentralPort = true; //numberEllipse.EnableCentralPort = true; //nodeRectHeader.EnableCentralPort = true; this.AppendChild(nodeRectBorder); this.AppendChild(numberEllipse); this.AppendChild(txtContent); this.EditStyle.AllowSelect = false; }
void LoadDiagram() { this.diagram1.Model.HistoryManager.Pause(); this.diagram1.Model.RenderingStyle.SmoothingMode = SmoothingMode.HighQuality; Syncfusion.Windows.Forms.Diagram.Ellipse ellipse = new Syncfusion.Windows.Forms.Diagram.Ellipse(495, 5, 110, 70); ellipse.FillStyle.Type = FillStyleType.LinearGradient; ellipse.FillStyle.Color = Color.FromArgb(51, 153, 255); ellipse.FillStyle.ForeColor = Color.FromArgb(51, 153, 255); ellipse.LineStyle.LineColor = Color.Black; ellipse.LineStyle.LineWidth = 2.0f; ellipse.LineStyle.LineJoin = LineJoin.Miter; Syncfusion.Windows.Forms.Diagram.Label label = new Syncfusion.Windows.Forms.Diagram.Label(); label.Text = "Start"; label.FontStyle.Family = "Arial"; ellipse.Labels.Add(label); diagram1.Model.AppendChild(ellipse); Syncfusion.Windows.Forms.Diagram.Rectangle process = new Syncfusion.Windows.Forms.Diagram.Rectangle(500, 100, 100, 70); process.FillStyle.Type = FillStyleType.LinearGradient; process.FillStyle.Color = Color.FromArgb(51, 153, 255); process.FillStyle.ForeColor = Color.FromArgb(51, 153, 255); process.LineStyle.LineColor = Color.Black; process.LineStyle.LineWidth = 2.0f; process.LineStyle.LineJoin = LineJoin.Miter; Syncfusion.Windows.Forms.Diagram.Label label2 = new Syncfusion.Windows.Forms.Diagram.Label(); label2.Text = "Process"; label2.FontStyle.Family = "Arial"; process.Labels.Add(label2); diagram1.Model.AppendChild(process); OrthogonalConnector link = new OrthogonalConnector(ellipse.PinPoint, process.PinPoint); link.LineStyle.LineColor = Color.Black; link.LineStyle.LineWidth = 2f; diagram1.Model.AppendChild(link); link.HeadDecorator.DecoratorShape = DecoratorShape.Filled45Arrow; link.HeadDecorator.Size = new SizeF(8, 8); link.HeadDecorator.FillStyle.Color = Color.Black; link.HeadDecorator.LineStyle.LineColor = Color.Black; ellipse.CentralPort.TryConnect(link.TailEndPoint); process.CentralPort.TryConnect(link.HeadEndPoint); Polygon decision = new Polygon(new PointF[] { new PointF(0, 50), new PointF(50, 0), new PointF(100, 50), new PointF(50, 100), new PointF(0, 50) }); decision.FillStyle.Type = FillStyleType.LinearGradient; decision.FillStyle.Color = Color.FromArgb(51, 153, 255); decision.FillStyle.ForeColor = Color.FromArgb(51, 153, 255); decision.LineStyle.LineColor = Color.Black; decision.LineStyle.LineWidth = 2.0f; decision.LineStyle.LineJoin = LineJoin.Miter; Syncfusion.Windows.Forms.Diagram.Label label3 = new Syncfusion.Windows.Forms.Diagram.Label(); label3.Text = "Decision"; label3.FontStyle.Family = "Arial"; decision.Labels.Add(label3); decision.PinPoint = new PointF(550, 250); diagram1.Model.AppendChild(decision); OrthogonalConnector link2 = new OrthogonalConnector(decision.PinPoint, process.PinPoint); link2.LineStyle.LineColor = Color.Black; link2.LineStyle.LineWidth = 2f; diagram1.Model.AppendChild(link2); link2.TailDecorator.DecoratorShape = DecoratorShape.Filled45Arrow; link2.TailDecorator.Size = new SizeF(8, 8); link2.TailDecorator.FillStyle.Color = Color.Black; link2.TailDecorator.LineStyle.LineColor = Color.Black; decision.CentralPort.TryConnect(link2.TailEndPoint); process.CentralPort.TryConnect(link2.HeadEndPoint); Syncfusion.Windows.Forms.Diagram.Rectangle process2 = new Syncfusion.Windows.Forms.Diagram.Rectangle(500, 325, 100, 70); process2.FillStyle.Type = FillStyleType.LinearGradient; process2.FillStyle.Color = Color.FromArgb(51, 153, 255); process2.FillStyle.ForeColor = Color.FromArgb(51, 153, 255); process2.LineStyle.LineColor = Color.Black; process2.LineStyle.LineWidth = 2.0f; process2.LineStyle.LineJoin = LineJoin.Miter; Syncfusion.Windows.Forms.Diagram.Label label4 = new Syncfusion.Windows.Forms.Diagram.Label(); label4.Text = "Process2"; label4.FontStyle.Family = "Arial"; process2.Labels.Add(label4); diagram1.Model.AppendChild(process2); diagram1.Model.AppendChild(decision); OrthogonalConnector link3 = new OrthogonalConnector(decision.PinPoint, process2.PinPoint); link3.LineStyle.LineColor = Color.Black; link3.LineStyle.LineWidth = 2f; diagram1.Model.AppendChild(link3); link3.TailDecorator.DecoratorShape = DecoratorShape.Filled45Arrow; link3.TailDecorator.Size = new SizeF(8, 8); link3.TailDecorator.FillStyle.Color = Color.Black; link3.TailDecorator.LineStyle.LineColor = Color.Black; decision.CentralPort.TryConnect(link3.HeadEndPoint); process2.CentralPort.TryConnect(link3.TailEndPoint); Syncfusion.Windows.Forms.Diagram.Ellipse ellipse2 = new Syncfusion.Windows.Forms.Diagram.Ellipse(495, 420, 110, 70); ellipse2.FillStyle.Type = FillStyleType.LinearGradient; ellipse2.FillStyle.Color = Color.FromArgb(51, 153, 255); ellipse2.FillStyle.ForeColor = Color.FromArgb(51, 153, 255); ellipse2.LineStyle.LineColor = Color.Black; ellipse2.LineStyle.LineWidth = 2.0f; ellipse2.LineStyle.LineJoin = LineJoin.Miter; Syncfusion.Windows.Forms.Diagram.Label label5 = new Syncfusion.Windows.Forms.Diagram.Label(); label5.Text = "End"; label5.FontStyle.Family = "Arial"; ellipse2.Labels.Add(label5); diagram1.Model.AppendChild(ellipse2); diagram1.Model.AppendChild(decision); OrthogonalConnector link4 = new OrthogonalConnector(process2.PinPoint, ellipse2.PinPoint); link4.LineStyle.LineColor = Color.Black; link4.LineStyle.LineWidth = 2f; diagram1.Model.AppendChild(link4); link4.HeadDecorator.DecoratorShape = DecoratorShape.Filled45Arrow; link4.HeadDecorator.Size = new SizeF(8, 8); link4.HeadDecorator.FillStyle.Color = Color.Black; link4.HeadDecorator.LineStyle.LineColor = Color.Black; ellipse2.CentralPort.TryConnect(link4.HeadEndPoint); process2.CentralPort.TryConnect(link4.TailEndPoint); this.diagram1.Model.HistoryManager.Resume(); diagram1.View.SelectionList.Clear(); }
public HeaderRectangleActual() { Syncfusion.Windows.Forms.Diagram.Rectangle MainRect = new Syncfusion.Windows.Forms.Diagram.Rectangle(0, 0, 200, 150); MainRect.FillStyle.Color = Color.White; MainRect.LineStyle.LineColor = Color.Black; Syncfusion.Windows.Forms.Diagram.Rectangle HeadContent = new Syncfusion.Windows.Forms.Diagram.Rectangle(MainRect.BoundingRectangle.Width / 2 - 50, -10, 100, 20); HeadContent.FillStyle.Color = Color.LightYellow; Syncfusion.Windows.Forms.Diagram.Label lbl = new Syncfusion.Windows.Forms.Diagram.Label(); lbl.Text = "Actual"; lbl.SizeToNode = true; lbl.Position = Position.Center; lbl.FontStyle.Size = 12; lbl.FontStyle.Bold = true; HeadContent.Labels.Add(lbl); this.AppendChild(MainRect); this.AppendChild(HeadContent); Syncfusion.Windows.Forms.Diagram.Ellipse ellipse; ellipse = new Syncfusion.Windows.Forms.Diagram.Ellipse(10, 40, 15, 15); ellipse.FillStyle.Color = Color.Green; RectangleF rect = new RectangleF(30, 35, 150, 25); TextNode txtContent = new TextNode("=OnSchedule", rect); txtContent.BackgroundStyle.Color = Color.Transparent; txtContent.LineStyle.LineWidth = 0; txtContent.FontStyle.Size = 10; txtContent.ReadOnly = true; txtContent.HorizontalAlignment = StringAlignment.Near; txtContent.VerticalAlignment = StringAlignment.Center; this.AppendChild(txtContent); this.AppendChild(ellipse); ellipse = new Syncfusion.Windows.Forms.Diagram.Ellipse(10, 70, 15, 15); ellipse.FillStyle.Color = Color.Yellow; rect = new RectangleF(30, 65, 150, 25); txtContent = new TextNode("=Behind Schedule", rect); txtContent.BackgroundStyle.Color = Color.Transparent; txtContent.LineStyle.LineWidth = 0; txtContent.FontStyle.Size = 10; txtContent.ReadOnly = true; txtContent.HorizontalAlignment = StringAlignment.Near; txtContent.VerticalAlignment = StringAlignment.Center; this.AppendChild(txtContent); this.AppendChild(ellipse); ellipse = new Syncfusion.Windows.Forms.Diagram.Ellipse(10, 100, 15, 15); ellipse.FillStyle.Color = Color.Red; rect = new RectangleF(30, 95, 150, 25); txtContent = new TextNode("=Critically Behind", rect); txtContent.BackgroundStyle.Color = Color.Transparent; txtContent.LineStyle.LineWidth = 0; txtContent.FontStyle.Size = 10; txtContent.ReadOnly = true; txtContent.HorizontalAlignment = StringAlignment.Near; txtContent.VerticalAlignment = StringAlignment.Center; this.AppendChild(txtContent); this.AppendChild(ellipse); ellipse = new Syncfusion.Windows.Forms.Diagram.Ellipse(10, 130, 15, 15); ellipse.FillStyle.Color = Color.Blue; rect = new RectangleF(30, 125, 120, 25); txtContent = new TextNode("=Complete", rect); txtContent.BackgroundStyle.Color = Color.Transparent; txtContent.LineStyle.LineWidth = 0; txtContent.FontStyle.Size = 10; txtContent.ReadOnly = true; txtContent.HorizontalAlignment = StringAlignment.Near; txtContent.VerticalAlignment = StringAlignment.Center; this.AppendChild(txtContent); this.AppendChild(ellipse); this.EditStyle.AllowSelect = false; }
private Ellipse getEllipse(float x, float y, Color color) { Syncfusion.Windows.Forms.Diagram.Ellipse Ellipse = new Syncfusion.Windows.Forms.Diagram.Ellipse(x, y + 75f, 15, 15); Ellipse.FillStyle.Color = color; return(Ellipse); }
public HeaderRectanglePlan() { Syncfusion.Windows.Forms.Diagram.Rectangle MainRect = new Syncfusion.Windows.Forms.Diagram.Rectangle(0, 0, 200, 150); MainRect.FillStyle.Color = Color.White; MainRect.LineStyle.LineColor = Color.Black; Syncfusion.Windows.Forms.Diagram.Rectangle HeadContent = new Syncfusion.Windows.Forms.Diagram.Rectangle(MainRect.BoundingRectangle.Width / 2 - 50, -10, 100, 20); HeadContent.FillStyle.Color = Color.LightYellow; Syncfusion.Windows.Forms.Diagram.Label lbl = new Syncfusion.Windows.Forms.Diagram.Label(); lbl.Text = "Plan"; lbl.SizeToNode = true; lbl.Position = Position.Center; lbl.FontStyle.Size = 12; lbl.FontStyle.Bold = true; HeadContent.Labels.Add(lbl); this.AppendChild(MainRect); this.AppendChild(HeadContent); Syncfusion.Windows.Forms.Diagram.Rectangle rects; rects = new Syncfusion.Windows.Forms.Diagram.Rectangle(15, 30, 10, 10); rects.FillStyle.Color = Color.Yellow; rects.LineStyle.LineColor = Color.Black; this.AppendChild(rects); rects = new Syncfusion.Windows.Forms.Diagram.Rectangle(20, 35, 10, 10); rects.FillStyle.Color = Color.Yellow; rects.LineStyle.LineColor = Color.Black; this.AppendChild(rects); RectangleF rect = new RectangleF(40, 30, 150, 25); TextNode txtContent = new TextNode("-Planning", rect); txtContent.BackgroundStyle.Color = Color.Transparent; txtContent.LineStyle.LineWidth = 0; txtContent.FontStyle.Size = 10; txtContent.ReadOnly = true; txtContent.HorizontalAlignment = StringAlignment.Near; txtContent.VerticalAlignment = StringAlignment.Center; this.AppendChild(txtContent); PointF[] pts = new PointF[] { new PointF(25, 5), new PointF(5, 5), new PointF(15, 15) }; Syncfusion.Windows.Forms.Diagram.Polygon triangle = new Syncfusion.Windows.Forms.Diagram.Polygon(pts); triangle.PinPoint = new PointF(15 + triangle.BoundingRectangle.Width / 2, 65); triangle.FillStyle.Color = Color.White; this.AppendChild(triangle); rect = new RectangleF(40, 52.5f, 150, 25); txtContent = new TextNode("-Activity", rect); txtContent.BackgroundStyle.Color = Color.Transparent; txtContent.LineStyle.LineWidth = 0; txtContent.FontStyle.Size = 10; txtContent.ReadOnly = true; txtContent.HorizontalAlignment = StringAlignment.Near; txtContent.VerticalAlignment = StringAlignment.Center; this.AppendChild(txtContent); pts = new PointF[] { new PointF(15, 15), new PointF(0, 15), new PointF(5, 5), new PointF(10, 5), new PointF(10, 0), new PointF(15, 0) }; Syncfusion.Windows.Forms.Diagram.PolylineNode star = new Syncfusion.Windows.Forms.Diagram.PolylineNode(pts); star.PinPoint = new PointF(15 + triangle.BoundingRectangle.Width / 2, 88); star.LineStyle.LineColor = Color.Black; this.AppendChild(star); rect = new RectangleF(40, 77.5f, 150, 25); txtContent = new TextNode("-StartUp", rect); txtContent.BackgroundStyle.Color = Color.Transparent; txtContent.LineStyle.LineWidth = 0; txtContent.FontStyle.Size = 10; txtContent.ReadOnly = true; txtContent.HorizontalAlignment = StringAlignment.Near; txtContent.VerticalAlignment = StringAlignment.Center; this.AppendChild(txtContent); Syncfusion.Windows.Forms.Diagram.Ellipse ellipse; ellipse = new Syncfusion.Windows.Forms.Diagram.Ellipse(18, 105, 15, 15); ellipse.FillStyle.Color = Color.Blue; ellipse.LineStyle.LineWidth = 0; this.AppendChild(ellipse); ellipse = new Syncfusion.Windows.Forms.Diagram.Ellipse(20.5f, 107.5f, 10, 10); ellipse.FillStyle.Color = Color.Gray; ellipse.LineStyle.LineWidth = 0; this.AppendChild(ellipse); rect = new RectangleF(40, 100, 150, 25); txtContent = new TextNode("-Cost Savings Sort", rect); txtContent.BackgroundStyle.Color = Color.Transparent; txtContent.LineStyle.LineWidth = 0; txtContent.FontStyle.Size = 10; txtContent.ReadOnly = true; txtContent.HorizontalAlignment = StringAlignment.Near; txtContent.VerticalAlignment = StringAlignment.Center; this.AppendChild(txtContent); pts = new PointF[] { new PointF(0, 5), new PointF(5, 5), new PointF(10, 0), new PointF(15, 5), new PointF(20, 5), new PointF(15, 10), new PointF(20, 15), new PointF(15, 15), new PointF(10, 20), new PointF(5, 15), new PointF(0, 15), new PointF(5, 10), new PointF(0, 5) }; Syncfusion.Windows.Forms.Diagram.Polygon star1 = new Syncfusion.Windows.Forms.Diagram.Polygon(pts); star1.PinPoint = new PointF(17 + star1.BoundingRectangle.Width / 2, 140); star1.FillStyle.Color = Color.Gray; this.AppendChild(star1); rect = new RectangleF(40, 127, 150, 25); txtContent = new TextNode("-Evaluate & Close", rect); txtContent.BackgroundStyle.Color = Color.Transparent; txtContent.LineStyle.LineWidth = 0; txtContent.FontStyle.Size = 10; txtContent.ReadOnly = true; txtContent.HorizontalAlignment = StringAlignment.Near; txtContent.VerticalAlignment = StringAlignment.Center; this.AppendChild(txtContent); this.EditStyle.AllowSelect = false; }