|
Re: Recursive Connection [message #1808686 is a reply to message #1807906] |
Fri, 28 June 2019 10:20  |
Eclipse User |
|
|
|
Hi Servan,
in order to implement reflexive relations, you may contribute an implementation for this special case within the corresponding part's doRefreshVisual() method by testing if source and target are identical and supplying the relation visual with control points manually routed around the source/target so that it is fully visible.
Hence, it could look similar to this pseudocode:
public class RelationPart extends AbstractContentPart<RelationVisual> {
protected void doRefreshVisual(RelationVisual visual) {
...
// update control points
if (sourcePart == targetPart) {
// reflexive relation
relationVisual.setControlPoints(determineReflexiveControlPoints(sourcePart));
} else {
// normal control points
}
}
protected List<Point> determineReflexiveControlPoints(NodePart target) {
Bounds bounds = target.getVisual().getBoundsInParent();
// TODO: return list of control points, e.g. Arrays.asLists(bounds.x + 5, bounds.y, ...);
}
...
}
Best regards,
Matthias
|
|
|
Powered by
FUDForum. Page generated in 0.21271 seconds