Ejemplo n.º 1
0
 public Block addBlock(String name, String type, String info)
 {
     Block newBlock;
     if (type.Equals("repeating")) newBlock = new RepeatingBlock(name, info);
     else if (type.Equals("single")) newBlock = new SingleBlock(name, info);
     else if (type.Equals("optional")) newBlock = new OptionalBlock(name, info);
     else if (type.Equals("dependent")) newBlock = new DependBlock(name, info);
     else return null;
     data.AddLast(newBlock);
     return newBlock;
 }
Ejemplo n.º 2
0
 public void drawData(RepeatingBlock data)
 {
     createLabel(data.getName(), "A block that appears repeatedly.");
     Label conditionLabel = new Label();
     conditionLabel.Text = "  x " + data.getNumOfRepetitions();
     conditionLabel.Size = nodeLabelSize;
     conditionLabel.Location = new Point(nodeSize.Width + initialLeft + structureDepth * nodeSize.Width / 3, initialHeight + structureIndex * nodeSize.Height);
     conditionLabel.Font = new Font("Arial", 10, FontStyle.Bold);
     p_view.Controls.Add(conditionLabel);
     structureDepth++;
     foreach (Data child in data.getChildren())
     {
         structureIndex++;
         child.drawData(this);
     }
     structureDepth--;
 }