Esempio n. 1
0
        private void InitializeDialog()
        {
            Model model = diagram1.Model;

            diagram1.Model.SetSize(new Size(1000, 1000));

            FlowchartStencil stencil = (FlowchartStencil)Singleton.Instance.GetStencil(typeof(FlowchartStencil));

            //Do
            Shape shape = new Shape();

            shape.Location      = new PointF(10, 10);
            shape.Size          = new SizeF(100, 100);
            shape.AllowScale    = false;
            shape.AllowMove     = false;
            shape.StencilItem   = stencil[FlowchartStencilType.Preparation];
            shape.Label         = new Crainiate.Diagramming.Label("Do");
            shape.GradientColor = System.Drawing.Color.Black;
            shape.BackColor     = System.Drawing.Color.LightSalmon;
            model.Shapes.Add("do", shape);
        }
Esempio n. 2
0
        private void InitializeDialog()
        {
            Model model = diagram1.Model;

            diagram1.Model.SetSize(new Size(1000, 1000));

            FlowchartStencil stencil = (FlowchartStencil)Singleton.Instance.GetStencil(typeof(FlowchartStencil));

            //For
            Shape shape = new Shape();

            shape.Location      = new PointF(10, 10);
            shape.Size          = new SizeF(100, 100);
            shape.AllowScale    = false;
            shape.AllowMove     = false;
            shape.StencilItem   = stencil[FlowchartStencilType.Preparation];
            shape.Label         = new Crainiate.Diagramming.Label("For");
            shape.GradientColor = System.Drawing.Color.Black;
            shape.BackColor     = System.Drawing.Color.LightCoral;
            model.Shapes.Add("for", shape);

            this.behaviour_box.SelectedItem = "Increment";
        }
