Esempio n. 1
0
    /// <summary>
    /// Initialize a new instance of the class.
    /// </summary>
    /// <param name="fileName"></param>
    public EmpSymbol(string fileName)
    {
        Syncfusion.Windows.Forms.Diagram.Rectangle groupRect = new Syncfusion.Windows.Forms.Diagram.Rectangle(0, 0, 255, 75);
        groupRect.Name                  = "Rectangle";
        groupRect.FillStyle.Type        = FillStyleType.LinearGradient;
        groupRect.FillStyle.ForeColor   = Color.White;
        groupRect.FillStyle.Color       = System.Drawing.Color.FromArgb(240, 242, 240);
        groupRect.LineStyle.LineColor   = Color.Black;
        groupRect.LineStyle.LineWidth   = 1;
        groupRect.EditStyle.AllowSelect = false;
        this.AppendChild(groupRect);

        System.Drawing.Bitmap bitmap = new System.Drawing.Bitmap(fileName);
        System.Drawing.Image  Image  = bitmap.GetThumbnailImage(60, 50, null, IntPtr.Zero);
        bitmap = new System.Drawing.Bitmap(Image);

        BitmapNode bitmapNode = new BitmapNode(bitmap);

        bitmapNode.PinPoint              = new PointF(bitmapNode.PinPoint.X + 10, bitmapNode.PinPoint.Y + 10);
        bitmapNode.LineStyle.LineColor   = Color.Transparent;
        bitmapNode.EditStyle.AllowSelect = false;
        this.AppendChild(bitmapNode);

        txtNode.PinPoint            = new PointF(bitmapNode.PinPoint.X + 40, bitmapNode.PinPoint.Y - 30);
        txtNode.LineStyle.LineColor = Color.Transparent;
        txtNode.FontStyle.Size      = 9;
        txtNode.FontStyle.Family    = "Arial";

        txtNode.SizeToText(new SizeF(130, 100));
        this.AppendChild(txtNode);
        BackgroundShapeType = BackgroundShape.ellipse;
        SymbolShapeType     = SymbolShape.RightDownTriangle;
    }
Esempio n. 2
0
 public HomeNode()
 {
     homerect = new Syncfusion.Windows.Forms.Diagram.Rectangle(30, 30, 80, 30);
     homerect.FillStyle.Color     = System.Drawing.Color.RoyalBlue;
     homerect.FillStyle.ForeColor = System.Drawing.Color.White;
     this.AppendChild(homerect);
 }
Esempio n. 3
0
 /// <summary>
 /// Initialize the nodes in daigram
 /// </summary>
 private void PopulateFields(DataTable dt)
 {
     for (int i = 0; i < dt.Rows.Count; i++)
     {
         Syncfusion.Windows.Forms.Diagram.Rectangle rect = new Syncfusion.Windows.Forms.Diagram.Rectangle(0, 0, 80, 50);
         rect.FillStyle.Color     = Color.FromArgb(159, 80, 0);
         rect.FillStyle.ForeColor = Color.FromArgb(255, 149, 149);
         rect.FillStyle.Type      = FillStyleType.LinearGradient;
         rect.LineStyle.LineColor = Color.White;
         //rect.EnableShading = true;
         rect.Name = "Node" + dt.Rows[i]["ID"].ToString();
         Syncfusion.Windows.Forms.Diagram.Label label = new Syncfusion.Windows.Forms.Diagram.Label(rect, dt.Rows[i]["Title"].ToString());
         label.FontStyle.Family     = "Verdana";
         label.FontStyle.Size       = 8;
         label.FontColorStyle.Color = Color.White;
         rect.Labels.Add(label);
         diagram1.Model.AppendChild(rect);
         if (!string.IsNullOrEmpty(dt.Rows[i]["ParentID"].ToString()))
         {
             Syncfusion.Windows.Forms.Diagram.Rectangle parentNode = diagram1.Model.Nodes.FindNodeByName("Node" + dt.Rows[i]["ParentID"].ToString()) as Syncfusion.Windows.Forms.Diagram.Rectangle;
             string ss = parentNode.Name;
             ConnectNodes(parentNode, rect);
         }
     }
 }
Esempio n. 4
0
        void dEngineParentChild_NodeAdded(object sender, NodeAddedEventArgs args)
        {
            if (args.SourceName == "MatthewFamily")
            {
                Syncfusion.Windows.Forms.Diagram.Rectangle rectNode = args.NodeObject as Syncfusion.Windows.Forms.Diagram.Rectangle;
                rectNode.Labels[0].FontStyle.Family = "Segoe UI";
                rectNode.Labels[0].FontStyle.Bold   = true;
                rectNode.FillStyle.Color            = Color.White;
                rectNode.FillStyle.Color            = Color.LightSlateGray;
                rectNode.FillStyle.Type             = Syncfusion.Windows.Forms.Diagram.FillStyleType.LinearGradient;
                rectNode.EnableShading = false;

                rectNode.ShadowStyle.Visible = true;
                rectNode.ShadowStyle.OffsetX = 0;
                rectNode.ShadowStyle.OffsetY = 6;
            }
            else if (args.SourceName == "JohnsonFamily")
            {
                Syncfusion.Windows.Forms.Diagram.Rectangle rectNode = args.NodeObject as Syncfusion.Windows.Forms.Diagram.Rectangle;
                rectNode.Labels[0].FontStyle.Family = "Segoe UI";
                rectNode.Labels[0].FontStyle.Bold   = true;
                rectNode.Labels[0].FontStyle.Italic = true;
                rectNode.FillStyle.Color            = Color.Bisque;
                rectNode.EnableShading            = false;
                rectNode.FillStyle.ForeColor      = Color.White;
                rectNode.FillStyle.Type           = Syncfusion.Windows.Forms.Diagram.FillStyleType.LinearGradient;
                rectNode.FillStyle.GradientCenter = 0.5f;
                rectNode.ShadowStyle.Visible      = true;
                rectNode.ShadowStyle.OffsetX      = 0;
                rectNode.ShadowStyle.OffsetY      = 6;
            }
        }
