Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community ForumsMoving Anchor
https://www.eclipse.org/forums/index.php/mv/msg/71110/222370/#msg_222370
I would like to be abble to move anchor point all along the border of a
figure ( arectangle in my case).
Any idea to do that?
thanks for your incoming help.
cheers,
Sebastien.]]>Sébastien Gérard2006-08-31T09:56:24-00:00Re: Moving Anchor
https://www.eclipse.org/forums/index.php/mv/msg/71110/222377/#msg_222377
Originally posted by: tobias.brueggendick.prostep.com
Hello Sebastian,
i think you mean a rectangle. For Rectangle(ChopboxAnchor) and a
Ellipse(EllipseAnchor) this is implemented. Look at this classes and try
to understand. It is difficult cause you must use mathematical formulas.
I'd a similiar Problem and at least i don't use all Points of a Figure but
some i can easily calculate.
I'll try to write what i know and i hope you understand my Englisch. In an
Anchor you get a ReferencePoint which is the startPoint of the incoming
Anchor or the end Point. A Second Point is the Center of the Figure your
Anchor is for. It is easily to calculate the center of any figure. With
getbounds you get x,y, width(w) and height(h). The center is x-w/2,y+h/2 .
So know you have two points and know you need mathematical calculations
depending on your geometric figure to return every point on your border
of the figure. For me it was easier and quicker to return only a couple of
points like the head of a triangle.]]>2006-08-31T12:54:07-00:00