Merge 'feat/lobby-ui' back into 'main' #172

Merged
jona.walpert merged 12 commits from feat/lobby-ui into main 2026-03-13 15:30:32 +01:00
5 changed files with 111 additions and 0 deletions
Showing only changes of commit 02dc75c331 - Show all commits
@@ -3,8 +3,25 @@ package ch.unibas.dmi.dbis.cs108.casono;
import ch.unibas.dmi.dbis.cs108.casono.client.ClientApp;
import ch.unibas.dmi.dbis.cs108.casono.server.ServerApp;
/**
* Main entry point for Casono application.
* Handles client and server startup.
* <p>
* Standardkonstruktor für die Anwendung.
*/
public final class Main {
/**
* Standardkonstruktor.
*/
public Main() {
// Standardkonstruktor
}
/**
* Main entry point for Casono.
* @param args Command line arguments
*/
public static void main(String[] args) {
if (!isValid(args)) {
printUsage();
@@ -1,6 +1,29 @@
package ch.unibas.dmi.dbis.cs108.casono.client;
/**
* Entry point for the Casono client application.
* Handles client startup and connection parameters.
*/
import ch.unibas.dmi.dbis.cs108.casono.client.ui.Launcher;
/**
* Entry point for the Casono client application.
* Handles client startup and connection parameters.
* <p>
* Standardkonstruktor für die Anwendung.
*/
public class ClientApp {
/**
* Standardkonstruktor.
*/
public ClientApp() {
// Standardkonstruktor
}
/**
* Starts the client application with the given address.
* @param arg Address in the format "ip:port".
* @throws IllegalArgumentException if the address format is invalid.
*/
public static void start(String arg) {
String[] parts = arg.split(":", 2);
if (parts.length != 2) {
@@ -2,7 +2,23 @@ package ch.unibas.dmi.dbis.cs108.casono.client.ui;
import javafx.application.Application;
/**
* Launcher for the Casono main UI.
* <p>
* Standardkonstruktor für die Anwendung.
*/
public class Launcher {
/**
* Standardkonstruktor.
*/
public Launcher() {
// Standardkonstruktor
}
/**
* Main entry point for launching the UI.
* @param args Command line arguments
*/
public static void main(String[] args) {
Application.launch(ch.unibas.dmi.dbis.cs108.casono.client.ui.lobbyui.Casinomainui.class, args);
}
@@ -1,5 +1,9 @@
package ch.unibas.dmi.dbis.cs108.casono.client.ui.lobbyui;
/**
* Main UI application for Casono.
* Loads the main FXML layout and sets up the stage.
*/
import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Scene;
@@ -7,8 +11,25 @@ import javafx.stage.Stage;
import java.io.IOException;
/**
* JavaFX Application class for the Casono main UI.
* <p>
* Standardkonstruktor für die Anwendung.
*/
public class Casinomainui extends Application {
/**
* Standardkonstruktor.
*/
public Casinomainui() {
// Standardkonstruktor
}
@Override
/**
* Starts the JavaFX application and loads the main UI.
* @param stage The primary stage for this application.
* @throws IOException If loading the FXML fails.
*/
public void start(Stage stage) throws IOException {
FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("/ui-structure/Casinomainui.fxml"));
Scene scene = new Scene(fxmlLoader.load(), 1200, 800);
@@ -20,6 +41,10 @@ public class Casinomainui extends Application {
stage.show();
}
/**
* Main entry point for launching the application.
* @param args Command line arguments
*/
public static void main(String[] args) {
launch();
}
@@ -1,4 +1,9 @@
package ch.unibas.dmi.dbis.cs108.casono.client.ui.lobbyui;
/**
* Controller for the Casono main UI lobby.
* Handles UI initialization and user actions.
*/
import javafx.application.Platform;
import javafx.fxml.FXML;
import javafx.scene.control.Label;
@@ -16,23 +21,45 @@ import javafx.scene.input.MouseEvent;
import javafx.scene.layout.HBox;
import javafx.scene.layout.AnchorPane;
/**
* Controller for the Casono main UI lobby.
* Handles UI initialization and user actions.
* <p>
* Standardkonstruktor für den Controller.
*/
public class CasinomainuiController {
/**
* Standardkonstruktor.
*/
public CasinomainuiController() {
// Standardkonstruktor
}
/** Root pane of the UI. */
@FXML
private AnchorPane rootPane;
/** Title label for the main UI. */
@FXML
private Label titleLabel;
/** Subtitle label for the main UI. */
@FXML
private Label subtitleLabel;
/** Logo image view. */
@FXML
private javafx.scene.image.ImageView logoView;
/** Green box shape element. */
@FXML
private javafx.scene.shape.Rectangle greenBox;
/** Exit button for closing the application. */
@FXML
private Button exitbutton;
/**
* Initializes the UI components and sets default values.
*/
public void initialize() {
titleLabel.setText("Casono");
subtitleLabel.setText("Texas Hold'em Poker");
@@ -40,6 +67,9 @@ public class CasinomainuiController {
logoView.setImage(new javafx.scene.image.Image(getClass().getResource("/images/logo.png").toExternalForm()));
}
/**
* Handles the exit button action to close the application.
*/
@FXML
public void handleexitbutton() {
Platform.exit();