private void calculateWindowProportions(final int slots){
  int width=(int)Math.sqrt(slots);
  while (slots % width != 0) {
    width--;
    if (width <= 0) {
      logger.error("Failed to decide dimensions for slot window. slots = " + slots);
      width=1;
    }
  }
  slotWindowWidth=width;
  slotWindowHeight=slots / width;
}

private void calculateWindowProportions ( final int slots ) { int width = ( int ) Math . sqrt ( slots ) ; while ( slots % width != 0 ) { width -- ; if ( width <= 0 ) { logger . error ( "Failed to decide dimensions for slot window. slots = " + slots ) ; width = 1 ; } } slotWindowWidth = width ; slotWindowHeight = slots / width ; }
find out dimensions for a somewhat square slot window .
