|
@ -119,8 +119,8 @@ public class Factory {
|
|||
* Method to load a Game View
|
||||
* @param box the box where the game view should be added.
|
||||
* @param gameDecorator the gameDecorator instance of the game.
|
||||
* @param factoryDecorator
|
||||
* @return
|
||||
* @param factoryDecorator the factoryDecorator instance.
|
||||
* @return the controller of the GameView
|
||||
*/
|
||||
public GameController loadGameView(VBox box, GameDecorator gameDecorator, FactoryDecorator factoryDecorator) {
|
||||
try {
|
||||
|
@ -136,6 +136,12 @@ public class Factory {
|
|||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to print information for the user to the footer of mainwindow.
|
||||
* @param pane the pane where the footer should be shown.
|
||||
* @param msg the text to show.
|
||||
* @param error true if it's a error message.
|
||||
*/
|
||||
public void printMessageToFooter(BorderPane pane, String msg, boolean error) {
|
||||
VBox bottom = (VBox) pane.getBottom();
|
||||
Label label = new Label();
|
||||
|
@ -164,9 +170,9 @@ public class Factory {
|
|||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param pane
|
||||
* @param error
|
||||
* Method to remove the messages in the footer.
|
||||
* @param pane the pane were the footer should be reseted
|
||||
* @param error true if the error message should be cleared.
|
||||
*/
|
||||
public void resetFooter(BorderPane pane,boolean error) {
|
||||
VBox bottom = (VBox) pane.getBottom();
|
||||
|
@ -181,7 +187,7 @@ public class Factory {
|
|||
}
|
||||
|
||||
/**
|
||||
* Enum for keeping the different fxml form views
|
||||
* Enum of all views which can be set to the center of the mainwindow.
|
||||
*/
|
||||
public enum View {
|
||||
tournamentList("tournamentList/tournamentList.fxml"),
|
||||
|
@ -192,6 +198,10 @@ public class Factory {
|
|||
private String fxmlFileName;
|
||||
private Pane pane;
|
||||
|
||||
/**
|
||||
* Constructor of View
|
||||
* @param fxmlFileName The name of the FXML File to load.
|
||||
*/
|
||||
private View(String fxmlFileName) {
|
||||
this.fxmlFileName = fxmlFileName;
|
||||
}
|
||||
|
@ -200,6 +210,14 @@ public class Factory {
|
|||
return pane;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to laod the view
|
||||
* @param tournamentDecorator the tournamentDecorator object which will be passed to the controller.
|
||||
* @param fileIO the fileIO object which will be passed to the controller.
|
||||
* @param factoryDecorator the factoryDecorator object which will be passed to the controller.
|
||||
* @param borderPane the borderPane object which will be passed to the controller.
|
||||
* @throws IOException if the fxml file is not found or can not be loaded correctly.
|
||||
*/
|
||||
public void loadView(TournamentDecorator tournamentDecorator, FileIO fileIO, FactoryDecorator factoryDecorator, BorderPane borderPane) throws IOException {
|
||||
FXMLLoader loader = new FXMLLoader(getClass().getResource(fxmlFileName));
|
||||
this.pane = loader.load();
|
||||
|
|
Loading…
Reference in New Issue