示例#1
0
 protected void attachToTrue(BaseNode newNode, bool addToEnd)
 {
     if (addToEnd) //this means that the clicked link is between holder and loop
     {
         //add this node to last node in true link
         BaseNode lastNode = TrueNode;
         while (!(lastNode.OutConnector.EndNode is HolderNode))
         {
             lastNode = lastNode.OutConnector.EndNode;
         }
         lastNode.attachNode(newNode);
     }
     else
     {
         TrueNode.attachNode(newNode);
     }
 }
示例#2
0
        protected override void moveConnections()
        {
            Shape.Location = new PointF(nodeLocation.X, nodeLocation.Y + shiftY);
            PointF point    = new PointF(Shape.Width + Shape.Location.X + horizontalSpace, startNode.Shape.Center.Y - TrueNode.Shape.Size.Height / 2);
            PointF oldPlace = TrueNode.NodeLocation;

            TrueNode.NodeLocation = point;
            // backNode.NodeLocation = new PointF(point.X, point.Y + 100);
            if (TrueConnector.EndNode == null)
            {
                TrueConnector.EndNode = TrueNode;
                //this.OutConnector.EndNode.shiftDown();
                TrueNode.attachNode(BackNode);
                return;
                //      holderNode.attachNode(this, backConnector);
            }
            BackNode.NodeLocation = new PointF(point.X, BackNode.NodeLocation.Y);
            if (moveDirection == MOVE_DOWN)
            {
                TrueNode.OutConnector.EndNode.shiftDown(moreShift);
            }
            else if (moveDirection == MOVE_UP)
            {
                TrueNode.OutConnector.EndNode.shiftUp(oldPlace.Y - point.Y);
                //   OutConnector.EndNode.shiftUp(); //shift main track
            }

            /* if (TrueNode.OutConnector.EndNode is HolderNode)
             * {
             *   BackNode.NodeLocation = new PointF(point.X, point.Y + 60);
             *   shiftMainTrack();
             * }
             *
             * else
             * {
             *   TrueNode.OutConnector.EndNode.shiftDown(moreShift);
             *
             * }*/
        }