Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Layout for multiple IFigure children of a PolylineConnection?
Layout for multiple IFigure children of a PolylineConnection? [message #1059821] Tue, 21 May 2013 18:06 Go to next message
Stephan Druskat is currently offline Stephan DruskatFriend
Messages: 104
Registered: October 2011
Location: Berlin, Germany
Senior Member

Is there a way to specify a layout for children of a PolylineConnection?

I want to add several Labels to a PolylineConnection at ConnectionLocator.MIDDLE without the use of a container figure for the labels.

Both PolylineConnection and Label have EditParts, and the label's model objects are children of the polyline connection's model objects.

Ideally I want to add all label children of a polyline to ConnectionLocator.MIDDLE in a ToolbarLayout...

     ________
     | NODE |
     --------
        |
        |
        |
      Label 1
      Label 2
      Label 3
        |
        |
        |
        |
        |
     ________
     | NODE |
     --------

Re: Layout for multiple IFigure children of a PolylineConnection? [message #1063165 is a reply to message #1059821] Wed, 12 June 2013 14:06 Go to previous messageGo to next message
Jan Krakora is currently offline Jan KrakoraFriend
Messages: 477
Registered: December 2009
Location: Prague
Senior Member
You can set any LayoutManager to the PolylineConnection you want. By default it uses DelegatingLayout which gives
the layout responsibility to the children using Locator.relocate() provided as a constraint.
Re: Layout for multiple IFigure children of a PolylineConnection? [message #1063554 is a reply to message #1063165] Thu, 13 June 2013 12:06 Go to previous messageGo to next message
Stephan Druskat is currently offline Stephan DruskatFriend
Messages: 104
Registered: October 2011
Location: Berlin, Germany
Senior Member

Thanks, Jan!

In the meantime, I've found a workaround with using ConnectionLocator.MIDDLE for the first child and using RelativeLocator for the rest (cf. this blog post)...

I think this is actually using the default DelegatingLayout you mention?
Re: Layout for multiple IFigure children of a PolylineConnection? [message #1064047 is a reply to message #1063554] Mon, 17 June 2013 11:53 Go to previous messageGo to next message
Jan Krakora is currently offline Jan KrakoraFriend
Messages: 477
Registered: December 2009
Location: Prague
Senior Member
Yes, it is.

Actually, the DelegatingLayout is the default layout manager used on PolylineConnections and implementation of the Locator is a constraint for it.

It's the same as XYLayout and a Rectangle(it's constraint).
Re: Layout for multiple IFigure children of a PolylineConnection? [message #1064294 is a reply to message #1064047] Tue, 18 June 2013 14:53 Go to previous message
Stephan Druskat is currently offline Stephan DruskatFriend
Messages: 104
Registered: October 2011
Location: Berlin, Germany
Senior Member

Thanks for the clarification!
Previous Topic:Layouting a large number of draw2d widgets in a Canvas
Next Topic:GEF4 double-precision graphics on GEF3-based editor
Goto Forum:
  


Current Time: Tue Apr 16 10:29:21 GMT 2024

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

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

Back to the top