Length of PolylineConnection ? [message #161740] |
Thu, 16 December 2004 08:48  |
Eclipse User |
|
|
|
Originally posted by: ssc.acentic.net
Hi
How do I get the length of the connection line ?
PolylineConnection c = new PolylineConnection();
ChopboxAnchor sourceAnchor = new ChopboxAnchor(f1);
ChopboxAnchor targetAnchor = new ChopboxAnchor(f2);
c.setSourceAnchor(sourceAnchor);
c.setTargetAnchor(targetAnchor);
System.out.println("lenght ? : " + c.getSize() ); // <-- problem,
getSize is not correct
-Sebastian
|
|
|
|
|
|
Re: Length of PolylineConnection ? [message #162147 is a reply to message #161923] |
Mon, 20 December 2004 02:24  |
Eclipse User |
|
|
|
Originally posted by: ssc.acentic.net
Well, basically I want to do 2 things :
1. I want to create a more dynamic method to add a line between 2 Figures
to add a Label in the exact middle and
2. I want to make the Figures dragable (which I was not able to achieve
yet) and update the line between it.
From my understanding I need 2 things, the coordinates of a start and a
end point of the line to know whats between it. Right now I have a very
dirty solution, take the starting point of Figure 1, get the size, get the
middle point of the closest line to the next Figure,... do the same with
the Figure 2 and then calculate the distance between the 2 poings, BUT I
kinda thought since the line is drawn by this "PolylineConnection" it
should knows these 2 points.
|
|
|
Powered by
FUDForum. Page generated in 0.04238 seconds