Esempio n. 5
0
        /// <summary>
        /// Initialize the nodes in daigram
        /// </summary>
        private void PopulateNodes()
        {
            Syncfusion.Windows.Forms.Diagram.Rectangle parentRect = GetRectangle();
            diagram1.Model.AppendChild(parentRect);

            for (int i = 0; i < 7; i++)
            {
                Syncfusion.Windows.Forms.Diagram.Rectangle childRect = GetRectangle();
                diagram1.Model.AppendChild(childRect);
                ConnectNodes(parentRect, childRect, Color.Black);
                if (i == 0 || i == 4)
                {
                    for (int j = 0; j < 2; j++)
                    {
                        Syncfusion.Windows.Forms.Diagram.Rectangle childRect4 = GetRectangle();
                        diagram1.Model.AppendChild(childRect4);
                        ConnectNodes(childRect, childRect4, Color.Black);
                        if (j > 0)
                        {
                            for (int k = 0; k < j + 2; k++)
                            {
                                Syncfusion.Windows.Forms.Diagram.Rectangle childRect5 = GetRectangle();
                                diagram1.Model.AppendChild(childRect5);
                                ConnectNodes(childRect4, childRect5, Color.Black);
                            }
                        }
                    }
                }
            }
        }
        /// <summary>
        /// Initialize the nodes in daigram
        /// </summary>
        private void populateNodes()
        {
            //get the root rode
            FlowTask_Backend.Node root = nodes[0];

            //first level of nodes
            Syncfusion.Windows.Forms.Diagram.Rectangle rootRectangle = new Syncfusion.Windows.Forms.Diagram.Rectangle(0, 0, 120, 80);
            rootRectangle.FillStyle.Color     = Color.FromArgb(242, 242, 242);
            rootRectangle.FillStyle.Type      = FillStyleType.LinearGradient;
            rootRectangle.FillStyle.ForeColor = Color.White;

            //give it a label with the node text
            Syncfusion.Windows.Forms.Diagram.Label label = new Syncfusion.Windows.Forms.Diagram.Label(rootRectangle, getNodeText(root));
            label.FontStyle.Family     = "Segoe UI";
            label.FontStyle.Size       = 10;
            label.FontColorStyle.Color = Color.Black;
            rootRectangle.Labels.Add(label);

            sfDecompositionDiagram.Model.AppendChild(rootRectangle);

            //recursively populate children
            foreach (var neighbor in myTask.Decomposition.GetNeighbors(root.NodeIndex))
            {
                generateInnerLevelNodes(rootRectangle, nodes[neighbor.NodeIndex]);
            }
        }
Esempio n. 7
0
 /// <summary>
 /// Adds the Label to the given node
 /// </summary>
 /// <param name="rect1">Node</param>
 /// <param name="Text">Label's text</param>
 private static void AddLabel(Syncfusion.Windows.Forms.Diagram.Rectangle rect1, string Text)
 {
     Syncfusion.Windows.Forms.Diagram.Label label = new Syncfusion.Windows.Forms.Diagram.Label(rect1, Text);
     label.FontStyle.Family = "Segoe UI";
     // label.FontStyle.Size = 8;
     label.FontColorStyle.Color = Color.Black;
     rect1.Labels.Add(label);
 }
Esempio n. 8
0
 /// <summary>
 /// Gets the new rectangle node
 /// </summary>
 /// <returns>returns the node</returns>
 private static Syncfusion.Windows.Forms.Diagram.Rectangle GetRectangle()
 {
     Syncfusion.Windows.Forms.Diagram.Rectangle rect = new Syncfusion.Windows.Forms.Diagram.Rectangle(0, 0, 25, 25);
     rect.FillStyle.Color     = Color.FromArgb(240, 242, 240);
     rect.FillStyle.ForeColor = Color.White;
     rect.FillStyle.Type      = FillStyleType.LinearGradient;
     rect.LineStyle.LineColor = Color.Black;
     return(rect);
 }
Esempio n. 9
0
 /// <summary>
 /// Gets the new rectangle node
 /// </summary>
 /// <returns>returns the node</returns>
 private Syncfusion.Windows.Forms.Diagram.Rectangle GetRectangle()
 {
     Syncfusion.Windows.Forms.Diagram.Rectangle rect = new Syncfusion.Windows.Forms.Diagram.Rectangle(0, 0, 100, 50);
     rect.FillStyle.Color     = Color.FromArgb(242, 242, 242);
     rect.FillStyle.ForeColor = Color.White;
     rect.LineStyle.LineColor = Color.Black;
     rect.FillStyle.Type      = FillStyleType.LinearGradient;
     //rect.EnableShading = true;
     return(rect);
 }
Esempio n. 10
0
 /// <summary>
 /// New function for create a rectangle
 /// </summary>
 /// <returns></returns>
 private Syncfusion.Windows.Forms.Diagram.Rectangle GetRectangle()
 {
     Syncfusion.Windows.Forms.Diagram.Rectangle rect = new Syncfusion.Windows.Forms.Diagram.Rectangle(0, 0, 40, 40);
     rect.FillStyle.Color     = Color.FromArgb(94, 181, 193);
     rect.FillStyle.ForeColor = Color.FromArgb(63, 152, 165);
     rect.FillStyle.Type      = FillStyleType.LinearGradient;
     rect.LineStyle.LineColor = Color.SteelBlue;
     //rect.EnableShading = true;
     return(rect);
 }
Esempio n. 11
0
 /// <summary>
 /// Initialize the nodes in daigram
 /// </summary>
 private void PopulateNodes()
 {
     //first level of nodes
     Syncfusion.Windows.Forms.Diagram.Rectangle rectNode1 = new Syncfusion.Windows.Forms.Diagram.Rectangle(0, 0, 100, 60);
     rectNode1.FillStyle.Color          = Color.FromArgb(242, 242, 242);
     rectNode1.FillStyle.Type           = FillStyleType.LinearGradient;
     rectNode1.FillStyle.ForeColor      = Color.White;
     rectNode1.FillStyle.GradientAngle  = 90;
     rectNode1.FillStyle.GradientCenter = 1;
     this.diagram1.Model.AppendChild(rectNode1);
     GenerateInnerLevelNodes(rectNode1, 5, Color.LightGreen, Color.Brown, 0);
 }
