From 4917208818eeb058e62f28683c3b1a010d00aec1 Mon Sep 17 00:00:00 2001 From: Yvonne Schmidt Date: Mon, 2 Dec 2024 08:51:22 +0100 Subject: [PATCH] added documentation for TimeOut --- .../monopoly/client/gui/popups/TimeOut.java | 29 +++++++++++++++---- 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/popups/TimeOut.java b/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/popups/TimeOut.java index dbf23e1..c181ca5 100644 --- a/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/popups/TimeOut.java +++ b/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/popups/TimeOut.java @@ -17,16 +17,29 @@ import pp.monopoly.notification.Sound; import static pp.monopoly.Resources.lookup; /** - * TimeOut is a warning popup that is triggered when the connection to the server is interrupted. + * TimeOut is a warning popup triggered when the connection to the server is interrupted. + *

+ * This popup informs the user about the loss of connection and provides an option to acknowledge it. + *

*/ public class TimeOut extends Dialog { + /** Reference to the Monopoly application instance. */ private final MonopolyApp app; + + /** Semi-transparent overlay background for the dialog. */ private final Geometry overlayBackground; + + /** Main container for the TimeOut dialog UI. */ private final Container timeOutContainer; + + /** Background container providing a styled border around the main dialog. */ private final Container backgroundContainer; - - + /** + * Constructs a new TimeOut dialog to notify the user about a connection loss. + * + * @param app The MonopolyApp instance. + */ public TimeOut(MonopolyApp app) { super(app.getDialogManager()); this.app = app; @@ -86,9 +99,9 @@ public class TimeOut extends Dialog { } /** - * Erstellt einen halbtransparenten Hintergrund für das Menü. + * Creates a semi-transparent background overlay for the popup. * - * @return Geometrie des Overlays + * @return The overlay geometry. */ private Geometry createOverlayBackground() { Quad quad = new Quad(app.getCamera().getWidth(), app.getCamera().getHeight()); @@ -102,8 +115,9 @@ public class TimeOut extends Dialog { } /** - * Schließt das Menü und entfernt die GUI-Elemente. + * Closes the TimeOut dialog and removes its GUI elements. */ + @Override public void close() { app.getGuiNode().detachChild(timeOutContainer); // Entferne das Menü @@ -112,6 +126,9 @@ public class TimeOut extends Dialog { super.close(); } + /** + * Handles the escape action to close the dialog. + */ @Override public void escape() { close();