/** Deactivate the listeners. */ private void deleteLayersModelRootNotifier() { /** * Listen on layersModel to be inform when the application object is created. When it is * created, we can listen on it. */ if (layersModelEventRootNotifier != null) { layersModelEventRootNotifier.removeEventListener( layersStackApplicationLifeCycleEventListener); layersModelEventRootNotifier.dispose(); layersModelEventRootNotifier = null; } }
/** Activate the listeners. */ private void createLayersModelRootNotifier() { /** * Listen on layersModel to be inform when the application object is created. When it is * created, we can listen on it. */ layersModelEventRootNotifier = new LayersModelEventRootNotifier(layersModel); layersModelEventRootNotifier.addEventListener(layersStackApplicationLifeCycleEventListener); }
/** * Remove the specified listener from the list of listeners. * * @param listener */ public void removeLayersStackApplicationLifeCycleEventListener( ILayersModelRootEventListener listener) { layersModelEventRootNotifier.removeEventListener(listener); }
/** * Add the specified listener to the list of listener. Do not add it if the listener is already in * the list. * * @param listener */ public void addLayersStackApplicationLifeCycleEventListener( ILayersModelRootEventListener listener) { // Add to the inner notifier layersModelEventRootNotifier.addEventListener(listener); }