Esempio n. 12
0
        public DataSymbol(ArrayList strColumnName, string strTableName, string primaryKey)
            : base()
        {
            this.Name = strTableName;
            float rectHeight = (strColumnName.Count * 20) + 40;

            Syncfusion.Windows.Forms.Diagram.Rectangle rect = new Syncfusion.Windows.Forms.Diagram.Rectangle(0, 0, 150, rectHeight);
            rect.FillStyle.Color = Color.WhiteSmoke;
            rect.Name            = "BaseNode";
            Syncfusion.Windows.Forms.Diagram.Label lbl = new Syncfusion.Windows.Forms.Diagram.Label(rect, strTableName);
            lbl.FontStyle.Family = "Arial";
            lbl.FontStyle.Size   = 9;
            lbl.FontStyle.Bold   = true;
            lbl.Position         = Position.TopLeft;
            lbl.OffsetX          = 65;
            lbl.OffsetY          = 18;
            lbl.UpdatePosition   = true;
            rect.Labels.Add(lbl);
            this.AppendChild(rect);
            float z = 30;

            for (int i = 0; i < strColumnName.Count; i++)
            {
                TextNode txtNode = new TextNode(strColumnName[i].ToString(), new RectangleF(30, z, 110, 20));
                txtNode.FontStyle.Family      = "Arial";
                txtNode.FontStyle.Size        = 7;
                txtNode.VerticalAlignment     = StringAlignment.Center;
                txtNode.BackgroundStyle.Color = Color.White;
                txtNode.LineStyle.LineColor   = Color.LightGray;

                Syncfusion.Windows.Forms.Diagram.Rectangle symRect = new Syncfusion.Windows.Forms.Diagram.Rectangle(10, z, 20, 20);
                symRect.FillStyle.Color       = Color.WhiteSmoke;
                symRect.FillStyle.Type        = FillStyleType.LinearGradient;
                symRect.LineStyle.LineColor   = Color.LightGray;
                symRect.EditStyle.AllowSelect = false;
                this.AppendChild(txtNode);
                this.AppendChild(symRect);
                if (primaryKey == txtNode.Text)
                {
#if !NETCORE
                    Bitmap bmp = new Bitmap(@"..\..\..\..\..\..\..\Common\Images\Diagram\class diagram\key.png");
#else
                    Bitmap bmp = new Bitmap(@"..\..\..\..\..\..\..\..\Common\Images\Diagram\class diagram\key.png");
#endif
                    BitmapNode bmpNode = new BitmapNode(bmp, new RectangleF(symRect.BoundingRectangle.X + 5, symRect.BoundingRectangle.Y + 5, symRect.BoundingRectangle.Width - 10, symRect.BoundingRectangle.Height - 10));
                    bmpNode.LineStyle.LineColor   = Color.Transparent;
                    bmpNode.EditStyle.AllowSelect = false;
                    this.AppendChild(bmpNode);
                }

                z = z + 20;
            }
        }
Esempio n. 13
0
 public SymbolDoubleRect()
 {
     Syncfusion.Windows.Forms.Diagram.Rectangle rects;
     rects = new Syncfusion.Windows.Forms.Diagram.Rectangle(15, 0, 10, 10);
     rects.FillStyle.Color     = Color.Yellow;
     rects.LineStyle.LineColor = Color.Black;
     this.AppendChild(rects);
     Syncfusion.Windows.Forms.Diagram.Rectangle rects1;
     rects1 = new Syncfusion.Windows.Forms.Diagram.Rectangle(5, 5, 10, 10);
     rects1.FillStyle.Color     = Color.Yellow;
     rects1.LineStyle.LineColor = Color.Black;
     this.AppendChild(rects1);
     this.EditStyle.AllowSelect = false;
 }
Esempio n. 14
0
        private void Form1_Load(object sender, EventArgs e)
        {
            Syncfusion.Windows.Forms.Diagram.Rectangle rect  = new Syncfusion.Windows.Forms.Diagram.Rectangle(10, 10, 100, 50);
            Syncfusion.Windows.Forms.Diagram.Label     label = new Syncfusion.Windows.Forms.Diagram.Label();
            label.FontColorStyle.Color = Color.White;
            label.FontStyle.Family     = "Segoe UI";
            rect.Labels.Add(label);
            rect.FillStyle.Color = System.Drawing.Color.FromArgb(116, 160, 47);
            DataTable table = diagram1.GetDataSourceFromXML(@"..\..\..\..\..\..\..\Common\Data\Diagram\xml\XML Binding1.xml");

            this.diagram1.Binding.DefaultNode = rect;
            this.diagram1.Binding.Label.Add("Name");
            this.diagram1.Binding.ParentId   = "ManagerID";
            this.diagram1.Binding.Id         = "EmployeeID";
            this.diagram1.Binding.DataSource = table;
        }
Esempio n. 15
0
        /// <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;
            }
        }
Esempio n. 16
0
        /// <summary>
        /// Initialize the nodes in daigram
        /// </summary>
        private void PopulateNodes()
        {
            Syncfusion.Windows.Forms.Diagram.Rectangle rect = GetRectangle();
            diagram1.Model.AppendChild(rect);
            for (int i = 0; i < 3; i++)
            {
                Syncfusion.Windows.Forms.Diagram.Rectangle rect1 = GetRectangle();
                AddLabel(rect1, "Header Label");
                diagram1.Model.AppendChild(rect1);
            }
            Syncfusion.Windows.Forms.Diagram.Rectangle rect2 = GetRectangle();
            diagram1.Model.AppendChild(rect2);
            int nodeNumber = 1;

            for (int i = 1; i <= 20; i++)
            {
                if (i == 1)
                {
                    Syncfusion.Windows.Forms.Diagram.Rectangle rect1 = GetRectangle();
                    AddLabel(rect1, "Add");
                    diagram1.Model.AppendChild(rect1);
                }
                else if ((i - 1) % 5 == 0)
                {
                    Syncfusion.Windows.Forms.Diagram.Rectangle rect1 = GetRectangle();
                    AddLabel(rect1, nodeNumber.ToString());
                    diagram1.Model.AppendChild(rect1);
                    nodeNumber += 1;
                }

                else if (i % 5 == 0)
                {
                    Syncfusion.Windows.Forms.Diagram.Rectangle rect1 = GetRectangle();
                    AddLabel(rect1, "Action");
                    diagram1.Model.AppendChild(rect1);
                }

                else
                {
                    Syncfusion.Windows.Forms.Diagram.Rectangle rect1 = GetRectangle();
                    AddLabel(rect1, "Component");
                    diagram1.Model.AppendChild(rect1);
                }
            }
        }
Esempio n. 17
0
        public MySymbol()
        {
            //
            // Add child nodes to the symbol programmatically
            //

            // Add an outer rectangle
            this.outerRect = new Syncfusion.Windows.Forms.Diagram.Rectangle(0, 0, 120, 80);
            this.outerRect.FillStyle.Color = Color.Khaki;
            this.AppendChild(outerRect);

            // Add an inner ellipse
            this.innerEllipse = new Ellipse(10, 10, 100, 60);
            this.innerEllipse.FillStyle.Color = ellipseColors[this.curEllipseColor];
            this.AppendChild(innerEllipse);

            this.AddLabel("Hello world", BoxPosition.Center);
        }
