public static Rectangle2D calculateBounds ( IChemModel chemModel ) { IAtomContainerSet moleculeSet = chemModel . getMoleculeSet ( ) ; IReactionSet reactionSet = chemModel . getReactionSet ( ) ; Rectangle2D totalBounds = new Rectangle2D . Double ( ) ; if ( moleculeSet != null ) { totalBounds = totalBounds . createUnion ( calculateBounds ( moleculeSet ) ) ; } if ( reactionSet != null ) { totalBounds = totalBounds . createUnion ( calculateBounds ( reactionSet ) ) ; } return totalBounds ; }
Calculate the bounding rectangle for a chem model .