package edu.unl.consystlab.sudokuSolver;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

public class fileLoadHandler implements ActionListener{

	private sudokuInterface parentInterface;
	
	public fileLoadHandler(sudokuInterface new_interface)
	{
		parentInterface = new_interface;
	}
	
	public void actionPerformed(ActionEvent e) {
		
		String actionCode = e.getActionCommand();
		
		if (actionCode.equals("http://consystlab.unl.edu/SudokuLibrary/FromFiles/Basic/GRoyle17min.txt")) {
			parentInterface.displayLineOfFile("http://consystlab.unl.edu/SudokuLibrary/FromFiles/Basic/GRoyle17min.txt");
		} else if (actionCode.equals("http://consystlab.unl.edu/SudokuLibrary/FromFiles/Basic/Stertenbrink+Meyrignac-Top100.txt")){
			parentInterface.displayLineOfFile("http://consystlab.unl.edu/SudokuLibrary/FromFiles/Basic/Stertenbrink+Meyrignac-Top100.txt");			
		} else if (actionCode.equals("http://consystlab.unl.edu/SudokuLibrary/FromFiles/Basic/VegardHanssen_3")){
			parentInterface.displayFileTypeTwo("http://consystlab.unl.edu/SudokuLibrary/FromFiles/Basic/VegardHanssen/3x3_3.");			
		} else if (actionCode.equals("http://consystlab.unl.edu/SudokuLibrary/FromFiles/Basic/VegardHanssen_4")){
			parentInterface.displayFileTypeTwo("http://consystlab.unl.edu/SudokuLibrary/FromFiles/Basic/VegardHanssen/3x3_4.");			
		} else if (actionCode.equals("http://consystlab.unl.edu/SudokuLibrary/FromFiles/Basic/VegardHanssen_5")){
			parentInterface.displayFileTypeTwo("http://consystlab.unl.edu/SudokuLibrary/FromFiles/Basic/VegardHanssen/3x3_5.");			
		} else if (actionCode.equals("http://consystlab.unl.edu/SudokuLibrary/FromFiles/Basic/VegardHanssen_6")){
			parentInterface.displayFileTypeTwo("http://consystlab.unl.edu/SudokuLibrary/FromFiles/Basic/VegardHanssen/3x3_6.");			
		} else if (actionCode.equals("http://consystlab.unl.edu/SudokuLibrary/FromFiles/Basic/VegardHanssen_7")){
			parentInterface.displayFileTypeTwo("http://consystlab.unl.edu/SudokuLibrary/FromFiles/Basic/VegardHanssen/3x3_7.");			
		} else if (actionCode.equals("http://consystlab.unl.edu/SudokuLibrary/FromFiles/Basic/VegardHanssen_8")){
			parentInterface.displayFileTypeTwo("http://consystlab.unl.edu/SudokuLibrary/FromFiles/Basic/VegardHanssen/3x3_8.");			
		} else {
			parentInterface.loadNewProblem(actionCode);
		}		
	}
	
}
