|
|
|
|
|
Re: Connections over Nodes Zest [message #923000 is a reply to message #897559] |
Tue, 25 September 2012 10:26  |
Eclipse User |
|
|
|
I've found a solution.
I had to resort the Figures in a Layer. (Connections and Nodes are in the same Layer)
I added the following functions in my LayoutAlgrithm:
private void sortLayer()
{
GraphConnection gctmp = (GraphConnection)relationships[0].getLayoutRelationship().getGraphData();
Graph graph = gctmp.getGraphModel();
ZestRootLayer tst = (ZestRootLayer)graph.getRootLayer().getChildren().get(0);
Collections.sort(tst.getChildren(), new Comparator<Object>() {
@Override
public int compare(Object o1, Object o2) {
return getNodeWeight(o2) - getNodeWeight(o1);
}
});
}
The getNodeWeight() method looks like this atm. (short version):
//Weight in Layer. low weight-> show on top
private int getNodeWeight(Object oj)
{
int weight = 100;
if(oj instanceof PolylineConnection)
weight = 1;
else
{
}
return weight;
}
the 'sortLayer()' method is used after the Layout was computed and when a Node is selected.
Hope this will help someone else
Closed.
|
|
|
Powered by
FUDForum. Page generated in 0.21166 seconds