Esempio n. 1
0
        public Node(int id, string label, Point location, Size size, Board board, Color bcolor, Color fcolor, mPath path, float size2, string font, int textsise, string shape, Node parent) : base()
        {
            SetStyle(ControlStyles.StandardClick | ControlStyles.StandardDoubleClick, true);

            this.id = id;
            if (parent is null)
            {
                this.parent = this;
            }
            else
            {
                this.parent = parent;
            }
            this.Location          = location;
            this.curLocation       = location;
            this.curParentLocation = this.parent.Location;
            this.Size      = size;
            this.board     = board;
            this.BackColor = bcolor;

            this.ForeColor = fcolor;
            this.path      = path;
            this.Font      = new Font(font, textsise);
            this.Text      = label;
            this.FlatStyle = FlatStyle.Flat;
            this.shape     = shape;
            this.size      = size2;

            this.LocationChanged        += Node_LocationChanged;
            this.parent.LocationChanged += Parent_LocationChanged;
            this.parent.Disposed        += Parent_Disposed;
            this.DoubleClick            += Node_DoubleClick;
            this.SizeChanged            += Node_SizeChanged;
            cShape();

            drawPath(this.Location, this.parent.Location, Color.Black, this.path.size);
            ControlExtension.Draggable(this, true);
        }
Esempio n. 2
0
        public void updateFormatTable(string shape, Color colorNode, float sizeNode, string font, int textsize, Color colorText, mPath path)
        {
            this.shapeNode = shape;
            this.colorNode = colorNode;
            this.sizeNode  = sizeNode;
            this.fontText  = font;
            this.sizeText  = textsize;
            this.colorText = colorText;
            this.stylePath = path.type;
            this.sizePath  = path.size;
            this.colorPath = path.color;

            foreach (Control control in this.Controls)
            {
                switch (control.Tag)
                {
                case "cbbShape":
                    control.Text = this.shapeNode;
                    break;

                case "cbbSizeShape":
                    control.Text = this.sizeNode.ToString();
                    break;

                case "cbbFont":
                    control.Text = this.fontText;
                    break;

                case "cbbTextSize":
                    control.Text = this.sizeText.ToString();
                    break;

                case "cbbStylePath":
                    control.Text = this.stylePath;
                    break;

                case "cbbSizePath":
                    control.Text = this.sizePath.ToString();
                    break;

                case "colorShape":
                    control.BackColor = this.colorNode;
                    break;

                case "colorText":
                    control.BackColor = this.colorText;
                    break;

                case "colorPath":
                    control.BackColor = this.colorPath;
                    break;
                }
            }
        }