Disconnected graph problem

I am using the SWT version of JGo. I have a situation in which I am graphing related nodes (of course) on a graph. There are times when I am graphing more than one node cluster (cluster = group of related nodes). In many cases, the node clusters do not relate to the other clusters. So far, so good. The problem which I am having is this: when I layout the graph, the unrelated node clusters are spread very far apart. So far apart that initially I did not think that I had graphed the second or third clusters. Is there a way to achieve a tighter grouping of the unrelated node clusters during the layout?

The layout code I am using is as follows:
JGoForceDirectedAutoLayout l = new JGoForceDirectedAutoLayout(mJGoDocument);
l.performLayout();
I am sure I will need to expand beyond this simple code. I am new to JGo but I must say, I am loving thus far.

Yes, you can override getElectricalFieldX and getElectricalFieldY to create an electrical “force field” around the desired borders of your diagram. The JGo Layout User Guide describes this in Chapter 5 “Advanced Options”. Page 36 has some sample code for constraining the nodes to a particular rectangle.

That worked perfectly, thank you very much for the information.