internal override void MouseMoved(AbsoluteMouseEventArgs e) { if (!e.Handled) { bool moved = IsMousePressed; if (moved) { e.Handled = true; OnMouseMove(e); } } }
internal sealed override void MouseUpped(AbsoluteMouseEventArgs e) { if (!e.Handled) { var upped = IsMousePressed; if (upped) { e.Handled = true; OnMouseUp(e); } } }
protected override Shape.ResizeMode GetResizeMode(AbsoluteMouseEventArgs e) { ResizeMode resizeMode = base.GetResizeMode(e); if (Collapsed) { return(resizeMode & ~ResizeMode.Bottom); } else { return(resizeMode); } }
protected override void OnDoubleClick(AbsoluteMouseEventArgs e) { base.OnDoubleClick(e); ResizeMode resizeMode = GetResizeMode(e); if ((resizeMode & ResizeMode.Right) != 0) { AutoWidth(); } if ((resizeMode & ResizeMode.Bottom) != 0) { AutoHeight(); } }
internal override void DoubleClicked(AbsoluteMouseEventArgs e) { bool doubleClicked = Picked(e.Location, e.Zoom); if (e.Button == MouseButtons.Left) { doubleClicked |= (IsSelected); } if (doubleClicked) { OnDoubleClick(e); e.Handled = true; } }
protected override void OnMouseMove(AbsoluteMouseEventArgs e) { base.OnMouseMove(e); if (IsResizing) { PerformResize(e.Location); } else if (IsMousePressed && (e.Button == MouseButtons.Left)) { Size offset = new Size(( int )(e.X - mouseDownLocation.X), ( int )(e.Y - mouseDownLocation.Y)); OnDragging(new MoveEventArgs(offset)); } }
protected override void OnMouseDown(AbsoluteMouseEventArgs e) { base.OnMouseDown(e); if (IsChevronPressed(e.Location)) { Collapsed = !Collapsed; } else { if (e.Button == MouseButtons.Left) { IsActive = true; } } }
public void MouseMove(AbsoluteMouseEventArgs e) { Point mouseLocation = new Point((int)e.X, (int)e.Y); foreach (Shape shape in diagram.GetShapesInDisplayOrder()) { if (shape.BorderRectangle.Contains(mouseLocation)) { if (!firstSelected) { if (first != shape) { first = shape; diagram.Redraw(); } } else { if (second != shape) { second = shape; diagram.Redraw(); } } return; } } if (!firstSelected) { if (first != null) { first = null; diagram.Redraw(); } } else { if (second != null) { second = null; diagram.Redraw(); } } }
public void MouseDown(AbsoluteMouseEventArgs e) { if (!firstSelected) { if (first != null) { firstSelected = true; } } else { if (second != null) { CreateConnection(); } } }
internal sealed override void MouseMoved(AbsoluteMouseEventArgs e) { if (!e.Handled) { bool contains = IsResizing; if (!IsResizing) { contains = Contains(e.Location); if (Contains(e.Location) && mouseLeaved) { OnMouseEnter(EventArgs.Empty); } else if (!Contains(e.Location) && !mouseLeaved) { OnMouseLeave(EventArgs.Empty); } contains |= (IsSelected && GetResizeMode(e) != ResizeMode.None); } if (IsMousePressed || contains) { e.Handled = true; if (IsMousePressed) { Cursor.Current = cursor; } else { cursor = GetCursor(e); Cursor.Current = cursor; } OnMouseMove(e); } } else // Already handled { if (!mouseLeaved) { OnMouseLeave(EventArgs.Empty); } } }
public void MouseMove(AbsoluteMouseEventArgs e) { var mouseLocation = new Point((int)e.X, (int)e.Y); foreach (var shape in Diagram.Shapes) { if (shape.BorderRectangle.Contains(mouseLocation)) { if (!FirstSelected) { if (First != shape) { First = shape; Diagram.Redraw(); } } else { if (Second != shape) { Second = shape; Diagram.Redraw(); } } return; } } if (!FirstSelected) { if (First != null) { First = null; Diagram.Redraw(); } } else { if (Second != null) { Second = null; Diagram.Redraw(); } } }
public void MouseMove(AbsoluteMouseEventArgs e) { Point mouseLocation = new Point((int) e.X, (int) e.Y); foreach (Shape shape in diagram.Shapes) { if (shape.BorderRectangle.Contains(mouseLocation)) { if (!firstSelected) { if (first != shape) { first = shape; diagram.Redraw(); } } else { if (second != shape) { second = shape; diagram.Redraw(); } } return; } } if (!firstSelected) { if (first != null) { first = null; diagram.Redraw(); } } else { if (second != null) { second = null; diagram.Redraw(); } } }
internal sealed override void DoubleClicked(AbsoluteMouseEventArgs e) { if (!e.Handled) { bool doubleClicked = Contains(e.Location); if (e.Button == MouseButtons.Left) { doubleClicked |= (IsSelected && GetResizeMode(e) != ResizeMode.None); } if (doubleClicked) { e.Handled = true; OnDoubleClick(e); } } }
public Cursor GetCursor(AbsoluteMouseEventArgs e) { ResizeMode mode = GetResizeMode(e); switch (mode) { case ResizeMode.Bottom: return(Cursors.SizeNS); case ResizeMode.Right: return(Cursors.SizeWE); case ResizeMode.Bottom | ResizeMode.Right: return(Cursors.SizeNWSE); default: return(Cursors.Default); } }
internal sealed override void MousePressed(AbsoluteMouseEventArgs e) { if (!e.Handled) { bool pressed = Contains(e.Location); if (e.Button == MouseButtons.Left) { pressed |= (IsSelected && GetResizeMode(e) != ResizeMode.None); } if (pressed) { e.Handled = true; resizeMode = GetResizeMode(e); Cursor.Current = cursor; OnMouseDown(e); } } }
protected virtual ResizeMode GetResizeMode(AbsoluteMouseEventArgs e) { if (e.Zoom <= UndreadableZoom) { return(ResizeMode.None); } ResizeMode mode = ResizeMode.None; float squareSize = SelectionMargin / e.Zoom; int horCenter = HorizontalCenter; int verCenter = VerticalCenter; bool left = (e.X >= Left - squareSize && e.X < Left); bool top = (e.Y >= Top - squareSize && e.Y < Top); bool right = (e.X > Right && e.X < Right + squareSize); bool bottom = (e.Y > Bottom && e.Y < Bottom + squareSize); bool center = (e.X >= horCenter - squareSize / 2 && e.X < horCenter + squareSize / 2); bool middle = (e.Y >= verCenter - squareSize / 2 && e.Y < verCenter + squareSize / 2); if (right && (top || middle || bottom)) { mode |= ResizeMode.Right; } else if (left && (top || middle || bottom)) { mode |= ResizeMode.Left; } if (bottom && (left || center || right)) { mode |= ResizeMode.Bottom; } else if (top && (left || center || right)) { mode |= ResizeMode.Top; } return(mode); }
protected override void OnMouseDown(AbsoluteMouseEventArgs e) { base.OnMouseDown(e); // deselect the parent if (ParentShape != null && (Control.ModifierKeys != Keys.Control)) { ParentShape.IsSelected = false; } if (IsChevronPressed(e.Location)) { Collapsed = !Collapsed; } else { if (e.Button == MouseButtons.Left) { IsActive = true; } } }
protected override void OnMouseMove(AbsoluteMouseEventArgs e) { base.OnMouseMove(e); if (IsResizing) { PerformResize(e.Location); } else if (IsMousePressed && e.Button == MouseButtons.Left) { Size offset = new Size( (int)(e.X - _mouseDownLocation.X), (int)(e.Y - _mouseDownLocation.Y)); if (_currentOperation == DiagramElementOperation.None) { _currentOperation = DiagramElementOperation.Dragging; OnBeginUndoableOperation(EventArgs.Empty); } OnDragging(new MoveEventArgs(offset)); } }
protected virtual ResizeMode GetResizeMode(AbsoluteMouseEventArgs e) { if (e.Zoom <= UndreadableZoom) return ResizeMode.None; ResizeMode mode = ResizeMode.None; float squareSize = SelectionMargin / e.Zoom; int horCenter = HorizontalCenter; int verCenter = VerticalCenter; bool left = (e.X >= Left - squareSize && e.X < Left); bool top = (e.Y >= Top - squareSize && e.Y < Top); bool right = (e.X > Right && e.X < Right + squareSize); bool bottom = (e.Y > Bottom && e.Y < Bottom + squareSize); bool center = (e.X >= horCenter - squareSize / 2 && e.X < horCenter + squareSize / 2); bool middle = (e.Y >= verCenter - squareSize / 2 && e.Y < verCenter + squareSize / 2); if (right && (top || middle || bottom)) mode |= ResizeMode.Right; if (bottom && (left || center || right)) mode |= ResizeMode.Bottom; return mode; }
protected virtual void OnDoubleClick(AbsoluteMouseEventArgs e) { if (DoubleClick != null) DoubleClick(this, e); }
protected override void OnMouseDown(AbsoluteMouseEventArgs e) { mouseDownLocation = e.Location; base.OnMouseDown(e); }
protected override void OnDoubleClick(AbsoluteMouseEventArgs e) { ShowEditor(); base.OnDoubleClick(e); }
internal abstract void MouseUpped(AbsoluteMouseEventArgs e);
internal sealed override void MousePressed(AbsoluteMouseEventArgs e) { if (!e.Handled) { bool pressed = Contains(e.Location); if (e.Button == MouseButtons.Left) pressed |= (IsSelected && GetResizeMode(e) != ResizeMode.None); if (pressed) { e.Handled = true; resizeMode = GetResizeMode(e); Cursor.Current = cursor; OnMouseDown(e); } } }
protected override void OnMouseMove(AbsoluteMouseEventArgs e) { base.OnMouseMove(e); //TODO: szebb lenne külön eljárásba tenni if (e.Button == MouseButtons.Left && selectedBendPoint != null) { Point newLocation = Point.Truncate(e.Location); if (selectedBendPoint.Location != newLocation) { if (!copied && Control.ModifierKeys == Keys.Control) { BendPoint newPoint = (BendPoint) selectedBendPoint.Clone(); newPoint.Location = newLocation; if (selectedBendPoint.RelativeToStartShape) bendPoints.AddAfter(bendPoints.Find(selectedBendPoint), newPoint); else bendPoints.AddBefore(bendPoints.Find(selectedBendPoint), newPoint); selectedBendPoint = newPoint; copied = true; OnBendPointMove(new BendPointEventArgs(selectedBendPoint)); } else { selectedBendPoint.Location = newLocation; OnBendPointMove(new BendPointEventArgs(selectedBendPoint)); } Reroute(); OnRouteChanged(EventArgs.Empty); OnModified(EventArgs.Empty); } } }
protected override void OnDoubleClick(AbsoluteMouseEventArgs e) { base.OnDoubleClick(e); ResizeMode resizeMode = GetResizeMode(e); if ((resizeMode & ResizeMode.Right) != 0) AutoWidth(); if ((resizeMode & ResizeMode.Bottom) != 0) AutoHeight(); }
private bool BendPointDoubleClicked(AbsoluteMouseEventArgs e) { BendPoint point = GetBendPoint(e); if (point != null) { if (!point.AutoPosition) { if (point == FirstBendPoint && !bendPoints.SecondValue.RelativeToStartShape || point == LastBendPoint && bendPoints.SecondLastValue.RelativeToStartShape) { point.AutoPosition = true; } else { bendPoints.Remove(point); } Reroute(); OnRouteChanged(EventArgs.Empty); OnModified(EventArgs.Empty); } e.Handled = true; return true; } else { return false; } }
protected override void OnMouseMove(AbsoluteMouseEventArgs e) { base.OnMouseMove(e); if (IsResizing) { PerformResize(e.Location); } else if (IsMousePressed && e.Button == MouseButtons.Left) { Size offset = new Size( (int) (e.X - mouseDownLocation.X), (int) (e.Y - mouseDownLocation.Y)); OnDragging(new MoveEventArgs(offset)); } }
protected override void OnMouseUp(AbsoluteMouseEventArgs e) { base.OnMouseUp(e); resizeMode = ResizeMode.None; }
protected override void OnMouseDown(AbsoluteMouseEventArgs e) { mouseDownLocation = e.Location; base.OnMouseDown(e); }
internal sealed override void DoubleClicked(AbsoluteMouseEventArgs e) { if (!e.Handled) { bool doubleClicked = Contains(e.Location); if (e.Button == MouseButtons.Left) doubleClicked |= (IsSelected && GetResizeMode(e) != ResizeMode.None); if (doubleClicked) { e.Handled = true; OnDoubleClick(e); } } }
internal sealed override void MouseMoved(AbsoluteMouseEventArgs e) { if (!e.Handled) { bool contains = IsResizing; if (!IsResizing) { contains = Contains(e.Location); if (Contains(e.Location) && mouseLeft) OnMouseEnter(EventArgs.Empty); else if (!Contains(e.Location) && !mouseLeft) OnMouseLeave(EventArgs.Empty); contains |= (IsSelected && GetResizeMode(e) != ResizeMode.None); } if (IsMousePressed || contains) { e.Handled = true; if (IsMousePressed) { Cursor.Current = cursor; } else { cursor = GetCursor(e); Cursor.Current = cursor; } OnMouseMove(e); } } else // Already handled { if (!mouseLeft) OnMouseLeave(EventArgs.Empty); } }
private BendPoint GetBendPoint(AbsoluteMouseEventArgs e) { if (e.Zoom <= UndreadableZoom) return null; foreach (BendPoint point in bendPoints) { if (point.Contains(e.Location, e.Zoom)) return point; } return null; }
internal override void MouseUpped(AbsoluteMouseEventArgs e) { if (!e.Handled) { bool upped = IsMousePressed; if (upped) { e.Handled = true; OnMouseUp(e); } } }
private bool BendPointPressed(AbsoluteMouseEventArgs e) { BendPoint point = GetBendPoint(e); selectedBendPoint = point; if (point != null) { if (point.AutoPosition) { point.AutoPosition = false; Reroute(); OnRouteChanged(EventArgs.Empty); OnModified(EventArgs.Empty); } return true; } else { return false; } }
public Cursor GetCursor(AbsoluteMouseEventArgs e) { ResizeMode mode = GetResizeMode(e); switch (mode) { case ResizeMode.Bottom: return Cursors.SizeNS; case ResizeMode.Right: return Cursors.SizeWE; case ResizeMode.Bottom | ResizeMode.Right: return Cursors.SizeNWSE; default: return Cursors.Default; } }
internal override void MousePressed(AbsoluteMouseEventArgs e) { if (!e.Handled) { bool pressed = Picked(e.Location, e.Zoom); if (e.Button == MouseButtons.Left) pressed |= (IsSelected && BendPointPressed(e)); if (pressed) { e.Handled = true; OnMouseDown(e); } } }
public void MouseDown(AbsoluteMouseEventArgs e) { if (!firstSelected) { if (first != null) firstSelected = true; } else { if (second != null) CreateConnection(); } }
internal override void DoubleClicked(AbsoluteMouseEventArgs e) { bool doubleClicked = Picked(e.Location, e.Zoom); if (e.Button == MouseButtons.Left) doubleClicked |= (IsSelected && BendPointDoubleClicked(e)); if (doubleClicked) { OnDoubleClick(e); e.Handled = true; } }
protected override void OnDoubleClick(AbsoluteMouseEventArgs e) { if (Contains(e.Location) && e.Button == MouseButtons.Left) ShowEditor(); }
protected override void OnMouseUp(AbsoluteMouseEventArgs e) { base.OnMouseUp(e); selectedBendPoint = null; }
protected virtual void OnMouseUp(AbsoluteMouseEventArgs e) { IsMousePressed = false; MouseUp?.Invoke(this, e); }
internal abstract void DoubleClicked(AbsoluteMouseEventArgs e);
internal abstract void MousePressed(AbsoluteMouseEventArgs e);
internal abstract void MousePressed(AbsoluteMouseEventArgs e);
protected virtual void OnMouseMove(AbsoluteMouseEventArgs e) { if (MouseMove != null) MouseMove(this, e); }
protected virtual void OnMouseUp(AbsoluteMouseEventArgs e) { isMousePressed = false; if (MouseUp != null) MouseUp(this, e); }
protected override void OnMouseDown(AbsoluteMouseEventArgs e) { base.OnMouseDown(e); }
protected override void OnMouseUp(AbsoluteMouseEventArgs e) { base.OnMouseUp(e); resizeMode = ResizeMode.None; }
protected override void OnDoubleClick(AbsoluteMouseEventArgs e) { base.OnDoubleClick(e); if (!e.Handled) { ShowEditDialog(); } }
protected override void OnMouseDown(AbsoluteMouseEventArgs e) { if (e.Button == MouseButtons.Left) { IsActive = true; } base.OnMouseDown(e); }
internal abstract void DoubleClicked(AbsoluteMouseEventArgs e);
protected virtual void OnMouseMove(AbsoluteMouseEventArgs e) { MouseMove?.Invoke(this, e); }
protected override void OnMouseUp(AbsoluteMouseEventArgs e) { base.OnMouseUp(e); _showedEditor?.Focus(); }
protected virtual void OnDoubleClick(AbsoluteMouseEventArgs e) { DoubleClick?.Invoke(this, e); }
protected override void OnDoubleClick(AbsoluteMouseEventArgs e) { base.OnDoubleClick(e); if (!e.Handled && generalization.Second is ClassType) { ShowEditDialog(); } }
internal abstract void MouseUpped(AbsoluteMouseEventArgs e);
protected override void OnMouseUp(AbsoluteMouseEventArgs e) { base.OnMouseUp(e); _resizeMode = ResizeMode.None; _currentOperation = DiagramElementOperation.None; }
protected override void OnMouseDown(AbsoluteMouseEventArgs e) { base.OnMouseDown(e); SelectMember(e.Location); }
protected override void OnMouseDown(AbsoluteMouseEventArgs e) { base.OnMouseDown(e); SelectMember(e.Location); }