Example #1
0
        static void Main(string[] args)
        {
            var a = new FPBTree.FPBTree(1, 3, 4, 4);

            #region random
            a.AddElement(a.Root, 6);
            a.AddElement(a.Root, 3);
            a.AddElement(a.Root, 10);
            a.AddElement(a.Root, 9);
            a.AddElement(a.Root, 8);
            a.AddElement(a.Root, 14);
            a.AddElement(a.Root, 5);
            a.AddElement(a.Root, 1);
            a.AddElement(a.Root, 2);
            a.AddElement(a.Root, 13);
            a.AddElement(a.Root, 7);
            a.AddElement(a.Root, 11);
            a.AddElement(a.Root, 4);
            a.AddElement(a.Root, 12);
            a.AddElement(a.Root, 6);
            a.AddElement(a.Root, 6);
            a.AddElement(a.Root, 6);
            a.AddElement(a.Root, 6);
            a.AddElement(a.Root, 6);
            #endregion
        }
Example #2
0
 public Window()
 {
     InitializeComponent();
     this.NonLeafNodeMaxSize = 4;
     this.LeafNodeMaxSize = 9;
     this.InPageLeafNodeMaxSize = 4;
     this.InPageNonLeafMaxSize = 4;
     tree = new FPBTree.FPBTree(this.NonLeafNodeMaxSize, this.LeafNodeMaxSize, this.InPageLeafNodeMaxSize, this.InPageNonLeafMaxSize);
     tree.events += this.Events;
     Draw.MakeDrawTree<FPBTreeNode.Node>(tree.Root, generalRoot, 0);
     Draw.MakeDrawTree<FPBTreeNode.InPageNode>(generalRoot.Node.Root, inPageRoot, 0);
     add.Enabled = false;
     delete.Enabled = false;
     find.Enabled = false;
     step.Enabled = false;
 }
Example #3
0
        public void ChangeTree(int nonLeafNodeMaxSize, int LeafNodeMaxSize, int inPageLeafNodeMaxSize, int inPageNonLeafNodeMaxSize)
        {
            this.NonLeafNodeMaxSize = nonLeafNodeMaxSize;
            this.LeafNodeMaxSize = LeafNodeMaxSize;
            this.InPageLeafNodeMaxSize = inPageLeafNodeMaxSize;
            this.InPageNonLeafMaxSize = inPageNonLeafNodeMaxSize;
            tree = new FPBTree.FPBTree(this.NonLeafNodeMaxSize, this.LeafNodeMaxSize, this.InPageLeafNodeMaxSize, this.InPageNonLeafMaxSize);
            tree.events += this.Events;
            pictureBox1Image = new Bitmap(730, 260);
            pictureBox2Image = new Bitmap(730, 260);
            Draw.MakeDrawTree<FPBTreeNode.Node>(tree.Root, generalRoot, 0);
            Draw.MakeDrawTree<FPBTreeNode.InPageNode>(generalRoot.Node.Root, inPageRoot, 0);
            generalZone.Clear();
            generalRoot = new DrawNode();
            Graphics gc = Graphics.FromImage(pictureBox1Image);
            Draw.Preparing<FPBTreeNode.Node>(tree.Root, gc, generalZone, generalRoot, true);
            currentGeneralNode = generalRoot;
            pictureBox1.Image = pictureBox1Image;

            inPageZone.Clear();
            inPageRoot = new DrawNode();
            Graphics temp = Graphics.FromImage(pictureBox2Image);
            Draw.Preparing<FPBTreeNode.InPageNode>(generalRoot.Node.Root, temp, inPageZone, inPageRoot, true);
            currentInPageNode = inPageRoot;
            pictureBox2.Image = pictureBox2Image;
            UpdateTB(currentInPageNode.InPageNode);
            listBox1.Items.Clear();
        }
Example #4
0
        private void очиститьДеревоToolStripMenuItem_Click(object sender, EventArgs e)
        {
            tree = new FPBTree.FPBTree(this.NonLeafNodeMaxSize, this.LeafNodeMaxSize, this.InPageLeafNodeMaxSize, this.InPageNonLeafMaxSize);
            tree.events += this.Events;
            pictureBox1Image = new Bitmap(730, 260);
            pictureBox2Image = new Bitmap(730, 260);
            Draw.MakeDrawTree<FPBTreeNode.Node>(tree.Root, generalRoot, 0);
            Draw.MakeDrawTree<FPBTreeNode.InPageNode>(generalRoot.Node.Root, inPageRoot, 0);
            generalZone.Clear();
            generalRoot = new DrawNode();
            Graphics gc = Graphics.FromImage(pictureBox1Image);
            Draw.Preparing<FPBTreeNode.Node>(tree.Root, gc, generalZone, generalRoot, true);
            currentGeneralNode = generalRoot;
            pictureBox1.Image = pictureBox1Image;

            inPageZone.Clear();
            inPageRoot = new DrawNode();
            Graphics temp = Graphics.FromImage(pictureBox2Image);
            Draw.Preparing<FPBTreeNode.InPageNode>(generalRoot.Node.Root, temp, inPageZone, inPageRoot, true);
            currentInPageNode = inPageRoot;
            pictureBox2.Image = pictureBox2Image;
            UpdateTB(currentInPageNode.InPageNode);
            listBox1.Items.Clear();
        }