Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Question on PolylineConnection
Question on PolylineConnection [message #200711] Wed, 26 October 2005 11:34 Go to next message
Eclipse UserFriend
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 23:08 Go to previous message
venkataramana m is currently offline venkataramana mFriend
Messages: 86
Registered: July 2009
Member
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
Previous Topic:Deprecated Action constants
Next Topic:How can I start Gef work!
Goto Forum:
  


Current Time: Sat Dec 07 11:43:51 GMT 2024

Powered by FUDForum. Page generated in 0.03252 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top