public override bool AcceptsTracker(GVTrackerBase tracker) { if (tracker is GVTrackerControlOut) { return(true); } if (tracker is GVTrackerDataOut) { return(true); } return(false); }
public void ResetPoints() { mouseDownPoint = PointF.Empty; mouseMovePoint = PointF.Empty; mouseUpPoint = PointF.Empty; logDownPoint = PointF.Empty; logMovePoint = PointF.Empty; logUpPoint = PointF.Empty; mouseState = GVGraphViewMouseState.None; downObject = null; downObjectHotPointOffset = PointF.Empty; TrackedObject = null; upObject = null; ActiveTracker = null; }
private void GVGraphView_MouseMove(object sender, MouseEventArgs e) { if (p_context.mouseState != GVGraphViewMouseState.None) { p_context.mouseMovePoint.X = e.X; p_context.mouseMovePoint.Y = e.Y; p_context.logMovePoint = p_context.ConvertClientToLogical(e.X, e.Y); p_context.TrackedObject = p_graph.Objects.FindObjectContainingClientPoint(p_context.mouseMovePoint); // test if we should transfer to MOVING status if (p_context.mouseState == GVGraphViewMouseState.Down) { float diff = Math.Abs(e.X - p_context.mouseDownPoint.X) + Math.Abs(e.Y + p_context.mouseDownPoint.Y); if (diff >= 6) { p_context.mouseState = GVGraphViewMouseState.Moved; } } if (p_context.mouseState == GVGraphViewMouseState.Moved) { if (p_context.ActiveTracker != null) { p_context.ActiveTracker.OnTrack(p_context); } else if (p_context.MovedObject == null) { // move whole diagram p_context.DiagramTempOffset.X = e.X - p_context.mouseDownPoint.X; p_context.DiagramTempOffset.Y = e.Y - p_context.mouseDownPoint.Y; } } Invalidate(); } if (p_context.mouseState == GVGraphViewMouseState.None) { if (OnItemHover != null) { p_context.mouseMovePoint.X = e.X; p_context.mouseMovePoint.Y = e.Y; GeneralEventArgs args = new GeneralEventArgs(); GVGraphObject go = Graph.Objects.FindObjectContainingClientPoint(p_context.mouseMovePoint); if (go != null) { args.UserInfo["object"] = go; } else { GVTrackerBase tb = FindActiveTracker(p_context.mouseMovePoint); if (tb != null) { args.UserInfo["tracker"] = tb; } } OnItemHover(this, args); } } }
public virtual bool AcceptsTracker(GVTrackerBase tracker) { return(true); }