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:how do I react to property changes visually
Next Topic:HowTo get scroll bars to work in draw2d.FigureCanvas?
Goto Forum:
  


Current Time: Wed Dec 07 01:20:53 GMT 2022

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

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

Back to the top