javajgraphx

Edges don't allow me to choose exact points in source or target [mxgraph]


Good morning,

I'm developing a tool for modelling graphs and I don't see how an edge can be painted choosing both terminal points. If I have an elbow, I can define where one of the terminal points will be but the other terminal point may or not be precise depending on the location of the arrows. Let me try to explain it with images:

In this first image, I can move the elbow enough so that the terminal point of the target of the edge can be placed where I want. However, the source terminal point cannot be defined and it will always be stacked at vertical centre of the block

First image

If I want to precisely define the terminal point of the source block, then I loose precision in the target terminal point: image

Second image

I have tried to figure it out how to make possible to configure both terminal points precisely. However I haven't managed to do it. I have been looking for the possibility of having two elbows, which would allow me to define both terminal points, but I haven't seen how to do it. Additionally, I've tried to find a way to move terminal points but I haven't succeed.

Thanks!


Solution

  • After a deep investigation I have arrived to the idea of modifying the exitX, exitY, entryX and entryY of the style of the edges. By modifying them, the terminal points of the edge can be placed wherever you want in the blocks. Unfortunately, I have had to create a dialog to allow the user to define these parameters as these points cannot be directly dragged when selected. Not very elegant but functional, hoping not many people would want to customise edges at this level.