@SuppressWarnings("unchecked")
	@Override
	public void actionPerformed(ActionEvent e) {
		TMSettingContainer sc = source.getSetting();
		switch (e.getActionCommand()) {
		case "Color":
			Color selectedColor = JColorChooser.showDialog(source, "Pick a Color"
	                , source.colorButton.getForeground());
			source.colorButton.setForeground(selectedColor);
		case "MapComboBox":
			// Checked, but java... ._.
			sc.setMap((String) ((JComboBox<String>) e.getSource())
					.getSelectedItem());
			break;
		case "percetCheckBox":
		case "logCheckBox":
				int norm = (source.checkBox.isSelected()?1:0) + (source.chckbxUseLogarithm.isSelected()?2:0);
				sc.setNorm(norm);
			break;
		case "GoButton":
			sc.setFactor((double) source.spinner.getValue()); 
			sc.setColor(source.colorButton.getForeground());
			source.setVisible(false);
			break;
		case "Cancel":
			sc = null;
			source.setVisible(false);
			break;
		default:
			break;
		}
		source.setSetting(sc);
	}