Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » What are the preconditions in draw2d for making PolylineConnection actually appear?
What are the preconditions in draw2d for making PolylineConnection actually appear? [message #216177] Mon, 15 May 2006 19:31 Go to next message
Paul E. Keyser is currently offline Paul E. KeyserFriend
Messages: 878
Registered: July 2009
Senior Member
R3.1.1

The example article http://www.eclipse.org/articles/Article-GEF-Draw2d/GEF-Draw2 d.html suggests that
the following code should make connections (lines) between IFigure's appear; but it does not do so:

final PolylineConnection c = new PolylineConnection();
ChopboxAnchor sourceAnchor = new ChopboxAnchor(figure1);
ChopboxAnchor targetAnchor = new ChopboxAnchor(figure2);
c.setSourceAnchor(sourceAnchor);
c.setTargetAnchor(targetAnchor);

final PolygonDecoration decoration = new PolygonDecoration();
final PointList decorationPointList = new PointList();
decorationPointList.addPoint(0, 0);
decorationPointList.addPoint(-2, 2);
decorationPointList.addPoint(-4, 0);
decorationPointList.addPoint(-2, -2);
decoration.setTemplate(decorationPointList);
c.setTargetDecoration(decoration);

Both figure1 and figure2 exist (are non-null) and have been added to their "parent" IFigure when
this code is called.

So what else do I need to do, that is not mentioned in the article?

thanks,
Paul
Re: What are the preconditions in draw2d for making PolylineConnection actually appear? [message #216183 is a reply to message #216177] Mon, 15 May 2006 19:52 Go to previous message
Paul E. Keyser is currently offline Paul E. KeyserFriend
Messages: 878
Registered: July 2009
Senior Member
OK, managed to guess:

parentFigure.add(c);

That should be made clear in the article.

Paul
Previous Topic:Recommendations for JUnit testing GEF plug in
Next Topic:i do i include ActiveX control in GEF??
Goto Forum:
  


Current Time: Sat Apr 20 02:48:58 GMT 2024

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

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

Back to the top