示例#1
0
        internal NodeObject MakeNode()
        {
            NodeObject node = new NodeObject();

            drawableObjects.Add(node);
            return(node);
        }
示例#2
0
 public FreeHandRegionForm()
 {
     points = new List<Point>(128);
     regionFillPath = new GraphicsPath();
     lastNode = new NodeObject() { Shape = NodeShape.Circle };
     DrawableObjects.Add(lastNode);
 }
示例#3
0
 public FreeHandRegion()
 {
     points         = new List <Point>(128);
     regionFillPath = new GraphicsPath();
     lastNode       = new NodeObject()
     {
         Shape = NodeShape.Circle
     };
     DrawableObjects.Add(lastNode);
 }
示例#4
0
        private void CreateNode()
        {
            NodeObject newNode = new NodeObject()
            {
                Shape = NodeShape.Diamond
            };

            ActivateNode(newNode);
            nodes.Add(newNode);
            DrawableObjects.Add(newNode);
        }
示例#5
0
        public FreeHandRegionForm()
        {
            points         = new List <Point>(128);
            regionFillPath = new GraphicsPath();
            lastNode       = new NodeObject()
            {
                Shape = NodeShape.Circle
            };
            drawableObjects.Add(lastNode);

            MouseDoubleClick += FreeHandRegionForm_MouseDoubleClick;
        }
示例#6
0
 private void ActivateNode(NodeObject node)
 {
     node.Position   = InputManager.MousePosition0Based;
     node.Visible    = true;
     node.IsDragging = true;
 }
示例#7
0
 internal NodeObject MakeNode()
 {
     NodeObject node = new NodeObject();
     DrawableObjects.Add(node);
     return node;
 }
示例#8
0
        public virtual void OnNodeUpdate()
        {
            for (int i = 0; i < 8; i++)
            {
                NodeObject node = Manager.Nodes[i];

                if (node.IsDragging)
                {
                    Manager.IsResizing = true;

                    if (!InputManager.IsBeforeMouseDown(MouseButtons.Left))
                    {
                        tempNodePos  = node.Position;
                        tempStartPos = Rectangle.Location;
                        tempEndPos   = new Point(Rectangle.X + Rectangle.Width - 1, Rectangle.Y + Rectangle.Height - 1);
                    }

                    Point pos      = InputManager.MousePosition0Based;
                    Point startPos = tempStartPos;
                    Point endPos   = tempEndPos;

                    NodePosition nodePosition = (NodePosition)i;

                    int x = pos.X - tempNodePos.X;

                    switch (nodePosition)
                    {
                    case NodePosition.TopLeft:
                    case NodePosition.Left:
                    case NodePosition.BottomLeft:
                        startPos.X += x;
                        break;

                    case NodePosition.TopRight:
                    case NodePosition.Right:
                    case NodePosition.BottomRight:
                        endPos.X += x;
                        break;
                    }

                    int y = pos.Y - tempNodePos.Y;

                    switch (nodePosition)
                    {
                    case NodePosition.TopLeft:
                    case NodePosition.Top:
                    case NodePosition.TopRight:
                        startPos.Y += y;
                        break;

                    case NodePosition.BottomLeft:
                    case NodePosition.Bottom:
                    case NodePosition.BottomRight:
                        endPos.Y += y;
                        break;
                    }

                    Rectangle = CaptureHelpers.CreateRectangle(startPos, endPos);
                }
            }
        }
示例#9
0
 private void CreateNode()
 {
     NodeObject newNode = new NodeObject() { Shape = NodeShape.Diamond };
     ActivateNode(newNode);
     nodes.Add(newNode);
     DrawableObjects.Add(newNode);
 }
示例#10
0
 private void ActivateNode(NodeObject node)
 {
     node.Position = InputManager.MousePosition0Based;
     node.Visible = true;
     node.IsDragging = true;
 }