Thanks for the info. So the scale does indeed account for different model coordinates… but that seems to be taken in to account by the transform. I think it should be possible to leave the scale out of the generator/draw visitor but still account for different coordinate systems.
transform.scale(1,-1); // Converts between CDK Y-up & Java2D Y-down coordinate-systems // I wondered why my text was upside down to begin with!
transform.scale(scale, scale); // considers model different coordinate systems (i.e. normalise to 1.5 Angstroms).
I’m thinking from your comments the BoundsElement is the simplest and safest solution.
Yes text is a problem. Better bounds calculations help (TextLayout instead of FontMetrics) but as you say one solution is two pass rendering. An alternative is putting the bond and atom generation in the same generator :-). This loses modularity but it eliminates the need for cross-talk and is expandable if three passes are needed (minimise label congestion).