I've been doing experimental work on layouts for the CDK. Not for atoms, exactly, for which the StructureDiagramGenerator is doing a pretty good job - could be better, of course, but what couldn't?
No, layout of MoleculeSets, and Reactions. Well actually IMoleculeSets and IReactions. With an ILayout class - my apologies to anyone who doesn't like generics, but it can be quite useful. Anyway, here is an example of what it is looking like at the moment:
Hmmm. Well, it is a grid I suppose. The problems with the ring bonds are known to me, please do not mention them >:|
The code for this is quite short:
IMoleculeSet moleculeSet = makeMolSet();where the methods 'makeMolSet' and 'makeImage' do what you might expect (I hope :). Similarly:
ILayout<IMoleculeSet> gridLayout = new GridMoleculeSetLayout(3, 3);
makeImage(moleculeSet, gridLayout, "three_by_three", 500, 500);
IMoleculeSet molSet = makeMolSet();and this produces an image like this:
AxisOrientation o = AxisOrientation.PLUS_X_PLUS_Y;
ILayout<IMoleculeSet> layout = new LinearMoleculeSetLayout(new StandardMoleculeLayout(), 3, o);
makeImage(molSet, layout, "xypos", 500, 500);
Comments