Ejemplo n.º 1
0
        private void CreateLabel(DecoratorPattern typeOrnament, string type)
        {
            Label OrnamentLabel = new Label();

            OrnamentLabel.Location = typeOrnament.OrnamentLocation;
            OrnamentLabel.Name     = type;
            OrnamentLabel.Text     = OrnamentTextBox.Text.ToString();
            OrnamentLabel.Size     = new Size(30, 15);
            OrnamentLabel.AutoSize = true;

            form.Controls.Add(OrnamentLabel);
            if (currentShape != null)
            {
                currentShape.OrnamentList.Add(OrnamentLabel);
                foreach (Composite c in Form1.composites)
                {
                    for (int i = 0; i < c.subordinates.Count; i++)
                    {
                        if (c.subordinates[i].GetShape().ShapeId.Equals(currentShape.ShapeId))
                        {
                            c.compositeSize++;
                        }
                    }
                }
            }
            else
            {
                currentGroup.groupOrnaments.Add(OrnamentLabel);
                currentGroup.compositeSize++;
            }
            this.Close();
        }
Ejemplo n.º 2
0
        private void CreateLabel(DecoratorPattern typeOrnament, string type)
        {
            Label OrnamentLabel = new Label();

            OrnamentLabel.Location = typeOrnament.OrnamentLocation;
            OrnamentLabel.Name     = type;
            OrnamentLabel.Text     = ornamentInput.Text.ToString();
            OrnamentLabel.Size     = new Size(30, 15);
            OrnamentLabel.AutoSize = true;

            form.Controls.Add(OrnamentLabel);
            if (currentShape != null)
            {
                currentShape.OrnamentList.Add(OrnamentLabel);
            }
            else if (currentGroup != null)
            {
                currentGroup.groupOrnaments.Add(OrnamentLabel);
            }
            //form.Refresh();
            this.Close();
        }
Ejemplo n.º 3
0
        private void CreateLabel(DecoratorPattern typeOrnament, string type, string text, Shape s, Composite c)
        {
            Label OrnamentLabel = new Label();

            OrnamentLabel.Location = typeOrnament.OrnamentLocation;
            OrnamentLabel.Name     = type;
            OrnamentLabel.Text     = text;
            OrnamentLabel.Size     = new Size(30, 15);
            OrnamentLabel.AutoSize = true;

            form.Controls.Add(OrnamentLabel);
            if (c == null)
            {
                s.OrnamentList.Add(OrnamentLabel);
            }
            else
            {
                c.GroupOrnaments.Add(OrnamentLabel);
                Form1.Instance.determineGroupSize(c, 0, 0);
                Form1.Instance.recursiveOrnament(c, 0, 0);
            }
            form.Refresh();
        }