Our current JGo application consists of homogenous nodes on a view and multiple links between them.
We’re trying to implement an algorithm where nodes within a certain radius of the center of the view are given a certain size (eg: ‘n’) and nodes that are further away are given progressively smaller sizes.
I finally worked out the best way to resize the nodes (node.setBoundingRect()) however i am having a couple of problems.
We have several sub-objects of our node including a JGoText object and a couple of JGoPort objects. These objects are added to the node via the addObjectAtTail() method and are then located using the setSpotLocation() method
Unfortunately when we call setBoundingRect() to change the size of these nodes, the location of some objects is not preserved. For example, with the text node that we add, we call;
text.setSpotLocation( JGoObject.Center, node, JGoObject.Bottom)
which means to anchor the text to the bottom of the node (as far as i understand)
When we then all setBoundingRect(), and increase the size of the node, the text seems to be in the same position as it was previously (which is now towards the center of the node) instead of shifting back down to the bottom of the node.
Is there a way that we can control this behaviour?
For bonus points, can you tell me if/how it will be possible to do rescaling while the user is dragging a node with the mouse? Eg: user drags node towards the center of the view. node should get bigger as we move it closer.