code: public Dimension getPreferredSize() {
          final int numberOfColumns = this.cellGrid.getNumberOfColumns();
          final int numberOfRows = this.cellGrid.getNumberOfRows();
          return new Dimension( this.cellSize * numberOfColumns,
                                this.cellSize * numberOfRows );
      }
docs: This is the preferred size.
  
  @see java.awt.Component#getPreferredSize()