diff --git a/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/popups/RejectTrade.java b/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/popups/RejectTrade.java index 4cd9c23..92f1d07 100644 --- a/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/popups/RejectTrade.java +++ b/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/popups/RejectTrade.java @@ -17,16 +17,33 @@ import pp.monopoly.message.server.TradeReply; import pp.monopoly.notification.Sound; /** - * Bankrupt is a Warning-Popup which appears when the balance is negative at the end of a player´s turn + * RejectTrade is a popup that appears when a trade proposal is rejected by another player + * in the Monopoly application. + *

+ * Displays a message indicating that the proposed trade has been declined, along with + * details of the involved players and provides an option to close the popup. + *

*/ public class RejectTrade extends Dialog { + /** Reference to the Monopoly application instance. */ private final MonopolyApp app; + + /** Semi-transparent overlay background for the popup. */ private final Geometry overlayBackground; + + /** Main container for the rejection message content. */ private final Container noMoneyWarningContainer; + + /** Background container providing a border for the popup. */ private final Container backgroundContainer; - + /** + * Constructs the RejectTrade popup displaying the rejection of a trade proposal. + * + * @param app the Monopoly application instance + * @param msg the trade reply message containing details about the rejected trade + */ public RejectTrade(MonopolyApp app, TradeReply msg) { super(app.getDialogManager()); this.app = app; @@ -92,9 +109,9 @@ public class RejectTrade 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 geometry of the overlay */ private Geometry createOverlayBackground() { Quad quad = new Quad(app.getCamera().getWidth(), app.getCamera().getHeight()); @@ -118,6 +135,9 @@ public class RejectTrade extends Dialog { super.close(); } + /** + * Handles the escape key action by closing the popup. + */ @Override public void escape() { close();