Esempio n. 3
0
        private void InitializeDialog()
        {
            Model model = diagram1.Model;

            diagram1.Model.SetSize(new Size(1000, 1000));

            FlowchartStencil stencil = (FlowchartStencil)Singleton.Instance.GetStencil(typeof(FlowchartStencil));

            //Declare
            Shape shape = new Shape();

            shape.Location      = new PointF(10, 20);
            shape.Size          = new SizeF(100, 100);
            shape.AllowScale    = false;
            shape.AllowMove     = false;
            shape.StencilItem   = stencil[FlowchartStencilType.InternalStorage];
            shape.Label         = new Crainiate.Diagramming.Label("Declare");
            shape.GradientColor = System.Drawing.Color.Black;
            shape.BackColor     = System.Drawing.Color.LightGray;
            model.Shapes.Add("declare", shape);

            this.type_box.SelectedItem = "Single";
            this.data_box.SelectedItem = "Integer";
        }
        private void InitializePicker()
        {
            Model model = diagram1.Model;

            diagram1.Model.SetSize(new Size(1000, 1000));

            FlowchartStencil stencil = (FlowchartStencil)Singleton.Instance.GetStencil(typeof(FlowchartStencil));

            //Declare
            Shape declare = new Shape();

            declare.Location         = new PointF(50, 10);
            declare.Size             = new SizeF(100, 100);
            declare.AllowScale       = false;
            declare.AllowMove        = false;
            declare.StencilItem      = stencil[FlowchartStencilType.InternalStorage];
            declare.Label            = new Crainiate.Diagramming.Label("Declare");
            declare.GradientColor    = System.Drawing.Color.Black;
            declare.BackColor        = System.Drawing.Color.LightGray;
            declare.SelectedChanged += new EventHandler(this.shape_SelectedChanged);
            declare.Selected         = false;
            model.Shapes.Add("declare", declare);

            //Assign
            Shape assign = new Shape();

            assign.Location         = new PointF(200, 10);
            assign.Size             = new SizeF(100, 100);
            assign.AllowScale       = false;
            assign.AllowMove        = false;
            assign.StencilItem      = stencil[FlowchartStencilType.Process];
            assign.Label            = new Crainiate.Diagramming.Label("Assign");
            assign.GradientColor    = System.Drawing.Color.Black;
            assign.BackColor        = System.Drawing.Color.LightGreen;
            assign.SelectedChanged += new EventHandler(this.shape_SelectedChanged);
            assign.Selected         = false;
            model.Shapes.Add("assign", assign);

            //Input
            Shape input = new Shape();

            input.Location         = new PointF(350, 10);
            input.Size             = new SizeF(100, 100);
            input.AllowScale       = false;
            input.AllowMove        = false;
            input.StencilItem      = stencil[FlowchartStencilType.Data];
            input.Label            = new Crainiate.Diagramming.Label("Input");
            input.GradientColor    = System.Drawing.Color.Black;
            input.BackColor        = System.Drawing.Color.Khaki;
            input.SelectedChanged += new EventHandler(this.shape_SelectedChanged);
            input.Selected         = false;
            model.Shapes.Add("input", input);

            //Output
            Shape output = new Shape();

            output.Location         = new PointF(50, 200);
            output.Size             = new SizeF(100, 100);
            output.AllowScale       = false;
            output.AllowMove        = false;
            output.StencilItem      = stencil[FlowchartStencilType.Data];
            output.Label            = new Crainiate.Diagramming.Label("Output");
            output.GradientColor    = System.Drawing.Color.Black;
            output.BackColor        = System.Drawing.Color.LightBlue;
            output.SelectedChanged += new EventHandler(this.shape_SelectedChanged);
            output.Selected         = false;
            model.Shapes.Add("output", output);

            //Decision
            Shape decision = new Shape();

            decision.Location         = new PointF(200, 200);
            decision.Size             = new SizeF(100, 100);
            decision.AllowScale       = false;
            decision.AllowMove        = false;
            decision.StencilItem      = stencil[FlowchartStencilType.Decision];
            decision.Label            = new Crainiate.Diagramming.Label("If");
            decision.GradientColor    = System.Drawing.Color.Black;
            decision.BackColor        = System.Drawing.Color.LightYellow;
            decision.SelectedChanged += new EventHandler(this.shape_SelectedChanged);
            decision.Selected         = false;
            model.Shapes.Add("decision", decision);


            //For Loop
            Shape forLoop = new Shape();

            forLoop.Location         = new PointF(350, 200);
            forLoop.Size             = new SizeF(100, 100);
            forLoop.AllowScale       = false;
            forLoop.AllowMove        = false;
            forLoop.StencilItem      = stencil[FlowchartStencilType.Preparation];
            forLoop.Label            = new Crainiate.Diagramming.Label("For");
            forLoop.GradientColor    = System.Drawing.Color.Black;
            forLoop.BackColor        = System.Drawing.Color.Red;
            forLoop.SelectedChanged += new EventHandler(this.shape_SelectedChanged);
            forLoop.Selected         = false;
            model.Shapes.Add("for", forLoop);

            //Do Loop

            /*Shape doLoop = new Shape();
             * doLoop.Location = new PointF(50, 390);
             * doLoop.Size = new SizeF(100, 100);
             * doLoop.AllowScale = false;
             * doLoop.AllowMove = false;
             * doLoop.StencilItem = stencil[FlowchartStencilType.Preparation];
             * doLoop.Label = new Crainiate.Diagramming.Label("Do");
             * doLoop.GradientColor = System.Drawing.Color.Black;
             * doLoop.BackColor = System.Drawing.Color.Chocolate;
             * doLoop.SelectedChanged += new EventHandler(this.shape_SelectedChanged);
             * model.Shapes.Add("do", doLoop);*/

            //While Loop
            Shape whileLoop = new Shape();

            whileLoop.Location         = new PointF(50, 390);
            whileLoop.Size             = new SizeF(100, 100);
            whileLoop.AllowScale       = false;
            whileLoop.AllowMove        = false;
            whileLoop.StencilItem      = stencil[FlowchartStencilType.Preparation];
            whileLoop.Label            = new Crainiate.Diagramming.Label("While");
            whileLoop.GradientColor    = System.Drawing.Color.Black;
            whileLoop.BackColor        = System.Drawing.Color.LightSalmon;
            whileLoop.SelectedChanged += new EventHandler(this.shape_SelectedChanged);
            model.Shapes.Add("while", whileLoop);
            whileLoop.Selected = false;

            //If
            Shape ifElse = new Shape();

            ifElse.Location         = new PointF(200, 390);
            ifElse.Size             = new SizeF(100, 100);
            ifElse.AllowScale       = false;
            ifElse.AllowMove        = false;
            ifElse.StencilItem      = stencil[FlowchartStencilType.Decision];
            ifElse.Label            = new Crainiate.Diagramming.Label("If Else");
            ifElse.GradientColor    = System.Drawing.Color.Black;
            ifElse.BackColor        = System.Drawing.Color.LightSalmon;
            ifElse.SelectedChanged += new EventHandler(this.shape_SelectedChanged);
            ifElse.Selected         = false;
            model.Shapes.Add("ifElse", ifElse);
        }