Esempio n. 18
0
 void dEngineSelfRelation_NodeAdded(object sender, NodeAddedEventArgs args)
 {
     if (args.NodeObject is Syncfusion.Windows.Forms.Diagram.Rectangle)
     {
         Syncfusion.Windows.Forms.Diagram.Rectangle rect = args.NodeObject as Syncfusion.Windows.Forms.Diagram.Rectangle;
         rect.FillStyle.Color                = Color.FromArgb(242, 242, 242);
         rect.FillStyle.ForeColor            = Color.White;
         rect.LineStyle.LineColor            = Color.Black;
         rect.FillStyle.Type                 = FillStyleType.LinearGradient;
         rect.FillStyle.GradientAngle        = 90;
         rect.FillStyle.GradientCenter       = 1;
         rect.EnableShading                  = false;
         rect.LineStyle.DashCap              = System.Drawing.Drawing2D.DashCap.Round;
         rect.Labels[0].FontStyle.Bold       = true;
         rect.Labels[0].FontStyle.Family     = "Segoe UI";
         rect.Labels[0].FontColorStyle.Color = Color.Black;
     }
 }
Esempio n. 19
0
    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;
    }
Esempio n. 20
0
 /// <summary>
 /// Generates the inner level nodes
 /// </summary>
 /// <param name="parentNode">Parent Node</param>
 /// <param name="maxSubNodes">Maximum sub nodes</param>
 /// <param name="LevelColor">Node's Fill color</param>
 /// <param name="connectionColor">Node's fore color</param>
 /// <param name="n">nodes level count</param>
 private void GenerateInnerLevelNodes(Node parentNode, int maxSubNodes, Color LevelColor, Color connectionColor, int n)
 {
     if (n == 4)
     {
         return;
     }
     for (int i = 0; i < maxSubNodes; i++)
     {
         Syncfusion.Windows.Forms.Diagram.Rectangle e = new Syncfusion.Windows.Forms.Diagram.Rectangle(0, 0, 90, 50);
         e.FillStyle.Color          = Color.FromArgb(242, 242, 242);
         e.FillStyle.Type           = FillStyleType.LinearGradient;
         e.FillStyle.ForeColor      = Color.White;
         e.FillStyle.GradientAngle  = 90;
         e.FillStyle.GradientCenter = 1;
         this.diagram1.Model.AppendChild(e);
         ConnectNodes(parentNode, e, connectionColor);
         GenerateInnerLevelNodes(e, i, Color.Plum, Color.Purple, n++);
     }
 }
Esempio n. 21
0
        /// <summary>
        /// Iterative sub-employee symbol node creation
        /// </summary>
        /// <param name="emply">List Employees in the XML file</param>
        protected void IterCreateEmployeeSymbol(List <XMLBindinglist> emply)
        {
            foreach (XMLBindinglist subemply in emply)
            {
                Syncfusion.Windows.Forms.Diagram.Rectangle rect = new Syncfusion.Windows.Forms.Diagram.Rectangle(200, 0, 150, 60);
                rect.Name                = subemply.EmployeeID;
                rect.FillStyle.Color     = System.Drawing.Color.FromArgb(240, 242, 240);
                rect.FillStyle.ForeColor = System.Drawing.Color.White;
                rect.FillStyle.Type      = FillStyleType.LinearGradient;
                rect.LineStyle.LineColor = System.Drawing.Color.Black;
                this.diagram1.Model.AppendChild(rect);
                Syncfusion.Windows.Forms.Diagram.Label label = new Syncfusion.Windows.Forms.Diagram.Label();
                label.Container        = rect;
                label.Text             = subemply.EmployeeName;
                label.Position         = Position.Center;
                label.FontStyle.Family = "Segoe UI";
                label.FontStyle.Size   = 8;
                rect.Labels.Add(label);

                if (!string.IsNullOrEmpty(subemply.ManagerID))
                {
                    //OrthogonalConnector conn = new OrthogonalConnector(PointF.Empty, new PointF(0, 1));
                    OrgLineConnector conn = new OrgLineConnector(System.Drawing.PointF.Empty, new System.Drawing.PointF(0, 1), MeasureUnits.Pixel);
                    conn.LineStyle.LineColor = System.Drawing.Color.Black;
                    Decorator decor = conn.HeadDecorator;
                    decor.DecoratorShape      = DecoratorShape.Filled45Arrow;
                    decor.Size                = new System.Drawing.SizeF(10, 10);
                    decor.FillStyle.Color     = System.Drawing.Color.Black;
                    decor.LineStyle.LineColor = System.Drawing.Color.Black;
                    conn.VerticalDistance     = 50;
                    Syncfusion.Windows.Forms.Diagram.Rectangle rect1 = diagram1.Model.Nodes.FindNodeByName(subemply.ManagerID) as Syncfusion.Windows.Forms.Diagram.Rectangle;

                    rect1.CentralPort.TryConnect(conn.TailEndPoint);
                    rect.CentralPort.TryConnect(conn.HeadEndPoint);
                    this.diagram1.Model.AppendChild(conn);
                    // this.diagram1.Model.BringToFront(rect1);
                }
                //orgLayoutMgr.Nodes.Clear();
                //orgLayoutMgr.Nodes.AddRange(this.diagram1.Model.Nodes);
                //orgLayoutMgr.UpdateLayout(null);
            }
        }
    public ContentWithOuterRectangle(string content, string tip, Color BackColor, Color tipBackColor)
    {
        Syncfusion.Windows.Forms.Diagram.Rectangle ContentEmpty = new Syncfusion.Windows.Forms.Diagram.Rectangle(0, 0, 200, 10, units);
        ContentEmpty.FillStyle.Color     = Color.Transparent;
        ContentEmpty.LineStyle.LineWidth = 0;
        RectangleF rect = new RectangleF(0, 15, 200, 45);

        TextNode nodeRectHeader = new TextNode(content, rect);

        nodeRectHeader.EnableCentralPort     = false;
        nodeRectHeader.BackgroundStyle.Color = BackColor;
        nodeRectHeader.BackgroundStyle.Color = Color.White;
        nodeRectHeader.LineStyle.LineWidth   = 1;
        nodeRectHeader.FontStyle.Size        = 10;
        nodeRectHeader.ReadOnly            = true;
        nodeRectHeader.HorizontalAlignment = StringAlignment.Near;
        nodeRectHeader.VerticalAlignment   = StringAlignment.Near;

        Syncfusion.Windows.Forms.Diagram.RoundRect roundrect = new Syncfusion.Windows.Forms.Diagram.RoundRect(ContentEmpty.Size.Width - 20, 0, 40, 15, units);
        roundrect.EnableCentralPort = false;
        // Add an outer RoundRectangle.
        roundrect.FillStyle.ForeColor = System.Drawing.Color.SkyBlue;
        roundrect.LineStyle.LineColor = Color.FromArgb(253, 188, 140);
        roundrect.FillStyle.Color     = tipBackColor;
        roundrect.EnableShading       = false;

        Syncfusion.Windows.Forms.Diagram.Label lblr = new Syncfusion.Windows.Forms.Diagram.Label();
        lblr.Text           = tip;
        lblr.SizeToNode     = true;
        lblr.Position       = Position.Center;
        lblr.FontStyle.Size = 14;
        lblr.FontStyle.Bold = true;
        roundrect.Labels.Add(lblr);
        this.EnableCentralPort         = true;
        ContentEmpty.EnableCentralPort = true;
        roundrect.EnableCentralPort    = true;
        this.AppendChild(ContentEmpty);
        this.AppendChild(nodeRectHeader);
        this.AppendChild(roundrect);
        this.EditStyle.AllowSelect = false;
    }
