code: public static Window adaptActiveRegionToEnvelope( Envelope bounds, Window activeRegion ) {
          Point2D eastNorth = Window.snapToNextHigherInActiveRegionResolution(bounds.getMaxX(), bounds.getMaxY(), activeRegion);
          Point2D westsouth = Window.snapToNextHigherInActiveRegionResolution(bounds.getMinX() - activeRegion.getWEResolution(),
                  bounds.getMinY() - activeRegion.getNSResolution(), activeRegion);
          Window tmp = new Window(westsouth.getX(), eastNorth.getX(), westsouth.getY(), eastNorth.getY(),
                  activeRegion.getWEResolution(), activeRegion.getNSResolution());
          // activeRegion.setExtent(tmp);
          return tmp;
      }
docs: Takes an envelope and an active region and creates a new region to match the bounds of the
  envelope, but the resolutions of the active region. This is important if the region has to
  match some feature layer. The bounds are assured to contain completely the envelope.
  
  @param bounds
  @param activeRegion