This line in FRLayout are in setSize
if(initialized == false) {
setInitializer(new RandomLocationTransformer<V>(size));
}
and if setSize is called a second time - for example when resizing a window - the initialiser is never reset.
WORKAROUND:
1. always reset the initialiser after a setSize
or
2. subclass FRLayout (and other Layouts like it) so that setSize will reset the initialiser every time
View and moderate all "bugs Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Bugs"
Argh - these workarounds are dubious because setInitializer() is doing a whole load of extra stuff, like resetting this.locations. A fuller workaround will also involve overriding setInitializer and might be more effort than it is worth.
View and moderate all "bugs Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Bugs"
Sorry, I should explain why this is an issue: let's say a Layout is created to display a Graph and the user can add/remove vertices and manipulate their locations on the screen. If the user resizes the window and then adds some vertices - the newly added vertices will appear initialized within the original window bounds. Hopefully the implementation of the layout (far below AbstractLayout) will be able to do something intelligent with the locations. (But then what is the point of having the random initialiser to begin with? The definition of this.locations is essentially defining an initialiser anyway)
As a general comment on the Layout code - it feels like a lot of funky stuff is happening with all the setX methods. It would result in much cleaner code if all this lazy initialisation was stripped out and the getters/setters were simple. I'm not entirely convinced that any great CPU optimisations are happening, but it is making the code very hard to understand. Also, no parameter constructions would be lovely! :-)
View and moderate all "bugs Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Bugs"
sorry, small reflection mistake, the code in that part should be
Field max_dim_field = FRLayout.class.getDeclaredField("max_dimension");
max_dim_field.setAccessible(true);
View and moderate all "bugs Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Bugs"
oops, wrong issue!