Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community ForumsLayout Role for connection childs
https://www.eclipse.org/forums/index.php/mv/msg/235636/716804/#msg_716804
I'm trying to add labels to a connection, but instead of fixed labels such as on several examples, we need labels that can be moved around.
I tried to add a Layout_Role to my connection edit part, a subclass of ConstrainedLayoutEditPolicy able to deal with Locatoes constraints. The problem is that the diagram edit part (the parent) defines an XYLayoutPolicy, based on Rectangle constraints, that are fine to most of my nodes, but not for the children of connection (locator based).
I expected to had my layout handled by the connection editpolicy, but by some reason that I can't figure out, the layout is handled by the diagram layout role. It gives me an exception trying to cast locator to rectangle constraint.
So... does it make sense to give a Layout Role to a connection edit part ? or it will be ignored ?
And what would be the best solution to this design ? is there an example somewhere ? are connection parts supposed to have children (I could refactor to make labels children of the diagram, but that would be complicated, since its default position is near its parent connection... the position is relative to the midpoint).
Thanks in advance.
GEF is really powerfull. But it is still a bit complicated to learn.
]]>Alexandre Torres2011-08-18T13:54:51-00:00Re: Layout Role for connection childs
https://www.eclipse.org/forums/index.php/mv/msg/235636/716853/#msg_716853
If someone has any sugestion (maybe this kind of loyout policy was already developed somewhere) , it would be welcome.