Hi Slavcho,
Thank you.
I have tried the sample code you gave me and I understand a lot. I want to tell you more about my problem now.
I currently need to generate three different rectangles in ShapeNode:
1.The rectangle 1 has a triangle direction sign;
2.The rectangle 2 is a dotted border;
3.The rectangle 3 is a solid border;
1.The method to generate the rectangle 1 is to hold down the Ctrl key + double-click the left mouse button and generate it with the clicked coordinate point as the center.The size of this rectangle can be changed by changing the width and height of the specified textbox, or the rectangle can be moved by changing the x and y coordinates of the center of the specified rectangle;
2.The rectangle 2 is the effect of Screenshot_two produced by clicking the button. Set this rectangle with the center point of rectangle 1 as the center. The users can stretch the six corners of this rectangle. Press the mouse to drag the inner area of the rectangle (except for the area that intersects with rectangle one). Finally, click another button to confirm the generation of this rectangle. At this time, its size and position cannot be changed and can only delete it and remake it;
3.The rectangle 3 can be generated by holding down the left mouse button and dragging in the outer area of Rectangle 2 to generate the effect of Screenshot_two. Set the rectangle with the center of Rectangle 1 as the center. The users can stretch the six corners of this rectangle. Press the mouse and drag the inner area of the rectangle (except the area intersecting with Rectangle 1 and Rectangle 2). When a button is clicked to confirm the generation of this rectangle. This rectangle can be resized by changing the width and height of the two textbox. The users can click on the inner area of the rectangle (except the area intersecting with rectangle 1 and rectangle 2) to reproduce the effect of Screenshot_two or change the coordinates of the center point of the rectangle to change the position of the rectangle in the ShapeNode.
How can I use code to completely implement all of what I said above, and create these 3 kinds of rectangles on ShapeNode at will.