Question on PolylineConnection [message #200711] |
Wed, 26 October 2005 07:34  |
Eclipse User |
|
|
|
Originally posted by: prooteus_NOSPAM.gmx.net
Hi,
here a PolylineConnection represents the directed line between two GEF
Figures. I would like to display some small icons under the middle of
this line. This works using the following code:
public class RelationFigure extends PolylineConnection {
[...]
public void setComparisonTypeImages(Vector comparisonTypeImages) {
this.comparisonTypeImages = comparisonTypeImages;
for (Iterator iter = comparisonTypeImages.iterator();
iter.hasNext();) {
Image image = (Image) iter.next();
Label l = new Label();
l.setIcon(image);
MidpointLocator locator = new MidpointLocator(this, 0);
locator.setRelativePosition(PositionConstants.SOUTH);
locator.setGap(4);
add(l, locator);
l.setVisible(true);
}
}
[...]
}
The problem is now that this line is not displayed horizontal all the
time. That is, if it is displayed in an angle other than 180 degrees,
the relative position of the locator should be adapted as well. For
example, if it is vertical, the relative position should be
PositionConstants.EAST.
Is there a possibility to do that?
Any hints are welcome.
Stefan
|
|
|
Re: Question on PolylineConnection [message #200874 is a reply to message #200711] |
Thu, 27 October 2005 19:08  |
Eclipse User |
|
|
|
May be modify Draw2d's ConnectionEndpointLocator to suit your need to be able to position in the middle. It is only for ends, but it can children for polyline anywhere with VDistance and UDistance.
Thanks
Venkat
|
|
|
Powered by
FUDForum. Page generated in 0.25799 seconds