/*
 * Created on 25.03.2004 21:18:55
 *
 * Multimediale Algorithmen und Datenstrukturen Assessments
 */
package mauda.feedback.select;

import java.util.Vector;
import mauda.ExerciseMode;
/**
 * Selector for chosing a specific exercise-mode
 * 
 * @author Markus Krebs
 */
public class ModeSelector extends Selector {

	private Vector modesID;
	/**
	 * Creates a Mode-Selector
	 */
	public ModeSelector() {
		super();

		modesID = new Vector();

		Vector v = new Vector();
		modesID.add(new Integer(ExerciseMode.NORMAL));
		v.add(ExerciseMode.getString(ExerciseMode.NORMAL));
		modesID.add(new Integer(ExerciseMode.FAULT));
		v.add(ExerciseMode.getString(ExerciseMode.FAULT));
		
		setTitle("Mode:");
		createView(v);
	}
	/**
	 * Gets the selected mode
	 * @return mode-ID
	 * @see mauda.ExerciseMode
	 */
	public int getMode() {
		int a = getSelectedIndex();
		return ((Integer)modesID.elementAt(a)).intValue();
	}

}
