class TemplateHandler {

    public void addMolecule(IAtomContainer molecule) {
        if (!GeometryUtil.has2DCoordinates(molecule))
            throw new IllegalArgumentException("Template did not have 2D coordinates");

        // we want a consistent scale!
        GeometryUtil.scaleMolecule(molecule, GeometryUtil.getScaleFactor(molecule,
                                                                         StructureDiagramGenerator.DEFAULT_BOND_LENGTH));

        templates.add(molecule);
        anonPatterns.add(VentoFoggia.findSubstructure(molecule,
                                                      anonAtomMatcher,
                                                      anonBondMatcher));
        elemPatterns.add(VentoFoggia.findSubstructure(molecule,
                                                      elemAtomMatcher,
                                                      anonBondMatcher));
    }

    public  TemplateHandler(IChemObjectBuilder builder);
    public  TemplateHandler();

}