]> Git Server - tankstelle.git/commitdiff
Javadoc formatting
authorRobin Cheney <cheneyr@eternal.ddnss.de>
Mon, 1 Dec 2025 09:01:56 +0000 (10:01 +0100)
committerRobin Cheney <cheneyr@eternal.ddnss.de>
Mon, 1 Dec 2025 09:01:56 +0000 (10:01 +0100)
17 files changed:
src/main/java/de/diejungsvondertanke/tankstelle/controllers/FuelStationUIController.java
src/main/java/de/diejungsvondertanke/tankstelle/controllers/NewStationTabController.java
src/main/java/de/diejungsvondertanke/tankstelle/controllers/OverviewTabController.java
src/main/java/de/diejungsvondertanke/tankstelle/controllers/PriceTabController.java
src/main/java/de/diejungsvondertanke/tankstelle/controllers/ResultTabController.java
src/main/java/de/diejungsvondertanke/tankstelle/controllers/SearchTabController.java
src/main/java/de/diejungsvondertanke/tankstelle/controllers/StockTabController.java
src/main/java/de/diejungsvondertanke/tankstelle/controllers/UnderstaffedTabController.java
src/main/java/de/diejungsvondertanke/tankstelle/core/Fuel.java
src/main/java/de/diejungsvondertanke/tankstelle/core/FuelStation.java
src/main/java/de/diejungsvondertanke/tankstelle/core/FuelType.java
src/main/java/de/diejungsvondertanke/tankstelle/core/LargeFuelStation.java
src/main/java/de/diejungsvondertanke/tankstelle/core/MediumFuelStation.java
src/main/java/de/diejungsvondertanke/tankstelle/core/Size.java
src/main/java/de/diejungsvondertanke/tankstelle/core/SmallFuelStation.java
src/main/java/de/diejungsvondertanke/tankstelle/ui/FuelRow.java
src/main/java/de/diejungsvondertanke/tankstelle/ui/JFX.java

