BasicAtomGenerator implements IGenerator<IAtomContainer> { protected boolean canDraw(IAtom atom, IAtomContainer container, RendererModel model) { if (!hasCoordinates(atom)) { return false; } if (invisibleHydrogen(atom, model)) { return false; } if (invisibleCarbon(atom, container, model)) { return false; } return true; } BasicAtomGenerator(); @Override IRenderingElement generate(IAtomContainer container, RendererModel model); IRenderingElement generate(IAtomContainer atomContainer, IAtom atom, RendererModel model); IRenderingElement generateCompactElement(IAtom atom, RendererModel model); AtomSymbolElement generateElement(IAtom atom, int alignment, RendererModel model); @Override List<IGeneratorParameter<?>> getParameters();  }
@Test public void canDrawTest() { IAtom drawableCAtom = super.builder.newInstance(IAtom.class, "C"); drawableCAtom.setPoint2d(new Point2d(0, 0)); IAtom drawableHAtom = super.builder.newInstance(IAtom.class, "H"); drawableHAtom.setPoint2d(new Point2d(0, 0)); IAtomContainer dummyContainer = super.builder.newInstance(IAtomContainer.class); model.set(KekuleStructure.class, true); model.set(ShowExplicitHydrogens.class, true); Assert.assertTrue(generator.canDraw(drawableCAtom, dummyContainer, model)); Assert.assertTrue(generator.canDraw(drawableHAtom, dummyContainer, model)); }