public void setDimensions(int height, int width) { boolean changed = false; if (this.colony != null) { changed = (this.getHeight() == height && this.getWidth() == width) ? false : true; } this.colony = createColony(height, width); this.nextColony = createColony(height, width); if (changed) { for (GameOfLifeListener listener : this.golListeners) { listener.colonyDimensionsChanged(height, width); } } }