package pbl2011.gui;

import java.awt.event.ActionEvent;
import java.awt.event.MouseEvent;

import pbl2011.mvc.Controller;
import pbl2011.mvc.View;

/**
 * 詳細編集画面コントローラクラス
 * <p>
 *
 * @author 10745104 Y.Ishii
 *
 */
public class ClassDetailController extends Controller {

	private ClassDetailEditor detailView;

	public ClassDetailController(View v) {
		super(v);
		detailView = (ClassDetailEditor) v;
	}

	@Override
	public void update() {
	}

	@Override
	public void actionPerformed(ActionEvent e) {
		String cmd = e.getActionCommand();
		if (detailView.clone == null)
			return;

		if (UPDATE.equals(cmd)) {
			detailView.updateDetail();
		} else {

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

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

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

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

			}
		}
	}

	@Override
	public void mouseDragged(MouseEvent e) {
	}

	@Override
	public void mouseMoved(MouseEvent e) {
	}

}
