package pbl2011.gui;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import pbl2011.common.CommonConst;

/**
 * 詳細編集画面コントローラクラス
 * <p>
 *
 * @author 10745104 Y.Ishii
 *
 */
public class ParameterController implements ActionListener, CommonConst {

	private ParameterEditor parameterEditor;

	public ParameterController(ParameterEditor v) {
		this.parameterEditor = (ParameterEditor) v;
	}

	@Override
	public void actionPerformed(ActionEvent e) {
		String cmd = e.getActionCommand();

		if (ADD.equals(cmd)) {
			parameterEditor.addModel();

		} else if (DELETE.equals(cmd)) {
			parameterEditor.deleteModel();

		} else if (UP.equals(cmd)) {
			parameterEditor.up();

		} else if (DOWN.equals(cmd)) {
			parameterEditor.down();
		}
	}
}
