| [news.eclipse.tools.gef] Re: Connecting connections in the Shape example |
Thanks for pointing out the problem with the coordinates, Steve!
Meanwhile, I finally found and solved the problem.
Best regards Adrian
One thing I noticed is that you're not returning the point in absolute coordinates. The points in the polyline connection are in relative coordinates. Anchors always operate in absolute coordinates. You need to make a call to:
getOwner().translateToAbsolute(midpoint); return midpoint;
-Steve
"Adrian Gygax" <adrian.gygax@xxxxxxx> wrote in message news:du49el$6cg$1@xxxxxxxxxxxxxxxxxxxxHi!
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.
Best regards, Adrian
Attachment:
ConnectingConnectionsShapesExampleWorking.zip
Description: Zip compressed data