package fr.insa.clavardator.client.ui;

import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.scene.layout.VBox;

import java.net.URL;
import java.util.ResourceBundle;

/**
 * Controller for the error screen
 */
public class ErrorScreenController implements Initializable {

	@FXML
	private VBox container;

	/**
	 * Instantly shows the error screen
	 */
	public void show() {
		container.setVisible(true);
	}

	/**
	 * Instantly hides the error screen
	 */
	public void hide() {
		container.setVisible(false);
	}

	/**
	 * Exits the app on button press
	 */
	@FXML
	private void onPress() {
		System.exit(0);
	}

	@Override
	public void initialize(URL location, ResourceBundle resources) {
		hide();
	}
}
