Exemplo n.º 1
0
        /// <summary>
        /// </summary>
        private void miTS_Click(object sender, EventArgs e)
        {
            UpDownArrowButton udb = new UpDownArrowButton();

            udb.Left = this.Left + (int)((DrawUtility.rw + DrawUtility.ah - 2) / 2 * DrawUtility.a);
            udb.Top  = this.Top + this.Height - 4;
            this.Parent.Controls.Add(udb);
            OutFlows.Add(udb);
            udb.FromProcesses.Add(this);
            udb.SetLinkControls();
        }
Exemplo n.º 2
0
        public override FlowButton AddOutArrow(double degree)
        {
            StraightArrowButton rab = new StraightArrowButton(SystemColors.InactiveCaption, degree, this);

            this.Parent.Controls.Add(rab);
            rab.DrawButton();
            OutFlows.Add(rab);
            rab.FromProcesses.Add(this);
            rab.SetLinkControls();
            return(rab);
        }
Exemplo n.º 3
0
        public override FlowButton AddOutArrow(double outdegree)
        {
            //出入箭头不能重合
            if (((this.InArrowDegree - outdegree) % 360 + 360) % 360 == 180)
            {
                MessageBox.Show("出入箭头不能重合");
                return(null);
            }

            StraightArrowButton rab = new StraightArrowButton(SystemColors.InactiveCaption, outdegree, this);

            this.Parent.Controls.Add(rab);
            rab.DrawButton();
            OutFlows.Add(rab);
            rab.FromProcesses.Add(this);
            rab.SetLinkControls();
            return(rab);
        }
Exemplo n.º 4
0
        /// <summary>
        /// </summary>
        private void miDefine_Click(object sender, EventArgs e)
        {
            try
            {
                Cursor = Cursors.Cross;
                SelectProcessForm spf = new SelectProcessForm(this.Parent);
                if (spf.ShowDialog() == DialogResult.OK)
                {
                    ProcessButton     pb = spf.SelectedButton;
                    DefineArrowButton dab;
                    if (pb.Left > this.Left)
                    {
                        Point startPoint = new Point(this.Left + this.Width, this.Top);
                        Point endPoint   = new Point(pb.Left, pb.Top + pb.Height);
                        dab = new DefineArrowButton(startPoint, endPoint);
                        //向右上方画
                        dab.Left = this.Left + this.Width;
                        dab.Top  = this.Top - (startPoint.Y - endPoint.Y);
                    }
                    else
                    {
                        Point startPoint = new Point(this.Left, this.Top);
                        Point endPoint   = new Point(pb.Left + pb.Width, pb.Top + pb.Height);
                        dab = new DefineArrowButton(startPoint, endPoint);
                        //向右上方画
                        dab.Left = endPoint.X;
                        dab.Top  = endPoint.Y;
                    }

                    this.Parent.Controls.Add(dab);
                    OutFlows.Add(dab);
                    dab.FromProcesses.Add(this);
                    dab.ToProcesses.Add(pb);
                }
                //获取目标点
            }
            finally
            {
                Cursor = Cursors.Default;
            }
        }
Exemplo n.º 5
0
        /// <summary>
        /// </summary>
        private void miJump_Click(object sender, EventArgs e)
        {
            //选择目标点
            ProcessButton     pbEnd = null;
            SelectProcessForm spf   = new SelectProcessForm(this.Parent);

            if (spf.ShowDialog() == DialogResult.OK)
            {
                pbEnd = spf.SelectedButton;
                int length = 0;
                if (pbEnd.Left > this.Left)
                {
                    length = Math.Abs(pbEnd.Left - this.Left - DrawUtility.a);
                }
                else
                {
                    length = Math.Abs(this.Left - pbEnd.Left - DrawUtility.a);
                }

                bool            isBack = pbEnd.Left < this.Left;
                JumpArrowButton jab    = new JumpArrowButton(isBack, length);
                DrawUtility.DrawJumpArrow(jab, null, length, isBack);
                if (pbEnd.Left > this.Left)
                {
                    jab.Left = this.Left + this.Width / 2 - DrawUtility.a;
                    jab.Top  = this.Top - 12 * DrawUtility.a;
                }
                else
                {
                    jab.Left = pbEnd.Left + pbEnd.Width / 2 - DrawUtility.a;
                    jab.Top  = this.Top - 17 * DrawUtility.a;
                }
                this.Parent.Controls.Add(jab);
                OutFlows.Add(jab);
                jab.FromProcesses.Add(this);
                jab.ToProcesses.Add(pbEnd);
            }
        }