4 Commits

Author SHA1 Message Date
d681f20b90 Update JavaDoc 2024-12-16 03:15:16 +00:00
ef569e1bcb Revert "Update JavaDoc"
This reverts commit 7708654bdb.
2024-12-16 03:07:48 +00:00
74ba71d52c Fix tempramental width management on non minesweeper stages 2024-12-16 03:00:41 +00:00
7708654bdb Update JavaDoc 2024-07-29 17:05:28 +01:00
5 changed files with 31 additions and 2 deletions

View File

@@ -22,6 +22,11 @@ import javafx.scene.input.MouseEvent;
import javafx.scene.layout.GridPane;
import javafx.stage.Stage;
/**
* The JavaFX controller for minesweeper.fxml.
* Handles all operations performed within the GUI.
* @author shrapnelnet admin@shr4pnel.com
*/
public class Controller {
/**
* The grid within the FXML holding all the tiles.
@@ -121,6 +126,8 @@ public class Controller {
Parent root = FXMLLoader.load(getClass().getResource("about.fxml"));
Stage stage = new Stage();
stage.setTitle("About");
stage.setMinWidth(455);
stage.setMinHeight(275);
stage.setScene(new Scene(root));
stage.show();
} catch (IOException e) {
@@ -141,6 +148,8 @@ public class Controller {
Parent root = FXMLLoader.load(getClass().getResource("unimplemented.fxml"));
Stage stage = new Stage();
stage.setTitle("Unimplemented!");
stage.setMinHeight(420);
stage.setMinWidth(525);
stage.setScene(new Scene(root));
stage.show();
} catch (IOException e) {
@@ -347,7 +356,7 @@ public class Controller {
}
/**
* If a tile is surrounded by tiles with no adjacent bombs, open all of the tiles recursively
* If a tile is surrounded by tiles with no adjacent bombs, open all the tiles recursively
*
* @param column The column that was clicked
* @param row The row that was clicked
@@ -497,7 +506,7 @@ public class Controller {
* Create a flag on a tile, representing a tile that the user suspects has a bomb behind it.
* This prevents the tile being clicked on.
*
* @param tileClicked
* @param tileClicked The tile that the user clicks.
*/
private void flag(Node tileClicked) {
Button tileAsButton = (Button) tileClicked;

View File

@@ -2,7 +2,14 @@ package com.shr4pnel.minesweeper;
import java.util.concurrent.ThreadLocalRandom;
/**
* Used to fill the GridWrapper with bombs. Planned to merge into GridWrapper.
* @since 1.0.0
*/
public class Grid {
/**
* An instance of GridWrapper used to check generation of bombs.
*/
final GridWrapper grid = new GridWrapper();
/**

View File

@@ -1,5 +1,9 @@
package com.shr4pnel.minesweeper;
/**
* Simplifies operations on the bomb array. Preventing direct access leads to cleaner code.
* @since 1.0.0
*/
public class GridWrapper {
/**
* Number of columns.

View File

@@ -9,6 +9,10 @@ import javafx.scene.Scene;
import javafx.scene.image.Image;
import javafx.stage.Stage;
/**
* The application opening point, used to bootstrap JavaFX and open to the GUI.
* @since 1.0.0
*/
public class Main extends Application {
/**
* JavaFX opening method. Creates the stage and bootstraps the application.

View File

@@ -1,3 +1,8 @@
/**
* The main module for the program. Required to launch to JavaFX as well as bundle into a native binary.
* @author shrapnelnet admin@shr4pnel.com
* @since 1.0.0
*/
module libremines {
requires javafx.controls;
requires javafx.fxml;