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; }
public void drawData(DependBlock data) { createLabel(data.getName() + " (" + data.getInfoName() + ")", data.getInfo() + "\r\n\r\nThis field may or may not appear depending on " + data.getInfoName() + " field.\r\n"); structureDepth++; foreach (Data child in data.getChildren()) { structureIndex++; child.drawData(this); } structureDepth--; }