Ejemplo n.º 1
0
 //Feature Creation Methods
 private void featureCreateButton_Click(object sender, EventArgs e)
 {
     if (textBox1.Lines.Length == 0)
     {
         MessageBox.Show("You cannot create a feature with no name", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
         return;
     }
     string data = textBox1.Lines[0];
     if (featGraph.hasNodeData(data))
     {
         MessageBox.Show("You cannot create two features with the same name", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
         return;
     }
     if (hasBadChar(data))
     {
         MessageBox.Show("The values you have entered contain characters that are not allowed\nThe characters that you cannot use are " + BAD_CHARS, "Warning", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
         return;
     }
     textBox1.Clear();
     Feature toAdd = new Feature(data);
     for (int x = 0; x < featureCreatorCheckedListBox.CheckedItems.Count; x++)
     {
         toAdd.addNeighbor(featGraph.getFeature(featureCreatorCheckedListBox.CheckedItems[x].ToString()));
         featGraph.getFeature(featureCreatorCheckedListBox.CheckedItems[x].ToString()).addParent(toAdd);
         //featGraph.getFeature(checkedListBox1.CheckedItems[x].ToString()).addNeighbor(toAdd);
     }
     featGraph.addFeature(toAdd);
     refreshAllButUpdateFeature();
     updateFlag = true;
 }