public void stopListening() {
if (config != null) {
Config2DModel config2DModel = (Config2DModel) config;
config2DModel.removeListener(listenerConfig2D);
Dimension2DYModel dimension2DYModel = (Dimension2DYModel) config2DModel.getDimensionY();
dimension2DYModel.removeListener(listenerDimension2DY);
for (IActuator actuator : dimension2DYModel.getActuatorsList()) {
((ActuatorModel) actuator).removeListener(listenerActuator);
}
for (IRange2DY range2DY : dimension2DYModel.getRangesList()) {
((Range2DYModel) range2DY).removeListener(listenerRange2DY);
for (ITrajectory trajectory : range2DY.getTrajectoriesList()) {
((Trajectory2DYModel) trajectory).removeListener(listenerTrajectory2DY);
}
}