The nodes size appear to be modified after applying a graph layout algorithm

Article ID: 2188
Last updated: 28 May, 2018
Article ID: 2188
Last updated: 28 May, 2018
Revision: 3
Views: 694
Posted: 18 Feb, 2010
by Dean J.
Updated: 28 May, 2018
by Gargani A.

Question

How to avoid the node's size from changing after applying a graph layout algorithm?

Answer

JViews layout algorithms never modify the size (width and height) of the nodes. If the node size **appears** to be changed after a layout, this is only because in the demo, or in Composer, there is a change of the transformer after the layout. Typically, after the layout the application may want to perform a "fit to view" to make the entire graph visible.

To get unmodified node sizes after layout, simple removing the code lines that change the transformer (typically, managerView.fitTransformerToContent()), or deselect the option in Composer (see menu Tools -> Options -> Graph Layout -> Fit to view after layout).

This article was:   Helpful | Not helpful
Report an issue
Article ID: 2188
Last updated: 28 May, 2018
Revision: 3
Views: 694
Posted: 18 Feb, 2010 by Dean J.
Updated: 28 May, 2018 by Gargani A.
Also listed in


Others in this category