Ejemplo n.º 1
0
 public override bool AcceptsTracker(GVTrackerBase tracker)
 {
     if (tracker is GVTrackerControlOut)
     {
         return(true);
     }
     if (tracker is GVTrackerDataOut)
     {
         return(true);
     }
     return(false);
 }
Ejemplo n.º 2
0
        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;
        }
Ejemplo n.º 3
0
        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);
                }
            }
        }
Ejemplo n.º 4
0
 public virtual bool AcceptsTracker(GVTrackerBase tracker)
 {
     return(true);
 }