Ejemplo n.º 1
0
 public void updateTree(B_Tree <ComparableInt> b_Tree)
 {
     bTree = b_Tree;
     Invalidate();
     foundedKey  = null;
     foundedNode = null;
 }
Ejemplo n.º 2
0
 public void updateTreeWithFoundedElement(B_Tree <ComparableInt> b_Tree, ComparableInt key, B_Tree_Node <ComparableInt> inNode)
 {
     foundedKey  = key;
     foundedNode = inNode;
     bTree       = b_Tree;
     Invalidate();
 }
Ejemplo n.º 3
0
        public TreeControl(B_Tree <ComparableInt> b_Tree)
        {
            Brush brush = new SolidBrush(Color.Black);

            rectanglePen      = new Pen(brush);
            foundedElementPen = new Pen(foundedElementBrush);
            //foundedElementPen.
            Size       = new Size(100, 100);
            this.bTree = b_Tree;
        }
Ejemplo n.º 4
0
 private void button1_Click(object sender, EventArgs e)
 {
     try
     {
         int t = Convert.ToInt32(textBox2.Text);
         if (t <= 1)
         {
             throw new FormatException();
         }
         B_Tree <ComparableInt> newTree = new B_Tree <ComparableInt>(t, ComparableInt.FromStr);
         var list = b_Tree.ToList();
         foreach (var i in list)
         {
             newTree.Insert(i);
         }
         b_Tree = newTree;
         treeControl.updateTree(b_Tree);
     }catch (FormatException ex)
     {
         MessageBox.Show("Уровень ветвистости задается целым числом > 1");
     }
 }