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()); } }
public void Down(SpaceDiagram d, MouseEventArgs e) { foreach (var m in d.models) { if (m.Down(e.Location)) { _save = m; _isDown = true; } } }
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()); } } }
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; } } }
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); }
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()); } }
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()); } }
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; } } }
public void Up(SpaceDiagram d, MouseEventArgs e) { }
public void Down(SpaceDiagram d, MouseEventArgs e) { }
public void Click(SpaceDiagram d, MouseEventArgs e) { }
public void Move(SpaceDiagram d, MouseEventArgs e) { _isMoved = true; d.movingModel.move.Moving(e.Location); }