package nl.joshuaslik.tudelft.SEM.control;

import java.io.IOException;

import nl.joshuaslik.tudelft.SEM.Launcher;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.fxml.FXMLLoader;
import javafx.scene.Scene;
import javafx.scene.layout.Pane;
import javafx.stage.Stage;
import javafx.scene.control.Button;

public class ChooseLevelController {

	@FXML
	private static Pane pane;
	
	@FXML
	private Button level1Button, level2Button, level3Button, level4Button, level5Button, mainMenuButton;
	
	/**
	 * Starts the Game GUI scene.
	 * @param stage the current stage
	 * @throws IOException thrown when FXML is not parsed
	 */
	public static void start(Stage stage) throws IOException {
		FXMLLoader loader = new FXMLLoader();
		loader.setLocation(Class.class.getResource("/data/gui/pages/ChooseLevel.fxml"));
		pane = loader.load();
		Launcher.getBorderPane().setCenter(pane);
	}
	
	/**
	 * Handles clicking of the Level 1 button
	 * @param event the click of the button
	 * @throws IOException thrown when FXML file could not be parsed
	 */
	@FXML
	protected void handleLevel1Button(ActionEvent event) throws IOException {
		System.out.println("Level 1 button pressed!");
		//Stage stage = (Stage) level1Button.getScene().getWindow();
		
	}
	/**
	 * Handles clicking of the Level 2 button
	 * @param event the click of the button
	 * @throws IOException thrown when FXML file could not be parsed
	 */
	@FXML
	protected void handleLevel2Button(ActionEvent event) throws IOException {
		System.out.println("Level 2 button pressed!");
		//Stage stage = (Stage) level2Button.getScene().getWindow();
		
	}
	
	/**
	 * Handles clicking of the Level 3 button
	 * @param event the click of the button
	 * @throws IOException thrown when FXML file could not be parsed
	 */
	@FXML
	protected void handleLevel3Button(ActionEvent event) throws IOException {
		System.out.println("Level 3 button pressed!");
		//Stage stage = (Stage) level3Button.getScene().getWindow();
		
	}
	
	/**
	 * Handles clicking of the Level 4 button
	 * @param event the click of the button
	 * @throws IOException thrown when FXML file could not be parsed
	 */
	@FXML
	protected void handleLevel4Button(ActionEvent event) throws IOException {
		System.out.println("Level 4 button pressed!");
		//Stage stage = (Stage) level4Button.getScene().getWindow();
		
	}
	
	/**
	 * Handles clicking of the Level 5 button
	 * @param event the click of the button
	 * @throws IOException thrown when FXML file could not be parsed
	 */
	@FXML
	protected void handleLevel5Button(ActionEvent event) throws IOException {
		System.out.println("Level 5 button pressed!");
		//Stage stage = (Stage) level5Button.getScene().getWindow();
	}
	
	/**
	 * Handles clicking of the main menu button
	 * @param event the click of the button
	 * @throws IOException thrown when FXML file could not be parsed
	 */
	@FXML
	protected void handleMainMenuButton(ActionEvent event) throws IOException {
		System.out.println("Main Menu button pressed!");
		Stage stage = (Stage) mainMenuButton.getScene().getWindow();
		MainMenuController.start(stage);
	}
}

@@ -395,32 +395,115 @@
  pane;%0A%09%0A%09@FXML%0A
+%09private Button playButton, chooseLevelButton, optionsButton, quitButton;%0A%09%0A%09@FXML%0A
 %09private Button 
@@ -3180,10 +3180,1503 @@
 ge);%0A%09%7D%0A
+%09%0A%09/**%0A%09 * Handles clicking of the start button%0A%09 * @param event the click of the button%0A%09 * @throws IOException thrown when FXML file could not be parsed%0A%09 */%0A%09@FXML%0A%09protected void handlePlayButton(ActionEvent event) throws IOException %7B%0A%09%09System.out.println(%22Play button pressed!%22);%0A%09%09Stage stage = (Stage) playButton.getScene().getWindow();%0A%09%09GameController.start(stage);%0A%09%7D%0A%09%0A%09/**%0A%09 * Handles clicking of the choose level button%0A%09 * @param event the click of the button%0A%09 * @throws IOException thrown when FXML file could not be parsed%0A%09 */%0A%09@FXML%0A%09protected void handleChooseLevelButton(ActionEvent event) throws IOException %7B%0A%09%09System.out.println(%22Choose Level button pressed!%22);%0A%09%09Stage stage = (Stage) chooseLevelButton.getScene().getWindow();%0A%09%09ChooseLevelController.start(stage);%0A%09%7D%0A%09%0A%09/**%0A%09 * Handles clicking of the options button%0A%09 * @param event the click of the button%0A%09 * @throws IOException thrown when FXML file could not be parsed%0A%09 */%0A%09@FXML%0A%09protected void handleOptionsButton(ActionEvent event) throws IOException %7B%0A%09%09System.out.println(%22Options button pressed!%22);%0A%09%09Stage stage = (Stage) optionsButton.getScene().getWindow();%0A%09%09OptionsController.start(stage);%0A%09%7D%0A%09%0A%09/**%0A%09 * Handles clicking of the quit button%0A%09 * @param event the click of the button%0A%09 * @throws IOException thrown when FXML file could not be parsed%0A%09 */%0A%09@FXML%0A%09protected void handleQuitButton(ActionEvent event) throws IOException %7B%0A%09%09System.out.println(%22Quit button pressed!%22);%0A%09%09System.exit(0);%0A%09%7D%0A
 %7D%0A

Add button control methods to ChooseLevelController