I'm trying to extend the Shape example so there can be Connections
connecting Connections. This is what I did so far:
- Pulled up Connection handling stuff from Shape to a new Class
"ConnectableElements". Both, Shape and Connection extend this class
- Adapted ConnectionCreateCommand to take ConnectableElements instead of
only Shapes
- In ConnectionEditPart I'm installing a GraphicalNodeEditPolicy under
the EditPolicy.GRAPHICAL_NODE_ROLE which I copied from ShapeEditPart
- I wrote a custom ConnectionAnchor which returns the midpoint of a
PolylineConnection as Location
Now I have a similar problem like Brian Fernandez in the "Connecting
connections to connections ..." thread: As soon as I try to connect a
Connection the tool ends up in an endless loop calling getLocation()
from my CustomConnectionAnchor. If I use an XYAnchor instead, the
endless loop vanishes (But the resulting connection's display is useless
because start/end points are always at the same place, of course).
Unfortunately, I don't understand what he did to solve the problem. Can
anybody help me? I attached my extended Shapes example for reference.