Example #1
0
        // ************ modification ************

        internal override void startModify(PointF org, int handle, InteractionState ist)
        {
            base.startModify(org, handle, ist);
            relatedInteraction = ist;

            ptLastTopLeft.X = rect.Left;
            ptLastTopLeft.Y = rect.Top;
            ptLastTopLeft   = flowChart.AlignPointToGrid(ptLastTopLeft);

            if (handle == 8 && selectedItems.Count > 0)
            {
                foreach (ChartObject obj in selectedItems)
                {
                    if (!obj.getModifying() && obj.canModify(handle))
                    {
                        obj.startModify(org, 0, ist);
                    }
                }
            }

            // find arrows whose both ends are selected
            arrowsToMove.Clear();
            MethodCallVisitor visitor = new MethodCallVisitor(
                new VisitOperation(HV_TranslateArrow));

            visitHierarchy(visitor);
        }
Example #2
0
        internal override void completeModify(PointF end, InteractionState ist)
        {
            base.completeModify(end, ist);
            relatedInteraction = null;
            RectangleF rcBounding = new RectangleF(0, 0, 0, 0);

            if (modifyHandle == 8)
            {
                MethodCallVisitor visitor = new MethodCallVisitor(
                    new VisitOperation(updateNSARect));
                visitHierarchy(visitor);

                foreach (ChartObject obj in selectedItems)
                {
                    RectangleF rcObj = obj.getRotatedBounds();
                    rcBounding = Utilities.unionNonEmptyRects(rcBounding, rcObj);
                }
                rect = rcBounding;

                // beware of arrow routing; obj.completeModify invokations
                // might route many arrows repetitively
                flowChart.DontRouteForAwhile = true;

                // call EndModify method of all selected objects
                foreach (ChartObject obj in selectedItems)
                {
                    if (obj.getModifying() && obj.canModify(modifyHandle))
                    {
                        obj.completeModify();
                    }
                }

                // now that would route an arrow only once
                flowChart.DontRouteForAwhile = false;
                flowChart.routeAllArrows(this);

                // fire SelectionMoved event, for that was exactly what happened
                flowChart.fireSelectionMoved();
            }
        }