|Layout Role for connection childs [message #716804]
||Thu, 18 August 2011 13:54
| Alexandre Torres
Registered: July 2009
Hi, I'm somewhat a beginner on GEF.|
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.
Powered by FUDForum
. Page generated in 0.04300 seconds