public boolean leavesZone(final Rectangle2D shape){
  final double x=shape.getX();
  final double y=shape.getY();
  final double w=shape.getWidth();
  final double h=shape.getHeight();
  return (x < 0) || (x + w > width) || (y < 0)|| (y + h > height);
}

public boolean leavesZone ( final Rectangle2D shape ) { final double x = shape . getX ( ) ; final double y = shape . getY ( ) ; final double w = shape . getWidth ( ) ; final double h = shape . getHeight ( ) ; return ( x < 0 ) || ( x + w > width ) || ( y < 0 ) || ( y + h > height ) ; }
check if a rectangle is at least partially outside the map .