index 64c8fde9eb1a03f5f971ccf14a6d5c18eb9a1a2e..941ac9635f96a67129c3ae7935cc538f01f43b04 100644 (file)
@@ -63,17 +63,25 @@ public class FuelStationUIController {
     private UnderstaffedTabController understaffedTabController;
 
     /**
-     * Automatically called initialize() function.
+     * <p>
+     * Automatically called {@code initialize()} function.
+     * </p>
      * 
+     * <p>
      * This is the "main" UI setup routine. For timing reasons, this will/must load
      * every subtab manually to get the controller object and set the
      * {@link FuelStationUIController} controller in every subtab controller
      * element.
+     * </p>
      * 
+     * <p>
      * If not done correctly, using the controller in the subtabs WILL FAIL.
+     * </p>
      * 
+     * <p>
      * USING THE CONTROLLER OBJECT INSIDE THE {@code initialize()} FUNCTION OF THE
      * SUBTABS WILL NOT WORK AND WILL ALWAYS BE {@code null} DUE TO TIMING ISSUES
+     * </p>
      */
     @FXML
     public void initialize() {
index 3904e1b5308d150103c47647380ec3f6f895d69f..097ff565e4d3edf93cc1e6d4cf8883c5bab2f285 100644 (file)
@@ -25,12 +25,17 @@ public class NewStationTabController {
     private FuelStationUIController parentController;
 
     /**
+     * <p>
      * For timing reasons this is a common method for every controller that is for a
      * tab (not to confuse with the main window controller
-     * {@link FuelStationUIController}). This passes the controller object from the
+     * {@link FuelStationUIController}).
+     * </p>
+     * <p>
+     * This passes the controller object from the
      * main controller to the controllers for the individual tabs as fields.
      * Necessary, if you need to access any methods from the main controller, which
-     * is much likely the case
+     * is much likely the case.
+     * </p>
      */
     public void setParentController(FuelStationUIController parent) {
         this.parentController = parent;
index d78ccb6fa3ea7b67bbc31c947c9560c140da7bc0..0d47488bd5292e7f0c2d1fc40234ed678925843b 100644 (file)
@@ -10,8 +10,6 @@ import javafx.beans.property.SimpleIntegerProperty;
 import javafx.beans.property.SimpleStringProperty;
 import javafx.beans.property.SimpleDoubleProperty;
 import javafx.fxml.FXML;
-import javafx.scene.Node;
-import javafx.scene.Parent;
 import javafx.scene.control.TableColumn;
 import javafx.scene.control.TableView;
 
@@ -42,12 +40,17 @@ public class OverviewTabController {
     private FuelStationUIController parentController;
 
     /**
+     * <p>
      * For timing reasons this is a common method for every controller that is for a
      * tab (not to confuse with the main window controller
-     * {@link FuelStationUIController}). This passes the controller object from the
+     * {@link FuelStationUIController}).
+     * </p>
+     * <p>
+     * This passes the controller object from the
      * main controller to the controllers for the individual tabs as fields.
      * Necessary, if you need to access any methods from the main controller, which
-     * is much likely the case
+     * is much likely the case.
+     * </p>
      */
     public void setParentController(FuelStationUIController parent) {
         this.parentController = parent;
@@ -72,22 +75,9 @@ public class OverviewTabController {
     @FXML
     public void refresh() {
         table.getItems().clear();
-        // ObservableList<FuelRow> list = FXCollections.observableArrayList();
-        // table.getItems().add(new FuelRow("TestStation", "TestType", "Diesel", 123,
-
-        // 999, 1.23f));
-        // System.out.println("On FX thread? " + Platform.isFxApplicationThread());
 
         for (FuelStation station : Main.fuelStations) {
             for (Fuel f : station.fuels) {
-                // System.out.println("Row: " +
-                // parentController.getDisplayName(station) + " | " +
-                // station.getClass().getSimpleName() + " | " +
-                // f.FUEL_TYPE + " | " +
-                // f.getStored_amount() + " | " +
-                // f.CAPACITY + " | " +
-                // f.getPrice());
-
                 table.getItems().add(
                         new FuelRow(
                                 parentController.getDisplayName(station),
@@ -96,34 +86,7 @@ public class OverviewTabController {
                                 f.getStored_amount(),
                                 f.CAPACITY,
                                 f.getPrice()));
-                // System.out.println("Processed " + f.toString());
             }
         }
-        // System.out.print(list);
-        // table.setItems(list);
     }
-
-    /**
-     * This is just a debugging function. Do not use in a production environment
-     * 
-     * @param node  A displayed {@link Node} (i. e. from one of the Tabs) to display
-     *              a tree-like inner structure for
-     * @param depth max. recursion depth
-     */
-    public static void printNodeTree(Node node, int depth) {
-        // Indentation
-        String indent = "  ".repeat(depth);
-
-        // Print this node
-        System.out.println(indent + node.getClass().getSimpleName()
-                + (node.getId() != null ? " [id=" + node.getId() + "]" : ""));
-
-        // If the node is a Parent, get its children and recurse
-        if (node instanceof Parent parent) {
-            for (Node child : parent.getChildrenUnmodifiable()) {
-                printNodeTree(child, depth + 1);
-            }
-        }
-    }
-
 }
\ No newline at end of file
index c429999f2dec504d3fb88baf8c4f1e4f9d4dda8e..8405c73f65cc3e16155e8bf092cc2ccbfb7fa73a 100644 (file)
@@ -20,12 +20,17 @@ public class PriceTabController {
     private FuelStationUIController parentController;
 
     /**
+     * <p>
      * For timing reasons this is a common method for every controller that is for a
      * tab (not to confuse with the main window controller
-     * {@link FuelStationUIController}). This passes the controller object from the
+     * {@link FuelStationUIController}).
+     * </p>
+     * <p>
+     * This passes the controller object from the
      * main controller to the controllers for the individual tabs as fields.
      * Necessary, if you need to access any methods from the main controller, which
-     * is much likely the case
+     * is much likely the case.
+     * </p>
      */
     public void setParentController(FuelStationUIController parent) {
         this.parentController = parent;
index 97dd4fce21c02ac2b75ec56736d7d8a17cd1757a..950242c05dc45a51876d104956440f7d950507e7 100644 (file)
@@ -28,12 +28,17 @@ public class ResultTabController {
     }
 
     /**
+     * <p>
      * For timing reasons this is a common method for every controller that is for a
      * tab (not to confuse with the main window controller
-     * {@link FuelStationUIController}). This passes the controller object from the
+     * {@link FuelStationUIController}).
+     * </p>
+     * <p>
+     * This passes the controller object from the
      * main controller to the controllers for the individual tabs as fields.
      * Necessary, if you need to access any methods from the main controller, which
-     * is much likely the case
+     * is much likely the case.
+     * </p>
      */
     public void setParentController(FuelStationUIController parentController) {
         this.parentController = parentController;
index bf97366bd97e403e443d77832f7c6aedfb8f193c..2a192b137a17a8021f32d013af10933411253870 100644 (file)
@@ -17,12 +17,17 @@ public class SearchTabController {
     private FuelStationUIController parentController;
 
     /**
+     * <p>
      * For timing reasons this is a common method for every controller that is for a
      * tab (not to confuse with the main window controller
-     * {@link FuelStationUIController}). This passes the controller object from the
+     * {@link FuelStationUIController}).
+     * </p>
+     * <p>
+     * This passes the controller object from the
      * main controller to the controllers for the individual tabs as fields.
      * Necessary, if you need to access any methods from the main controller, which
-     * is much likely the case
+     * is much likely the case.
+     * </p>
      */
     public void setParentController(FuelStationUIController parent) {
         this.parentController = parent;
index 732077c10873cbb99ab844152b30524636e9d60d..eaddaa438a4fdcd6f33c4b3557a83bfaa07cce39 100644 (file)
@@ -26,12 +26,17 @@ public class StockTabController {
     private FuelStationUIController parentController;
 
     /**
+     * <p>
      * For timing reasons this is a common method for every controller that is for a
      * tab (not to confuse with the main window controller
-     * {@link FuelStationUIController}). This passes the controller object from the
+     * {@link FuelStationUIController}).
+     * </p>
+     * <p>
+     * This passes the controller object from the
      * main controller to the controllers for the individual tabs as fields.
      * Necessary, if you need to access any methods from the main controller, which
-     * is much likely the case
+     * is much likely the case.
+     * </p>
      */
     public void setParentController(FuelStationUIController parent) {
         this.parentController = parent;
index 4488ba9a8ddecd1c1e884b1557ca3356c832e10f..0f47e7f285a6851545a852d637ed1d5c509d5f68 100644 (file)
@@ -21,12 +21,17 @@ public class UnderstaffedTabController {
     private FuelStationUIController parentController;
 
     /**
+     * <p>
      * For timing reasons this is a common method for every controller that is for a
      * tab (not to confuse with the main window controller
-     * {@link FuelStationUIController}). This passes the controller object from the
+     * {@link FuelStationUIController}).
+     * </p>
+     * <p>
+     * This passes the controller object from the
      * main controller to the controllers for the individual tabs as fields.
      * Necessary, if you need to access any methods from the main controller, which
-     * is much likely the case
+     * is much likely the case.
+     * </p>
      */
     public void setParentController(FuelStationUIController parent) {
         this.parentController = parent;
index 4a25d1a18bad5155baa3198999abb63c6ca90bfa..0c2e972cf9a79a24038938329b36d4572d59015c 100644 (file)
@@ -1,8 +1,13 @@
 package de.diejungsvondertanke.tankstelle.core;
 
 /**
- * A fuel object. Contains fuel type, price per litre, stored fuel amount and
+ * <p>
+ * A fuel object.
+ * </p>
+ * <p>
+ * Contains fuel type, price per litre, stored fuel amount and
  * storage capacity for this fuel
+ * </p>
  * 
  * @author Robin Cheney
  */
index cc05f989f3443f7a14908d809b444f2a4d104711..93ffab33d8b6d140e6593f06b66a907c95f420ab 100644 (file)
@@ -27,8 +27,13 @@ public abstract class FuelStation {
     public Fuel[] fuels;
 
     /**
-     * The {@link Size Size} of a fuel station. Is more or less decorative, because
+     * <p>
+     * The {@link Size Size} of a fuel station.
+     * </p>
+     * <p>
+     * Is more or less decorative, because
      * you can infer the size from the fuel station's type
+     * </p>
      */
     private Size size;
 
@@ -262,6 +267,12 @@ public abstract class FuelStation {
         throw new NoSuchFuelTypeError("This fuel station does not have fuel of the given type");
     }
 
+    /**
+     * This function is used to get a generic simplified class name for display
+     * purposes to indicate the size of this fuel station
+     * 
+     * @return {@code null} because this method should be overridden in subclasses
+     */
     public String getSimpleName() {
         return null;
     }
index 71c0016f02c7eddae937ae3fe3a463a8b6bea3b5..0e254a242940fe715ca820377d04aebc701a479e 100644 (file)
@@ -15,8 +15,13 @@ public enum FuelType {
      */
     DIESEL("Diesel"),
     /**
-     * If you want to feel like saving the planet: Now with at most 10% ethanol in
+     * <p>
+     * If you want to feel like saving the planet:
+     * </p>
+     * <p>
+     * Now with at most 10% ethanol in
      * your gasoline
+     * </p>
      */
     SUPER_E10("Super E10"),
     /**
@@ -41,8 +46,4 @@ public enum FuelType {
     public String toString() {
         return name;
     }
-
-    public static FuelType toEnum(String name) {
-        return FuelType.valueOf(name);
-    }
 }
index cea33aa4ca59d44866a21ce0c4361c6bd9b69167..76199c63c5eb5c8eb353215e3ba4e9a771826e31 100644 (file)
@@ -33,7 +33,7 @@ public class LargeFuelStation extends FuelStation {
     }
 
     /**
-     * Getter method
+     * Get the name of the company running the integrated supermarket
      * 
      * @return the name of the company running the integrated supermarket
      * 
@@ -43,6 +43,12 @@ public class LargeFuelStation extends FuelStation {
         return supermarket_company;
     }
 
+    /**
+     * This function is used to get a generic simplified class name for display
+     * purposes to indicate the size of this fuel station
+     * 
+     * @return the simplified name for a {@link LargeFuelStation large fuel station}
+     */
     public String getSimpleName() {
         return "large fuel station";
     }
index 7a15b9f3cdf7fdf2e9b2186171f93d2a4543ceb3..c4fe99f3b7ffcee14f68ce935a1cb1e608e3f0f8 100644 (file)
@@ -32,7 +32,7 @@ public class MediumFuelStation extends FuelStation {
     }
 
     /**
-     * Getter method
+     * Get the retail space in m² of this fuel station
      * 
      * @return retail space in m²
      * 
@@ -42,6 +42,13 @@ public class MediumFuelStation extends FuelStation {
         return retail_space;
     }
 
+    /**
+     * This function is used to get a generic simplified class name for display
+     * purposes to indicate the size of this fuel station
+     * 
+     * @return the simplified name for a {@link MediumFuelStation medium fuel
+     *         station}
+     */
     public String getSimpleName() {
         return "medium fuel station";
     }
index 461dc111064684d9b124f89de5acf51fd3dad0c5..08fa7264abe8ed83303e1fee62d8a829ccb237f4 100644 (file)
@@ -2,9 +2,7 @@ package de.diejungsvondertanke.tankstelle.core;
 
 /**
  * The size of a {@link FuelStation fuel station}. Is more or less decorative,
- * because you
- * can infer
- * the size from the fuel station's type
+ * because you can infer the size from the fuel station's type
  * 
  * @see LargeFuelStation
  * @see MediumFuelStation
index e8002d647e3d9a11b4c4c0a54a40c5b89c811104..d48a71c5496d1f122099cbc207174cb9cddbf544 100644 (file)
@@ -31,7 +31,7 @@ public class SmallFuelStation extends FuelStation {
     }
 
     /**
-     * Getter method
+     * Get the number of drink vending machines this fuel station has
      * 
      * @return the number of drink vending machines this fuel station has
      * 
@@ -41,6 +41,12 @@ public class SmallFuelStation extends FuelStation {
         return number_of_vending_machines;
     }
 
+    /**
+     * This function is used to get a generic simplified class name for display
+     * purposes to indicate the size of this fuel station
+     * 
+     * @return the simplified name for a {@link SmallFuelStation small fuel station}
+     */
     public String getSimpleName() {
         return "small fuel station";
     }
index 8243111f39d040969508450af8e28fae67ef6c93..3187477694f5c16dae4116e468987681745404a3 100644 (file)
@@ -1,8 +1,13 @@
 package de.diejungsvondertanke.tankstelle.ui;
 
 /**
- * Glorified record class for the data rows from the table. This is only used
+ * <p>
+ * Glorified record class for the data rows from the table.
+ * </p>
+ * <p>
+ * This is only used
  * for the table in the "Overview" tab in the ui
+ * </p>
  * 
  * @author Robin Cheney
  */
index 0a1cf8aa3a795d3446201d3616454f91f1681892..e5a75f9ffaced34b4cd2144b5aa753a3fff54952 100644 (file)
@@ -2,7 +2,6 @@ package de.diejungsvondertanke.tankstelle.ui;
 
 import java.io.IOException;
 
-// import de.diejungsvondertanke.tankstelle.controllers.ControllerRegistry;
 import de.diejungsvondertanke.tankstelle.controllers.FuelStationUIController;
 import javafx.application.Application;
 import javafx.fxml.FXMLLoader;
@@ -41,8 +40,15 @@ public class JFX extends Application {
     }
 
     /**
+     * <p>
      * Set the keybinds and set the default closing behaviour to run the quit()
-     * function
+     * function.
+     * </p>
+     * 
+     * <p>
+     * Yes, as of now, this is just for the fun of it and does not serve any
+     * practical purposes.
+     * </p>
      */
     private void initializeKeybinds() {
         // Override the default close behaviour
@@ -84,16 +90,25 @@ public class JFX extends Application {
         });
     }
 
+    /**
+     * Exit the program with code 0 and call {@link #quit}
+     */
     void exit() {
         quit();
         System.exit(0);
     }
 
+    /**
+     * Exit the program with code {@code status} and call {@link #quit}
+     */
     void exit(int status) {
         quit();
         System.exit(status);
     }
 
+    /**
+     * Internal function. Just to say goodbye. That's all.
+     */
     private void quit() {
         System.out.println("Exiting program, have a nice day :)");
     }