// Path: src/model/NewUserRegistrationModel.java
// public class NewUserRegistrationModel extends DateAndClock {
// 	
// 	public ObservableList<String> getSecurityQuestion() {
// 		ObservableList<String> list = FXCollections.observableArrayList(new ComboboxList().getSecurityQuestionList());
// 		return list;
// 	}
// 	
// 	
// }
// 
// Path: src/operation/GoToOperation.java
// public class GoToOperation extends UnitConverter {
// 
// 	public void goToSignIn(Stage SignInStage) {
// 		try {
// 			Parent root = FXMLLoader.load(getClass().getResource("/view/SignIn.fxml"));
// 			Scene scene = new Scene(root, 800, 550);
// 			SignInStage.setScene(scene);
// 			SignInStage.setTitle("Money Manager");
// 			SignInStage.show();
// 		} catch (Exception e) {
// 			e.printStackTrace();
// 		}
// 	}
// 
// 	public void goToDashboard(Stage DashboardStage) {
// 		try {
// 			Parent root = FXMLLoader.load(getClass().getResource("/view/Dashboard.fxml"));
// 			Scene scene = new Scene(root, 800, 550);
// 			DashboardStage.setScene(scene);
// 			DashboardStage.setTitle("Dashboard");
// 			DashboardStage.show();
// 		} catch (Exception e) {
// 			e.printStackTrace();
// 		}
// 	}
// 
// 	public void goToMakeATransaction(Stage MakeATransactionStage) {
// 		try {
// 			Parent root = FXMLLoader.load(getClass().getResource("/view/MakeATransaction.fxml"));
// 			Scene scene = new Scene(root, 800, 550);
// 			MakeATransactionStage.setScene(scene);
// 			MakeATransactionStage.setTitle("Make A Transaction");
// 			MakeATransactionStage.show();
// 		} catch (Exception e) {
// 			e.printStackTrace();
// 		}
// 	}
// 
// 	public void goToSettings(Stage SettingsStage) {
// 		try {
// 			Parent root = FXMLLoader.load(getClass().getResource("/view/Settings.fxml"));
// 			Scene scene = new Scene(root, 800, 550);
// 			SettingsStage.setScene(scene);
// 			SettingsStage.setTitle("Settings");
// 			SettingsStage.show();
// 		} catch (Exception e) {
// 			e.printStackTrace();
// 		}
// 	}
// 
// 	public void goToTransactionHistory(Stage TransactionHistoryStage) {
// 		try {
// 			Parent root = FXMLLoader.load(getClass().getResource("/view/TransactionHistory.fxml"));
// 			Scene scene = new Scene(root, 800, 550);
// 			TransactionHistoryStage.setScene(scene);
// 			TransactionHistoryStage.setTitle("Transaction History");
// 			TransactionHistoryStage.show();
// 		} catch (Exception e) {
// 			e.printStackTrace();
// 		}
// 	}
// 
// 	public void goToCashCalculate(Stage CashCalculateStage) {
// 		try {
// 			Parent root = FXMLLoader.load(getClass().getResource("/view/CashCalculate.fxml"));
// 			Scene scene = new Scene(root, 800, 550);
// 			CashCalculateStage.setScene(scene);
// 			CashCalculateStage.setTitle("Cash Calculate");
// 			CashCalculateStage.show();
// 		} catch (Exception e) {
// 			e.printStackTrace();
// 		}
// 	}
// 
// 	public void goToAbout(Stage AboutStage) {
// 		try {
// 			Parent root = FXMLLoader.load(getClass().getResource("/view/About.fxml"));
// 			Scene scene = new Scene(root, 800, 550);
// 			AboutStage.setScene(scene);
// 			AboutStage.setTitle("About");
// 			AboutStage.show();
// 		} catch (Exception e) {
// 			e.printStackTrace();
// 		}
// 	}
// 
// 	public void goToHelp(Stage HelpStage) {
// 		try {
// 			Parent root = FXMLLoader.load(getClass().getResource("/view/Help.fxml"));
// 			Scene scene = new Scene(root, 800, 550);
// 			HelpStage.setScene(scene);
// 			HelpStage.setTitle("Help");
// 			HelpStage.show();
// 		} catch (Exception e) {
// 			e.printStackTrace();
// 		}
// 	}
// 
// }