Esempio n. 23
0
        /// <summary>
        /// Populate a nodes
        /// </summary>
        private void PopulateNodes()
        {
            //first level of nodes
            Syncfusion.Windows.Forms.Diagram.Rectangle parentNode = GetRectangle();
            this.diagram1.Model.AppendChild(parentNode);

            for (int i = 1; i <= 5; i++)
            {
                // Create a new instance of rectangle for childnode
                Syncfusion.Windows.Forms.Diagram.Rectangle rect = GetRectangle();
                this.diagram1.Model.AppendChild(rect);
                ConnectNodes(parentNode, rect, Color.SteelBlue);
                for (int j = 1; j <= 2; j++)
                {
                    //Create a new instance of rectangle for childnode1
                    Syncfusion.Windows.Forms.Diagram.Rectangle rect1 = GetRectangle();
                    this.diagram1.Model.AppendChild(rect1);
                    ConnectNodes(rect, rect1, Color.SteelBlue);

                    for (int k = 1; k <= 3; k++)
                    {
                        //Create a new instance of rectangle for childnode2
                        Syncfusion.Windows.Forms.Diagram.Rectangle rect2 = GetRectangle();
                        this.diagram1.Model.AppendChild(rect2);
                        ConnectNodes(rect1, rect2, Color.SteelBlue);

                        if (k == 2)
                        {
                            for (int l = 1; l <= 2; l++)
                            {
                                //Create a new instance of rectangle for childnode3
                                Syncfusion.Windows.Forms.Diagram.Rectangle rect3 = GetRectangle();
                                this.diagram1.Model.AppendChild(rect3);
                                ConnectNodes(rect2, rect3, Color.SteelBlue);
                            }
                        }
                    }
                }
            }
        }
        /// <summary>
        /// Generates the inner level nodes
        /// </summary>
        /// <param name="parentRect">Parent Node</param>
        /// <param name="maxSubNodes">Maximum sub nodes</param>
        /// <param name="LevelColor">Node's Fill color</param>
        /// <param name="connectionColor">Node's fore color</param>
        /// <param name="n">nodes level count</param>
        private void generateInnerLevelNodes(Syncfusion.Windows.Forms.Diagram.Node parentRect, NodeDecorator curNode)
        {
            Syncfusion.Windows.Forms.Diagram.Rectangle childRect = new Syncfusion.Windows.Forms.Diagram.Rectangle(0, 0, 120, 80);
            childRect.FillStyle.Color     = Color.FromArgb(242, 242, 242);
            childRect.FillStyle.Type      = FillStyleType.LinearGradient;
            childRect.FillStyle.ForeColor = curNode.DrawColor;
            sfDecompositionDiagram.Model.AppendChild(childRect);

            Syncfusion.Windows.Forms.Diagram.Label label = new Syncfusion.Windows.Forms.Diagram.Label(childRect, getNodeText(curNode));
            label.FontStyle.Family     = "Segoe UI";
            label.FontStyle.Size       = 10;
            label.FontColorStyle.Color = Color.Black;
            childRect.Labels.Add(label);

            connectNodes(parentRect, childRect);

            //recursively populate children
            foreach (var neighbor in myTask.Decomposition.GetNeighbors(curNode.NodeIndex))
            {
                generateInnerLevelNodes(childRect, nodes[neighbor.NodeIndex]);
            }
        }
Esempio n. 25
0
    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;
    }
