예제 #1
0
        public void Click(SpaceDiagram d, MouseEventArgs e)
        {
            if (_isMoved == false)
            {
                if (d.selectedModels.Contains(d.hoverModel))
                {
                    d.selectedModels.Remove(d.hoverModel);
                    d.hoverModel.select.Switch();
                }
                else
                {
                    d.selectedModels.Add(d.hoverModel);
                    d.hoverModel.select.Switch();
                }

                if (d.selectedModels.Count > 2)
                {
                    d.selectedModels[0].select.Switch();
                    d.selectedModels.RemoveAt(0);
                }

                d.ChangedSelectedModels();
                d.ChangeState(new HoverSpaceState());
            }
        }
예제 #2
0
 public void Down(SpaceDiagram d, MouseEventArgs e)
 {
     foreach (var m in d.models)
     {
         if (m.Down(e.Location))
         {
             _save   = m;
             _isDown = true;
         }
     }
 }
예제 #3
0
 public void Down(SpaceDiagram d, MouseEventArgs e)
 {
     foreach (var m in d.models)
     {
         if (m.Down(e.Location))
         {
             d.movingModel = m;
             d.ChangeState(new MovingSpaceState());
         }
     }
 }
예제 #4
0
 public void Move(SpaceDiagram d, MouseEventArgs e)
 {
     foreach (var m in d.models)
     {
         if (m.СhangeHover(e.Location))
         {
             d.hoverModel = m;
             d.ChangeState(new HoverSpaceState());
             return;
         }
     }
 }
예제 #5
0
        public Form1()
        {
            InitializeComponent();

            pictureBox1.Paint      += this.PictureBox1_Paint;
            pictureBox1.MouseMove  += this.PictureBox1_MouseMove;
            pictureBox1.MouseDown  += this.PictureBox1_MouseDown;
            pictureBox1.MouseUp    += this.PictureBox1_MouseUp;
            pictureBox1.MouseClick += this.PictureBox1_MouseClick;
            ;

            _diagram = new SpaceDiagram();
            _netCore = new NetworkCore(_diagram);

            listView1.FullRowSelect = true;

            _diagram.OnChangedSelectedModels += CheckDiagramSelectedModels;

            AddImportsDataDiagram(FakeImportsData());

            CheckDiagramSelectedModels();

            var namesColumns = new List <ColumnHeader> {
                new ColumnHeader()
                {
                    Text = "Work", Width = 50
                },
                new ColumnHeader()
                {
                    Text = "Time (min)", Width = 65
                },
                new ColumnHeader()
                {
                    Text = "Time (max)", Width = 65
                },
                new ColumnHeader()
                {
                    Text = "Time (expected)", Width = 95
                },
                new ColumnHeader()
                {
                    Text = "Dispersion", Width = 65
                }
            };

            _dataView = new ListViewCore(listView1, namesColumns);

            _infoView = new ListViewCore(listView2, null, false);
            _infoView.HideHeaders(ColumnHeaderStyle.None);
        }
예제 #6
0
        public void Move(SpaceDiagram d, MouseEventArgs e)
        {
            if (d.hoverModel.СhangeHover(e.Location))
            {
                return;
            }

            d.hoverModel = null;

            if (d.selectedModels.Count == 0)
            {
                d.ChangeState(new IdleSpaceState());
            }
            else
            {
                d.ChangeState(new SelectedSpaceState());
            }
        }
예제 #7
0
        public void Up(SpaceDiagram d, MouseEventArgs e)
        {
            if (_isMoved == false)
            {
                return;
            }
            d.movingModel.move.Stop(e.Location);
            d.movingModel = null;

            if (d.selectedModels.Count == 0)
            {
                d.ChangeState(new HoverSpaceState());
            }
            else
            {
                d.ChangeState(new SelectedSpaceState());
            }
        }
예제 #8
0
        public void Move(SpaceDiagram d, MouseEventArgs e)
        {
            if (_isDown)
            {
                _save.Down(e.Location);
                d.movingModel = _save;
                d.ChangeState(new MovingSpaceState());
            }

            foreach (var m in d.models)
            {
                if (m.СhangeHover(e.Location))
                {
                    d.hoverModel = m;
                    d.ChangeState(new HoverSpaceState());
                    return;
                }
            }
        }
예제 #9
0
 public void Up(SpaceDiagram d, MouseEventArgs e)
 {
 }
예제 #10
0
 public void Down(SpaceDiagram d, MouseEventArgs e)
 {
 }
예제 #11
0
 public void Click(SpaceDiagram d, MouseEventArgs e)
 {
 }
예제 #12
0
 public void Move(SpaceDiagram d, MouseEventArgs e)
 {
     _isMoved = true;
     d.movingModel.move.Moving(e.Location);
 }