import javafx.animation.KeyFrame;
import javafx.animation.Timeline;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.fxml.FXML;
import javafx.scene.control.Alert;
import javafx.scene.control.Button;
import javafx.scene.control.ComboBox;
import javafx.scene.control.Label;
import javafx.scene.control.PasswordField;
import javafx.scene.control.TextField;
import javafx.scene.control.Tooltip;
import javafx.scene.control.Alert.AlertType;
import javafx.stage.Stage;
import javafx.util.Duration;
import model.NewUserRegistrationModel;
import operation.GoToOperation;
	private Label lblMsg1;
///////////////////////// General Function //////////////
	@FXML
	public void initialize() {
		loadSQuestion();
		
		btnCancel.setTooltip(new Tooltip("Cancel the registration process and take you to Sign In Window"));
		btnRegistration.setTooltip(new Tooltip("If all data typed correctly, \n"
				+ "then you will register as a new user"));
		Tooltip.install(txtName, new Tooltip("Write your full name"));
		Tooltip.install(txtUsername, new Tooltip("Give a username, this will use at the time of login\n"
				+ "This should not contain space"));
		Tooltip.install(passPassword, new Tooltip("Give a password, this should not contain space"));
		Tooltip.install(passReTypePassword, new Tooltip("Retype the password"));
		Tooltip.install(cmboSecurityQuestion, new Tooltip("Choose a security question"));
		Tooltip.install(txtAnswer, new Tooltip("Answer your question. Remember this answer.\n"
				+ "If you forget your password, this will \n"
				+ "help you to recover your account."));
	}
	
