private void setLightSource() {
		if (model.getLightSource().isOn()) {
			ModelerUtilities.selectWithoutNotifyingListeners(lightSwitch, true);
			boolean b1 = model.getLightSource().isMonochromatic();
			ModelerUtilities.selectWithoutNotifyingListeners(monochromaticButton, b1);
			ModelerUtilities.selectWithoutNotifyingListeners(whiteButton, !b1);
			int nray = model.getLightSource().getNumberOfBeams();
			boolean b2 = model.getLightSource().isSingleBeam(); // backward compatible
			if (b2)
				nray = 1;
			nraySlider.setValue(nray);
			enableEditor(true);
			frequencySlider.setEnabled(b1);
			setupFrequencySlider(model);
			intensitySlider.setValue(intensitySlider.getMaximum() + 1 - model.getLightSource().getRadiationPeriod()
					/ 100);
			switch (model.getLightSource().getDirection()) {
			case LightSource.WEST:
				ModelerUtilities.selectWithoutNotifyingListeners(westButton, true);
				break;
			case LightSource.EAST:
				ModelerUtilities.selectWithoutNotifyingListeners(eastButton, true);
				break;
			case LightSource.NORTH:
				ModelerUtilities.selectWithoutNotifyingListeners(northButton, true);
				break;
			case LightSource.SOUTH:
				ModelerUtilities.selectWithoutNotifyingListeners(southButton, true);
				break;
			case LightSource.OTHER:
				ModelerUtilities.selectWithoutNotifyingListeners(otherButton, true);
				angleField.setValue((int) Math.round(Math.toDegrees(model.getLightSource().getAngleOfIncidence())));
				directionPanel.add(angleField);
				directionPanel.add(degreeLabel);
				directionPanel.validate();
				directionPanel.repaint();
				break;
			}
		}
		else {
			ModelerUtilities.selectWithoutNotifyingListeners(lightSwitch, false);
			enableEditor(false);
		}
	}