private static void hideMultipleParts(IAtomContainer container, Sgroup sgroup) {

        final Set<IBond> crossing = sgroup.getBonds();
        final Set<IAtom> atoms = sgroup.getAtoms();
        final Set<IAtom> parentAtoms = sgroup.getValue(SgroupKey.CtabParentAtomList);

        for (IBond bond : container.bonds()) {
            if (parentAtoms.contains(bond.getBegin()) && parentAtoms.contains(bond.getEnd()))
                continue;
            if (atoms.contains(bond.getBegin()) || atoms.contains(bond.getEnd()))
                StandardGenerator.hide(bond);
        }
        for (IAtom atom : atoms) {
            if (!parentAtoms.contains(atom))
                StandardGenerator.hide(atom);
        }
        for (IBond bond : crossing) {
            StandardGenerator.unhide(bond);
        }
    }
private static void hideMultipleParts ( IAtomContainer container , Sgroup sgroup ) { final Set < IBond > crossing = sgroup . getBonds ( ) ; final Set < IAtom > atoms = sgroup . getAtoms ( ) ; final Set < IAtom > parentAtoms = sgroup . getValue ( SgroupKey . CtabParentAtomList ) ; for ( IBond bond : container . bonds ( ) ) { if ( parentAtoms . contains ( bond . getBegin ( ) ) && parentAtoms . contains ( bond . getEnd ( ) ) ) continue ; if ( atoms . contains ( bond . getBegin ( ) ) || atoms . contains ( bond . getEnd ( ) ) ) StandardGenerator . hide ( bond ) ; } for ( IAtom atom : atoms ) { if ( ! parentAtoms . contains ( atom ) ) StandardGenerator . hide ( atom ) ; } for ( IBond bond : crossing ) { StandardGenerator . unhide ( bond ) ; } }
Hide the repeated atoms and bonds of a multiple group. We hide al atoms that
belong to the group unless they are defined in the parent atom list. Any
bond to those atoms that is not a crossing bond or one connecting atoms in
the parent list is hidden.

@param container molecule
@param sgroup    multiple group display shortcut