I want to able to use an edge to connect a vertex and another edge (which is connecting two other vertices). I want to change the code accordingly so that I will be able to do this connection from the user interface (just like you do for two vertices).
To illustrate what I am after: I want to get the green square from the tip of the arrow to turn blue (just like the one at its bottom), suggesting that a connection was established.
Screenshot of JgraphX situation
I have checked the documentation and the code related to the creation of connections and valid terminals, but I could not implement the behaviour I need, which is the ability to set an edge as a valid terminal/a valid target in a connection. Any help would be greatly appreciated.
I am not sure if this is where I should look (mxGraph.java class) when trying to make an edge a valid target/source.
public boolean isValidSource(Object cell)
{
return (cell == null && allowDanglingEdges)
|| (cell != null
&& (!model.isEdge(cell) || isConnectableEdges()) && isCellConnectable(cell));
}
UPDATE: I was able to connect two edges in code, using the insertEdge method of the graph. However, I still struggle with achieving this behaviour in the user interface.