//////////////////////// Function ///////////////////////
	private void loadSQuestion() {
		cmboSecurityQuestion.setItems(getSecurityQuestion());
		cmboSecurityQuestion.getSelectionModel().selectFirst();
	}
	
	
	@FXML
	private void btnCancel(ActionEvent event) {
		Stage NewUserRegistrationStage = (Stage) btnCancel.getScene().getWindow();
// Path: src/model/NewUserRegistrationModel.java
// public class NewUserRegistrationModel extends DateAndClock {
// 	
// 	public ObservableList<String> getSecurityQuestion() {
// 		ObservableList<String> list = FXCollections.observableArrayList(new ComboboxList().getSecurityQuestionList());
// 		return list;
// 	}
// 	
// 	
// }
// 
// Path: src/operation/GoToOperation.java
// public class GoToOperation extends UnitConverter {
// 
// 	public void goToSignIn(Stage SignInStage) {
// 		try {
// 			Parent root = FXMLLoader.load(getClass().getResource("/view/SignIn.fxml"));
// 			Scene scene = new Scene(root, 800, 550);
// 			SignInStage.setScene(scene);
// 			SignInStage.setTitle("Money Manager");
// 			SignInStage.show();
// 		} catch (Exception e) {
// 			e.printStackTrace();
// 		}
// 	}
// 
// 	public void goToDashboard(Stage DashboardStage) {
// 		try {
// 			Parent root = FXMLLoader.load(getClass().getResource("/view/Dashboard.fxml"));
// 			Scene scene = new Scene(root, 800, 550);
// 			DashboardStage.setScene(scene);
// 			DashboardStage.setTitle("Dashboard");
// 			DashboardStage.show();
// 		} catch (Exception e) {
// 			e.printStackTrace();
// 		}
// 	}
// 
// 	public void goToMakeATransaction(Stage MakeATransactionStage) {
// 		try {
// 			Parent root = FXMLLoader.load(getClass().getResource("/view/MakeATransaction.fxml"));
// 			Scene scene = new Scene(root, 800, 550);
// 			MakeATransactionStage.setScene(scene);
// 			MakeATransactionStage.setTitle("Make A Transaction");
// 			MakeATransactionStage.show();
// 		} catch (Exception e) {
// 			e.printStackTrace();
// 		}
// 	}
// 
// 	public void goToSettings(Stage SettingsStage) {
// 		try {
// 			Parent root = FXMLLoader.load(getClass().getResource("/view/Settings.fxml"));
// 			Scene scene = new Scene(root, 800, 550);
// 			SettingsStage.setScene(scene);
// 			SettingsStage.setTitle("Settings");
// 			SettingsStage.show();
// 		} catch (Exception e) {
// 			e.printStackTrace();
// 		}
// 	}
// 
// 	public void goToTransactionHistory(Stage TransactionHistoryStage) {
// 		try {
// 			Parent root = FXMLLoader.load(getClass().getResource("/view/TransactionHistory.fxml"));
// 			Scene scene = new Scene(root, 800, 550);
// 			TransactionHistoryStage.setScene(scene);
// 			TransactionHistoryStage.setTitle("Transaction History");
// 			TransactionHistoryStage.show();
// 		} catch (Exception e) {
// 			e.printStackTrace();
// 		}
// 	}
// 
// 	public void goToCashCalculate(Stage CashCalculateStage) {
// 		try {
// 			Parent root = FXMLLoader.load(getClass().getResource("/view/CashCalculate.fxml"));
// 			Scene scene = new Scene(root, 800, 550);
// 			CashCalculateStage.setScene(scene);
// 			CashCalculateStage.setTitle("Cash Calculate");
// 			CashCalculateStage.show();
// 		} catch (Exception e) {
// 			e.printStackTrace();
// 		}
// 	}
// 
// 	public void goToAbout(Stage AboutStage) {
// 		try {
// 			Parent root = FXMLLoader.load(getClass().getResource("/view/About.fxml"));
// 			Scene scene = new Scene(root, 800, 550);
// 			AboutStage.setScene(scene);
// 			AboutStage.setTitle("About");
// 			AboutStage.show();
// 		} catch (Exception e) {
// 			e.printStackTrace();
// 		}
// 	}
// 
// 	public void goToHelp(Stage HelpStage) {
// 		try {
// 			Parent root = FXMLLoader.load(getClass().getResource("/view/Help.fxml"));
// 			Scene scene = new Scene(root, 800, 550);
// 			HelpStage.setScene(scene);
// 			HelpStage.setTitle("Help");
// 			HelpStage.show();
// 		} catch (Exception e) {
// 			e.printStackTrace();
// 		}
// 	}
// 
// }


// Path: src/controller/NewUserRegistrationController.java
import javafx.animation.KeyFrame;
import javafx.animation.Timeline;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.fxml.FXML;
import javafx.scene.control.Alert;
import javafx.scene.control.Button;
import javafx.scene.control.ComboBox;
import javafx.scene.control.Label;
import javafx.scene.control.PasswordField;
import javafx.scene.control.TextField;
import javafx.scene.control.Tooltip;
import javafx.scene.control.Alert.AlertType;
import javafx.stage.Stage;
import javafx.util.Duration;
import model.NewUserRegistrationModel;
import operation.GoToOperation;

	private Label lblMsg1;
///////////////////////// General Function //////////////
	@FXML
	public void initialize() {
		loadSQuestion();
		
		btnCancel.setTooltip(new Tooltip("Cancel the registration process and take you to Sign In Window"));
		btnRegistration.setTooltip(new Tooltip("If all data typed correctly, \n"
				+ "then you will register as a new user"));
		Tooltip.install(txtName, new Tooltip("Write your full name"));
		Tooltip.install(txtUsername, new Tooltip("Give a username, this will use at the time of login\n"
				+ "This should not contain space"));
		Tooltip.install(passPassword, new Tooltip("Give a password, this should not contain space"));
		Tooltip.install(passReTypePassword, new Tooltip("Retype the password"));
		Tooltip.install(cmboSecurityQuestion, new Tooltip("Choose a security question"));
		Tooltip.install(txtAnswer, new Tooltip("Answer your question. Remember this answer.\n"
				+ "If you forget your password, this will \n"
				+ "help you to recover your account."));
	}
	
//////////////////////// Function ///////////////////////
	private void loadSQuestion() {
		cmboSecurityQuestion.setItems(getSecurityQuestion());
		cmboSecurityQuestion.getSelectionModel().selectFirst();
	}
	
	
	@FXML
	private void btnCancel(ActionEvent event) {
		Stage NewUserRegistrationStage = (Stage) btnCancel.getScene().getWindow();
		(new GoToOperation()).goToSignIn(NewUserRegistrationStage);