Esempio n. 26
0
        private void Form1_Load(object sender, EventArgs e)
        {
            diagram1.Model.RenderingStyle.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality;
            Syncfusion.Windows.Forms.Diagram.Rectangle rect = new Syncfusion.Windows.Forms.Diagram.Rectangle(100, 50, 100, 75);
            rect.FillStyle.Color     = Color.FromArgb(242, 242, 242);
            rect.FillStyle.ForeColor = Color.White;
            rect.FillStyle.Type      = FillStyleType.LinearGradient;
            rect.LineStyle.LineWidth = 1;
            AddLabel(rect);

            Syncfusion.Windows.Forms.Diagram.RoundRect roundRect = new Syncfusion.Windows.Forms.Diagram.RoundRect(220, 0, 100, 75, MeasureUnits.Pixel);
            roundRect.FillStyle.Color     = Color.FromArgb(242, 242, 242);
            roundRect.FillStyle.ForeColor = Color.White;
            roundRect.FillStyle.Type      = FillStyleType.LinearGradient;
            roundRect.LineStyle.LineWidth = 1;
            AddLabel(roundRect);

            Ellipse ellipse1 = new Ellipse(100, 200, 100, 80);

            ellipse1.Name                = "Start/Stop";
            ellipse1.FillStyle.Color     = Color.FromArgb(242, 242, 242);
            ellipse1.FillStyle.ForeColor = Color.White;
            ellipse1.FillStyle.Type      = FillStyleType.LinearGradient;
            ellipse1.LineStyle.LineWidth = 1;
            AddLabel(ellipse1);
            diagram1.Model.AppendChild(ellipse1);

            Polygon poly = new Polygon(new PointF[] { new PointF(15, 0), new PointF(0, 45), new PointF(15, 90), new PointF(60, 90), new PointF(75, 45), new PointF(60, 0) });

            poly                     = new Polygon(new PointF[] { new PointF(45, 0), new PointF(0, 45), new PointF(45, 90), new PointF(90, 45) });
            poly.Name                = "Decision";
            poly.PinPoint            = new PointF(350, 230);
            poly.FillStyle.Color     = Color.FromArgb(242, 242, 242);
            poly.FillStyle.ForeColor = Color.White;
            poly.FillStyle.Type      = FillStyleType.LinearGradient;
            poly.LineStyle.LineWidth = 1;
            AddLabel(poly);
            diagram1.Model.AppendChild(poly);

            Syncfusion.Windows.Forms.Diagram.Rectangle rect1 = new Syncfusion.Windows.Forms.Diagram.Rectangle(100, 350, 100, 75);
            rect1.Name                = "Process";
            rect1.FillStyle.Color     = Color.FromArgb(242, 242, 242);
            rect1.FillStyle.ForeColor = Color.White;
            rect1.FillStyle.Type      = FillStyleType.LinearGradient;
            rect1.LineStyle.LineWidth = 1;
            AddLabel(rect1);
            diagram1.Model.AppendChild(rect1);

            Group group = new Group();

            group.AppendChild(rect);
            group.AppendChild(roundRect);
            diagram1.Model.AppendChild(group);
            Syncfusion.Windows.Forms.Diagram.Label label = new Syncfusion.Windows.Forms.Diagram.Label();
            label.Container        = group;
            label.Text             = "Group1";
            label.FontStyle.Family = "Segoe UI";
            label.FontStyle.Size   = 9;
            group.Labels.Add(label);
            diagram1.View.BackgroundColor = Color.White;
            diagram1.View.SelectionList.Clear();
            this.diagram1.MouseDown += new MouseEventHandler(diagram1_MouseDown);
            this.diagram1.MouseUp   += new MouseEventHandler(diagram1_MouseUp);

            // Wire up OnIdle processing
            Application.Idle += new EventHandler(Application_Idle);
        }
Esempio n. 27
0
        private void InitializeDiagram(SymbolPalette palette)
        {
            float x = 150;
            float y = 150;
            int   rowNodeCnt = 1, j = 0;

            string[] strRow = new string[] { "A", "B", "C", "D", "E", "F", "G", "H", "I", "J" };

            TextNode txtNode = new TextNode("View and Change Seats", new RectangleF(250, 20, 400, 70));

            txtNode.FontColorStyle.Color  = Color.White;
            txtNode.FontStyle.Family      = "Arial";
            txtNode.FontStyle.Size        = 17;
            txtNode.HorizontalAlignment   = StringAlignment.Center;
            txtNode.FontStyle.Bold        = true;
            txtNode.LineStyle.LineColor   = Color.Transparent;
            txtNode.EditStyle.AllowSelect = false;
            diagram1.Model.AppendChild(txtNode);

            Group availSeats = new Group(palette.Nodes["Seat"] as Group);

            availSeats.Name                 = "availSeats";
            availSeats.PinPoint             = new PointF(250, 80);
            availSeats.Size                 = new SizeF(20, 20);
            availSeats.EditStyle.AllowMoveX = false;
            availSeats.EditStyle.AllowMoveY = false;
            UpdateEditStyle(availSeats);
            diagram1.Model.AppendChild(availSeats);
            TextNode availTNode = new TextNode("Available Seats", new RectangleF(265, 70, 90, 20));

            availTNode.FontStyle.Family      = "Arial";
            availTNode.FontColorStyle.Color  = Color.White;
            availTNode.FontStyle.Size        = 8;
            availTNode.VerticalAlignment     = StringAlignment.Center;
            availTNode.LineStyle.LineColor   = Color.Transparent;
            availTNode.EditStyle.AllowSelect = false;
            diagram1.Model.AppendChild(availTNode);

            Group bookedSeats = new Group(palette.Nodes["Seat"] as Group);

            bookedSeats.Name                 = "bookedSeats";
            bookedSeats.PinPoint             = new PointF(380, 80);
            bookedSeats.Size                 = new SizeF(20, 20);
            bookedSeats.EditStyle.AllowMoveX = false;
            bookedSeats.EditStyle.AllowMoveY = false;
            UpdateEditStyle(bookedSeats);
            foreach (Node node in bookedSeats.Nodes)
            {
                if (node is FilledPath)
                {
                    ((FilledPath)node).FillStyle.Color     = Color.FromArgb(134, 134, 134);
                    ((FilledPath)node).FillStyle.ForeColor = Color.FromArgb(163, 163, 163);
                    node.LineStyle.LineColor = Color.DarkGray;
                }
            }
            diagram1.Model.AppendChild(bookedSeats);
            TextNode bookedTNode = new TextNode("Booked Seats", new RectangleF(395, 70, 90, 20));

            bookedTNode.FontStyle.Family      = "Arial";
            bookedTNode.FontColorStyle.Color  = Color.White;
            bookedTNode.FontStyle.Size        = 8;
            bookedTNode.VerticalAlignment     = StringAlignment.Center;
            bookedTNode.LineStyle.LineColor   = Color.Transparent;
            bookedTNode.EditStyle.AllowSelect = false;
            diagram1.Model.AppendChild(bookedTNode);

            Group curSelSeats = new Group(palette.Nodes["Seat"] as Group);

            curSelSeats.PinPoint             = new PointF(500, 80);
            curSelSeats.Size                 = new SizeF(20, 20);
            curSelSeats.EditStyle.AllowMoveX = false;
            curSelSeats.EditStyle.AllowMoveY = false;
            UpdateEditStyle(curSelSeats);
            foreach (Node node in curSelSeats.Nodes)
            {
                if (node is FilledPath)
                {
                    ((FilledPath)node).FillStyle.Color     = Color.FromArgb(0, 155, 0);
                    ((FilledPath)node).FillStyle.ForeColor = Color.FromArgb(80, 255, 89);
                    node.LineStyle.LineColor = Color.Black;
                }
            }
            diagram1.Model.AppendChild(curSelSeats);
            TextNode CurSelTNode = new TextNode("Current Selection", new RectangleF(515, 70, 90, 20));

            CurSelTNode.FontStyle.Family      = "Arial";
            CurSelTNode.FontColorStyle.Color  = Color.White;
            CurSelTNode.FontStyle.Size        = 8;
            CurSelTNode.VerticalAlignment     = StringAlignment.Center;
            CurSelTNode.LineStyle.LineColor   = Color.Transparent;
            CurSelTNode.EditStyle.AllowSelect = false;
            diagram1.Model.AppendChild(CurSelTNode);

            for (int i = 1; i < 106; i++)
            {
                Group seatNode = new Group(palette.Nodes["Seat"] as Group);
                Syncfusion.Windows.Forms.Diagram.Label lbl = new Syncfusion.Windows.Forms.Diagram.Label(seatNode, i.ToString());
                lbl.FontStyle.Family     = "Arial";
                lbl.FontColorStyle.Color = Color.White;
                seatNode.Labels.Add(lbl);
                seatNode.Size                 = new SizeF(30, 30);
                seatNode.PinPoint             = new PointF(x, y);
                seatNode.EditStyle.AllowMoveX = false;
                seatNode.EditStyle.AllowMoveY = false;
                UpdateEditStyle(seatNode);
                seatNode.EditStyle.DefaultHandleEditMode = HandleEditMode.None;
                diagram1.Model.AppendChild(seatNode);
                seats.Add(seatNode);

                if (rowNodeCnt == 10)
                {
                    x = x + 80;
                }
                else
                {
                    x = x + 40;
                }

                if (rowNodeCnt == 15)
                {
                    Syncfusion.Windows.Forms.Diagram.Rectangle rowNode = new Syncfusion.Windows.Forms.Diagram.Rectangle(100, y - 10, 20, 20);
                    rowNode.FillStyle.Color       = Color.Goldenrod;
                    rowNode.FillStyle.ForeColor   = Color.Yellow;
                    rowNode.FillStyle.Type        = FillStyleType.LinearGradient;
                    rowNode.LineStyle.LineColor   = Color.Goldenrod;
                    rowNode.EditStyle.AllowSelect = false;
                    Syncfusion.Windows.Forms.Diagram.Label lbl1 = new Syncfusion.Windows.Forms.Diagram.Label(rowNode, strRow[j]);
                    lbl1.FontStyle.Family     = "Arial";
                    lbl1.FontColorStyle.Color = Color.Black;
                    rowNode.Labels.Add(lbl1);
                    diagram1.Model.AppendChild(rowNode);
                    x          = 150;
                    y          = y + 40;
                    rowNodeCnt = 0;
                    j++;
                }
                rowNodeCnt++;
            }
            Syncfusion.Windows.Forms.Diagram.Rectangle rect = new Syncfusion.Windows.Forms.Diagram.Rectangle(150, y + 40, 600, 50);
            rect.FillStyle.Color     = Color.WhiteSmoke;
            rect.LineStyle.LineColor = Color.LightGray;
            Syncfusion.Windows.Forms.Diagram.Label label = new Syncfusion.Windows.Forms.Diagram.Label(rect, "Screen this way");
            label.FontStyle.Bold   = true;
            label.FontStyle.Size   = 16;
            label.FontStyle.Family = "Segoe UI";
            rect.Labels.Add(label);
            diagram1.Model.AppendChild(rect);
            diagram1.BeginUpdate();
            ReserveSeats();
            diagram1.EndUpdate();
        }
