09-06-2007, 11:43 AM
Hello prefusians,
I have a node positioning issue with the attachted program, which implements a dynamically growing graph.
In this program a new set of nodes is always connected to one random node of the existing graph. The idea is to set the new nodes close to the node they are connected with in order to make the graph unfolding nice. The position of the new nodes is set with
where aNodeItem is the newly added node item and connectorX and connectorY are the position of the connecting node.
This works fine most of the time but when the graph grows during the course of the program sometimes this position setting doesn't seem to have any effect, nodes are placed far from the connecting node. Also the prefuse ActicvityManager is complaining sometimes.
Any suggestions how to deal with this problem are highly appreciated.
Thanks
martin
You might have to play around with the two variables
to see the undesired effect.
I have a node positioning issue with the attachted program, which implements a dynamically growing graph.
In this program a new set of nodes is always connected to one random node of the existing graph. The idea is to set the new nodes close to the node they are connected with in order to make the graph unfolding nice. The position of the new nodes is set with
Code:
PrefuseLib.setX(aNodeItem,null,connectorX);
PrefuseLib.setY(aNodeItem,null,connectorY);This works fine most of the time but when the graph grows during the course of the program sometimes this position setting doesn't seem to have any effect, nodes are placed far from the connecting node. Also the prefuse ActicvityManager is complaining sometimes.
Any suggestions how to deal with this problem are highly appreciated.
Thanks
martin
You might have to play around with the two variables
Code:
public static final int NODES_PER_ROUND = 17;
public static final int MILISEC_BETWEEN_ROUNDS = 500;