/** * Notifies MapBoundsListeners about a change to the bounds or crs. * * @param event The event to be fired */ protected void fireMapBoundsListenerMapBoundsChanged( Type type, ReferencedEnvelope oldBounds, ReferencedEnvelope newBounds) { if (boundsListeners == null) { return; } if (newBounds == bounds) { // issue a copy to the boundsListeners for safety newBounds = new ReferencedEnvelope(bounds); } MapBoundsEvent event = new MapBoundsEvent(this, type, oldBounds, newBounds); for (MapBoundsListener boundsListener : boundsListeners) { try { boundsListener.mapBoundsChanged(event); } catch (Throwable t) { if (LOGGER.isLoggable(Level.FINER)) { LOGGER.logp( Level.FINE, boundsListener.getClass().getName(), "mapBoundsChanged", t.getLocalizedMessage(), t); } } } }