Esempio n. 28
0
        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();
        }
Esempio n. 29
0
    public GridGroup()
    {
        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;
        //Row1
        RectangleF rect;

        rect = new RectangleF(0, 0, 70, 20);
        TextNode r1c1 = new TextNode("Rev #", rect);

        r1c1.BackgroundStyle.Color = Color.Gray;
        r1c1.FontColorStyle.Color  = Color.White;
        r1c1.LineStyle.LineWidth   = 1;
        r1c1.FontStyle.Size        = 11;
        r1c1.ReadOnly            = true;
        r1c1.HorizontalAlignment = StringAlignment.Center;

        rect = new RectangleF(70, 0, 120, 20);
        TextNode r1c2 = new TextNode("Revison Date", rect);

        r1c2.BackgroundStyle.Color = Color.Gray;
        r1c2.FontColorStyle.Color  = Color.White;
        r1c2.LineStyle.LineWidth   = 1;
        r1c2.FontStyle.Size        = 11;
        r1c2.ReadOnly            = true;
        r1c2.HorizontalAlignment = StringAlignment.Center;
        rect = new RectangleF(190, 0, 150, 20);
        TextNode r1c3 = new TextNode("Reason", rect);

        r1c3.BackgroundStyle.Color = Color.Gray;
        r1c3.FontColorStyle.Color  = Color.White;
        r1c3.LineStyle.LineWidth   = 1;
        r1c3.FontStyle.Size        = 11;
        r1c3.ReadOnly            = true;
        r1c3.HorizontalAlignment = StringAlignment.Center;
        rect = new RectangleF(340, 0, 100, 20);
        TextNode r1c4 = new TextNode("Who", rect);

        r1c4.BackgroundStyle.Color = Color.Gray;
        r1c4.FontColorStyle.Color  = Color.White;
        r1c4.LineStyle.LineWidth   = 1;
        r1c4.FontStyle.Size        = 11;
        r1c4.ReadOnly            = true;
        r1c4.HorizontalAlignment = StringAlignment.Center;
        //Row2
        rect = new RectangleF(0, 20, 70, 20);
        TextNode r2c1 = new TextNode("", rect);

        r2c1.BackgroundStyle.Color = Color.White;
        r2c1.LineStyle.LineWidth   = 1;
        r2c1.FontStyle.Size        = 11;


        rect = new RectangleF(70, 20, 120, 20);
        TextNode r2c2 = new TextNode("", rect);

        r2c2.BackgroundStyle.Color = Color.White;
        r2c2.LineStyle.LineWidth   = 1;
        r2c2.FontStyle.Size        = 11;


        rect = new RectangleF(190, 20, 150, 20);
        TextNode r2c3 = new TextNode("", rect);

        r2c3.BackgroundStyle.Color = Color.White;
        r2c3.LineStyle.LineWidth   = 1;
        r2c3.FontStyle.Size        = 11;


        rect = new RectangleF(340, 20, 100, 20);
        TextNode r2c4 = new TextNode("", rect);

        r2c4.BackgroundStyle.Color = Color.White;
        r2c4.LineStyle.LineWidth   = 1;
        r2c4.FontStyle.Size        = 11;

        //Row3
        rect = new RectangleF(0, 40, 70, 20);
        TextNode r3c1 = new TextNode("", rect);

        r3c1.BackgroundStyle.Color = Color.White;
        r3c1.LineStyle.LineWidth   = 1;
        r3c1.FontStyle.Size        = 11;


        rect = new RectangleF(70, 40, 120, 20);
        TextNode r3c2 = new TextNode("", rect);

        r3c2.BackgroundStyle.Color = Color.White;
        r3c2.LineStyle.LineWidth   = 1;
        r3c2.FontStyle.Size        = 11;


        rect = new RectangleF(190, 40, 150, 20);
        TextNode r3c3 = new TextNode("", rect);

        r3c3.BackgroundStyle.Color = Color.White;
        r3c3.LineStyle.LineWidth   = 1;
        r3c3.FontStyle.Size        = 11;


        rect = new RectangleF(340, 40, 100, 20);
        TextNode r3c4 = new TextNode("", rect);

        r3c4.BackgroundStyle.Color = Color.White;
        r3c4.LineStyle.LineWidth   = 1;
        r3c4.FontStyle.Size        = 11;

        //Row4
        rect = new RectangleF(0, 60, 70, 20);
        TextNode r4c1 = new TextNode("", rect);

        r4c1.BackgroundStyle.Color = Color.White;
        r4c1.LineStyle.LineWidth   = 1;
        r4c1.FontStyle.Size        = 11;


        rect = new RectangleF(70, 60, 120, 20);
        TextNode r4c2 = new TextNode("", rect);

        r4c2.BackgroundStyle.Color = Color.White;
        r4c2.LineStyle.LineWidth   = 1;
        r4c2.FontStyle.Size        = 11;


        rect = new RectangleF(190, 60, 150, 20);
        TextNode r4c3 = new TextNode("", rect);

        r4c3.BackgroundStyle.Color = Color.White;
        r4c3.LineStyle.LineWidth   = 1;
        r4c3.FontStyle.Size        = 11;


        rect = new RectangleF(340, 60, 100, 20);
        TextNode r4c4 = new TextNode("", rect);

        r4c4.BackgroundStyle.Color = Color.White;
        r4c4.LineStyle.LineWidth   = 1;
        r4c4.FontStyle.Size        = 11;

        this.AppendChild(r1c1); this.AppendChild(r1c2); this.AppendChild(r1c3); this.AppendChild(r1c4);
        this.AppendChild(r2c1); this.AppendChild(r2c2); this.AppendChild(r2c3); this.AppendChild(r2c4);
        this.AppendChild(r3c1); this.AppendChild(r3c2); this.AppendChild(r3c3); this.AppendChild(r3c4);
        this.AppendChild(r4c1); this.AppendChild(r4c2); this.AppendChild(r4c3); this.AppendChild(r4c4);
        this.EditStyle.AllowSelect = false;
    }
