|
refresh the length of an arrow (association connector) [message #519796 is a reply to message #518911] |
Wed, 10 March 2010 01:32 |
daniele Mising name Messages: 48 Registered: July 2009 |
Member |
|
|
ok, i calculate the lenght of an arrow in this way (this=linkEditPart)
Quote: | double length = 0;
PointList punti = this.getPrimaryShape().getPolygonPoints();
for (int i = 0; i < punti.size()-1; i++)
{length = length + (punti.getPoint(i).getDistanceOrthogonal(punti.getPoint(i+1) ));
// 28 pixel = 1 cm.
}
length = (length/28);
int temp = (int)(length*10);
length = (temp/10.0);
return (length);
|
I put the length returned in the label of the connection.
Where should I put this code, so that when I resize the arrow, its length is immediatly updated ?
[Updated on: Wed, 10 March 2010 01:34] Report message to a moderator
|
|
|
Powered by
FUDForum. Page generated in 0.02651 seconds