Question on PolylineConnection [message #200711] |
Wed, 26 October 2005 11: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
|
|
|
|
Powered by
FUDForum. Page generated in 0.07880 seconds