use of org.openscience.cdk.renderer.generators.standard.StandardGenerator in project ambit-mirror by ideaconsult.
the class CDK2DAtomColorsHalogens method createRenderer.
private IRenderer createRenderer(Dimension cellSize, Color background, boolean rings, boolean atomNumbers, boolean explicitH) {
List<IGenerator<IAtomContainer>> generators = new ArrayList<IGenerator<IAtomContainer>>();
Font font = new Font("Arial", Font.PLAIN, 12);
generators.add(new BasicSceneGenerator());
generators.add(new StandardGenerator(font));
/*
*
https://github.com/cdk/cdk/wiki/Standard-Generator
*/
/*
generators.add(new BasicBondGenerator());
generators.add(new SelectBondGenerator());
if (rings)
generators.add(new RingGenerator());
// generators.add(new MyBasicAtomGenerator()); //this was to clean the
// background behind the labels
generators.add(new BasicAtomGenerator());
if (atomNumbers)
generators.add(new AtomLabelGenerator());
generators.add(new ImageMapGenerator());
generators.add(new MySelectAtomGenerator());
generators.add(new AtomAnnotationGenerator());
*/
IRenderer renderer = new AtomContainerRenderer(generators, new AWTFontManager());
RendererModel r2dm = renderer.getRenderer2DModel();
r2dm.set(StandardGenerator.Highlighting.class, StandardGenerator.HighlightStyle.OuterGlow);
/*
RendererModelWrapper.setCompactShape(r2dm,
BasicAtomGenerator.Shape.OVAL);
if (atomNumbers)
RendererModelWrapper.setDrawNumbers(r2dm, atomNumbers);
RendererModelWrapper.setUseAntiAliasing(r2dm, true);
// r2dm.set(paramType, value)
RendererModelWrapper.setBackColor(r2dm, new Color(background.getRed(),
background.getGreen(), background.getBlue(), 128));
RendererModelWrapper.setShowExplicitHydrogens(r2dm, explicitH);
RendererModelWrapper.setShowAromaticity(r2dm, true);
RendererModelWrapper
.setAtomColorer(r2dm, new CDK2DAtomColorsHalogens());
*/
r2dm.set(StandardGenerator.AtomColor.class, new CDK2DAtomColors());
return renderer;
}
Aggregations