Logging and docs added in several classes #27 #28 #53

Merged
brandleo merged 13 commits from logging_and_docs into main 2022-05-13 22:54:04 +02:00
2 changed files with 22 additions and 10 deletions
Showing only changes of commit 784cbfdd76 - Show all commits

View File

@ -19,7 +19,7 @@ public class Factory {
private TournamentDecorator tournamentDecorator;
private FileIO fileIO;
private static final Logger logger = Logger.getLogger(FileIO.class.getCanonicalName());
private static final Logger logger = Logger.getLogger(Factory.class.getCanonicalName());
public Factory(FileIO fileIO, TournamentDecorator tournamentDecorator) {
this.fileIO = fileIO;

View File

@ -5,25 +5,34 @@ import ch.zhaw.projekt2.turnierverwaltung.FactoryDecorator;
import ch.zhaw.projekt2.turnierverwaltung.FileIO;
import ch.zhaw.projekt2.turnierverwaltung.TournamentDecorator;
import javafx.application.Application;
import javafx.event.EventHandler;
import javafx.fxml.FXMLLoader;
import javafx.scene.Scene;
import javafx.scene.layout.BorderPane;
import javafx.stage.Stage;
import javafx.stage.WindowEvent;
import java.util.logging.Logger;
/**
* Class Main window is used to initialize the GUI Elements, Creating several Decorators and also getting the Factories
* ready
*/
public class MainWindow extends Application {
private FileIO fileIO = new FileIO(System.getProperty("user.dir") + System.getProperty("file.separator") + "tournierverwaltung_angrynerds");
private final FileIO fileIO = new FileIO(System.getProperty("user.dir") +
System.getProperty("file.separator") + "tournierverwaltung_angrynerds");
private FactoryDecorator factoryDecorator;
private TournamentDecorator tournamentDecorator = new TournamentDecorator(fileIO);
private Factory factory = new Factory(fileIO, tournamentDecorator);
private static final Logger logger = Logger.getLogger(FileIO.class.getCanonicalName());
private final TournamentDecorator tournamentDecorator = new TournamentDecorator(fileIO);
private final Factory factory = new Factory(fileIO, tournamentDecorator);
private static final Logger logger = Logger.getLogger(MainWindow.class.getCanonicalName());
/**
* Start method used to initialize the main window and load it's needed component
* Also sets the scene and set some values like min width and height
*
* @param primaryStage to be displayed
*/
@Override
public void start(Stage primaryStage) throws Exception {
public void start(Stage primaryStage) {
logger.fine("Starting up the main window with the primary Stage");
BorderPane pane = factory.loadMainWindow();
factoryDecorator = new FactoryDecorator(fileIO, factory, pane);
factory.loadAllViews(factoryDecorator, pane);
@ -40,6 +49,9 @@ public class MainWindow extends Application {
primaryStage.show();
}
/**
* Method used to safely shut down the application
*/
@Override
public void stop() {
try {