Auto layouting not linked nodes

Hi,

we are using the auto layout mecahnism with the following code.

// auto layout
JGoLayeredDigraphAutoLayout layout = new JGoLayeredDigraphAutoLayout(oJGoDocument); layout.setDirectionOption(JGoLayeredDigraphAutoLayout.LD_DIRECTION_DOWN); layout.setPackOption(JGoLayeredDigraphAutoLayout.LD_PACK_MEDIAN);
// set space between objects
layout.setLayerSpacing(LAYER_SPACING);
layout.performLayout();

We have some problems with the auto layout of nodes which are not linked.
These nodes will be moved to down right.
This happens also with labels which has no links.

Is there a possibilty to change the autolayout behaviour of this unlinked nodes?

Try setting the following:

layout.setLayeringOption(JGoLayeredDigraphAutoLayout.LD_LAYERING_LONGESTPATHSOURCE);

Thanks.

It looks much better. Smile

Another question, is it possible to set something like a title (node) to a graph?

We just tried it with a simple JGoTextNode, but this node will be also moved with auto layering.

Rather than laying out all the nodes in the document, you can layout just the nodes you want. Call the JGoLayeredDigraphAutoLayout constructor with a JGoNetwork rather than the JGoDocument. You can put whatever nodes you want in the JGoNetwork (see addNode and deleteNode methods).

Perform the layout, then layout any additional nodes yourself just by assigning them new locations.

Thanks a lot.
It works perfectly like we want it. Smile