Пример #1
0
        /// <summary>
        /// Makes a simple demo diagram (not scientifically correct)
        /// </summary>
        private void MakeExample()
        {
            this.lithiumControl.Root.Text = "Ecosystem";
            ShapeBase root = this.lithiumControl.Root;

            ShapeBase ert = root.AddChild("Earth");
            ShapeBase com = root.AddChild("Community");

            ShapeBase pop = com.AddChild("Population");
            ShapeBase org = com.AddChild("Organism");
            ShapeBase bac = com.AddChild("Bacteria");
            ShapeBase vir = com.AddChild("Virus");

            com.Expand();

            ShapeBase euk  = bac.AddChild("Eukaryotes");
            ShapeBase arch = bac.AddChild("Archea");
            ShapeBase pro  = euk.AddChild("Protista");
            ShapeBase fla  = pro.AddChild("Flagellates");
            ShapeBase amo  = pro.AddChild("Amoeba");
            ShapeBase alg  = pro.AddChild("Algae");
            ShapeBase par  = pro.AddChild("Parasites");


            ShapeBase anim = pop.AddChild("Animals");
            ShapeBase pla  = pop.AddChild("Plants");
            ShapeBase ins  = pop.AddChild("Insects");

            ShapeBase ant = ins.AddChild("Ants");

            ShapeBase mus = pop.AddChild("Mushrooms");


            //re-order and center a bit to please the eyes
            root.Move(new Point(20 - root.X, Convert.ToInt32(this.lithiumControl.Height / 2) - root.Y));
            bac.Collapse(true);

            //as well as some coloring
            this.mnuColorLevels_Click(null, EventArgs.Empty);
        }