예제 #1
0
 void BoxComponentMoved(BaseBoxComponent obj)
 {
     foreach (BaseComponent drawableCmp in model.Items)
     {
         drawableCmp.Accept(new BoxMoveVisitor(obj, true));
     }
 }        
예제 #2
0
 public override void OnParentMoved(BaseBoxComponent box, bool recompute)
 {
     if (this.ConnectionStart == box && this.ConnectionEnd == box)
     {
         this.ControlPoint1.Add(box.EdgePoints[this.ConnectionStartPointIndex].CloneAndSubtract(this.StartPoint));
         this.ControlPoint2.Add(box.EdgePoints[this.ConnectionStartPointIndex].CloneAndSubtract(this.StartPoint));
     }
     base.OnParentMoved(box, recompute);
 }
예제 #3
0
 public virtual void OnParentMoved(BaseBoxComponent box, bool recompute)
 {
     if (this.ConnectionStart == box)
     {
         this.StartPoint.X = box.EdgePoints[this.ConnectionStartPointIndex].X;
         this.StartPoint.Y = box.EdgePoints[this.ConnectionStartPointIndex].Y;
         this.ParentMoving = !recompute;
         this.RecomputePoints();
     }
     if (this.ConnectionEnd == box)
     {
         this.EndPoint.X   = box.EdgePoints[this.ConnectionEndPointIndex].X;
         this.EndPoint.Y   = box.EdgePoints[this.ConnectionEndPointIndex].Y;
         this.ParentMoving = !recompute;
         this.RecomputePoints();
     }
 }
예제 #4
0
 public virtual void OnParentMoved(BaseBoxComponent box, bool recompute)
 {
     if (this.ConnectionStart == box)
     {
         this.StartPoint.X = box.EdgePoints[this.ConnectionStartPointIndex].X;
         this.StartPoint.Y = box.EdgePoints[this.ConnectionStartPointIndex].Y;
         this.ParentMoving = !recompute;
         this.RecomputePoints();
     }
     if (this.ConnectionEnd == box)
     {
         this.EndPoint.X = box.EdgePoints[this.ConnectionEndPointIndex].X;
         this.EndPoint.Y = box.EdgePoints[this.ConnectionEndPointIndex].Y;
         this.ParentMoving = !recompute;
         this.RecomputePoints();
     }
 }
 void LinePointMoved(BaseBoxComponent cmp)
 {   
     foreach (FlowChartPoint edgePoint in cmp.EdgePoints)
     {
         float d = GraphicsUtil.Distance(edgePoint, linePoint);
         cmp.IsSelected = (d < cmp.View.ViewFactory.EdgeBoxWidth * 5);
         if (d < cmp.View.ViewFactory.EdgeBoxWidth * 2)
         {                    
             linePoint.X = edgePoint.X;
             linePoint.Y = edgePoint.Y;
             if (lineCmp.StartPoint == linePoint)
             {
                 lineCmp.ConnectionStart = cmp;
                 lineCmp.ConnectionStartPointIndex = cmp.EdgePoints.IndexOf(edgePoint);
             }
             else if (lineCmp.EndPoint == linePoint)
             {
                 lineCmp.ConnectionEnd = cmp;
                 lineCmp.ConnectionEndPointIndex = cmp.EdgePoints.IndexOf(edgePoint);
             }
             return;
         }
     }            
 }
예제 #6
0
 public void VisitComponent(BaseBoxComponent cmp)
 {
     cmp.BoxComponentMoving += new Action<BaseBoxComponent>(BoxComponentMoving);
     cmp.BoxComponentMoved += new Action<BaseBoxComponent>(BoxComponentMoved);            
 }
예제 #7
0
 public override void OnParentMoved(BaseBoxComponent box, bool recompute)
 {
     if (this.ConnectionStart == box && this.ConnectionEnd == box)
     {
         this.ControlPoint1.Add(box.EdgePoints[this.ConnectionStartPointIndex].CloneAndSubtract(this.StartPoint));
         this.ControlPoint2.Add(box.EdgePoints[this.ConnectionStartPointIndex].CloneAndSubtract(this.StartPoint));
     }
     base.OnParentMoved(box, recompute);
 }        
예제 #8
0
 public BoxMoveVisitor(BaseBoxComponent box, bool recompute)
 {
     this.box = box;
     this.recompute = recompute;
 }