Esempio n. 30
0
        private void Form1_Load(object sender, EventArgs e)
        {
            Syncfusion.Windows.Forms.Diagram.Rectangle rect = new Syncfusion.Windows.Forms.Diagram.Rectangle(100, 100, 100, 70);
            rect.FillStyle.Color     = Color.Maroon;
            rect.FillStyle.ForeColor = Color.Red;
            rect.FillStyle.Type      = FillStyleType.LinearGradient;
            rect.LineStyle.LineWidth = 0;
            Syncfusion.Windows.Forms.Diagram.Label lbl = new Syncfusion.Windows.Forms.Diagram.Label(rect, "Top Left");
            lbl.FontColorStyle.Color = Color.White;
            lbl.Position             = Position.TopLeft;
            lbl.UpdatePosition       = true;
            rect.Labels.Add(lbl);
            diagram1.Model.AppendChild(rect);

            Syncfusion.Windows.Forms.Diagram.Rectangle rect1 = new Syncfusion.Windows.Forms.Diagram.Rectangle(350, 250, 100, 70);
            rect1.FillStyle.Color     = Color.Maroon;
            rect1.FillStyle.ForeColor = Color.Red;
            rect1.FillStyle.Type      = FillStyleType.LinearGradient;
            rect1.LineStyle.LineWidth = 0;
            Syncfusion.Windows.Forms.Diagram.Label lbl1 = new Syncfusion.Windows.Forms.Diagram.Label(rect1, "MiddleRight");
            lbl1.FontColorStyle.Color = Color.White;
            lbl1.Position             = Position.MiddleRight;
            lbl1.UpdatePosition       = true;
            rect1.Labels.Add(lbl1);
            diagram1.Model.AppendChild(rect1);

            OrthogonalConnector ocon = new OrthogonalConnector(new PointF(100, 100), new PointF(200, 100), false);

            ocon.HeadDecorator.DecoratorShape  = DecoratorShape.Filled45Arrow;
            ocon.HeadDecorator.FillStyle.Color = Color.Black;
            rect.CentralPort.Connect(ocon.TailEndPoint);
            rect1.CentralPort.Connect(ocon.HeadEndPoint);
            diagram1.Model.AppendChild(ocon);
            Syncfusion.Windows.Forms.Diagram.Label conLbl = new Syncfusion.Windows.Forms.Diagram.Label(ocon, "BottomCenter");
            conLbl.UpdatePosition = true;
            conLbl.Position       = Position.BottomCenter;
            conLbl.OffsetX        = 100;
            conLbl.OffsetY        = ocon.BoundingRectangle.Height;
            conLbl.BackgroundStyle.ColorAlphaFactor = 255;
            ocon.Labels.Add(conLbl);


            OrthogonalConnector ocon1 = new OrthogonalConnector(PointF.Empty, new PointF(0, 1), true);

            ocon1.HeadDecorator.DecoratorShape  = DecoratorShape.Filled45Arrow;
            ocon1.HeadDecorator.FillStyle.Color = Color.Black;
            rect.CentralPort.Connect(ocon1.TailEndPoint);
            rect1.CentralPort.Connect(ocon1.HeadEndPoint);
            diagram1.Model.AppendChild(ocon1);
            Syncfusion.Windows.Forms.Diagram.Label conLbl1 = new Syncfusion.Windows.Forms.Diagram.Label(ocon1, "Top Center");
            conLbl1.UpdatePosition = true;
            conLbl1.Position       = Position.TopCenter;
            conLbl1.OffsetX        = 80;
            conLbl1.OffsetY        = 0;
            conLbl1.BackgroundStyle.ColorAlphaFactor = 255;
            ocon1.Labels.Add(conLbl1);

            propertyGrid1.SelectedObject  = ((PathNode)diagram1.View.SelectionList[0]).Labels[0];
            diagram1.View.BackgroundColor = Color.White;
            diagram1.View.SelectionList.Clear();
            diagram1.EventSink.NodeSelected += new NodeSelectedEventHandler(EventSink_NodeSelected);
        }