]> Git Server - tankstelle.git/commitdiff
ui redesign
authorRobin Cheney <cheneyr@eternal.ddnss.de>
Fri, 21 Nov 2025 14:06:21 +0000 (15:06 +0100)
committerRobin Cheney <cheneyr@eternal.ddnss.de>
Fri, 21 Nov 2025 14:06:21 +0000 (15:06 +0100)
src/main/java/de/diejungsvondertanke/tankstelle/FuelStation.java
src/main/java/de/diejungsvondertanke/tankstelle/LargeFuelStation.java
src/main/java/de/diejungsvondertanke/tankstelle/MediumFuelStation.java
src/main/java/de/diejungsvondertanke/tankstelle/SmallFuelStation.java
src/main/java/de/diejungsvondertanke/tankstelle/controllers/FuelStationUIController.java
src/main/resources/ui/FuelStationUI.fxml
src/main/resources/ui/NewStationTab.fxml
src/main/resources/ui/PriceTab.fxml
src/main/resources/ui/ResultTab.fxml
src/main/resources/ui/StockTab.fxml

index a3c604206ea069d99e98bb7065250cf0166c8b9d..ac8f12293d971076c46095c541c6c8bbd56de739 100644 (file)
@@ -260,4 +260,8 @@ public abstract class FuelStation {
         }
         throw new NoSuchFuelTypeError("This fuel station does not have fuel of the given type");
     }
+
+    public String getSimpleName() {
+        return null;
+    }
 }
\ No newline at end of file
index b2a95c32347cfd4e807047179c98ca6da1cd4269..ed4ab66d23f2b35eb0ed50dd5d18f6655d737b4a 100644 (file)
@@ -42,4 +42,8 @@ public class LargeFuelStation extends FuelStation {
     public String getSupermarket_company() {
         return supermarket_company;
     }
+
+    public String getSimpleName() {
+        return "large fuel station";
+    }
 }
index ff6636feeb9d1d8ae32e525802ae24515ecee28c..2ce9cc4956082fab59cec8fd2fb3783132d60910 100644 (file)
@@ -41,4 +41,8 @@ public class MediumFuelStation extends FuelStation {
     public float getRetail_space() {
         return retail_space;
     }
+
+    public String getSimpleName() {
+        return "medium fuel station";
+    }
 }
index e5f1e24842952a7af53dc3e3564579f77579d179..3abce91c2dbb1dc5b720aa4153f71f60ec3a4871 100644 (file)
@@ -40,4 +40,8 @@ public class SmallFuelStation extends FuelStation {
     public short getNumber_of_vending_machines() {
         return number_of_vending_machines;
     }
+
+    public String getSimpleName() {
+        return "small fuel station";
+    }
 }
index 9f4d1d4198820bffe6bd3e0529b695fcfc7e76e5..a95b2a0e402b8f98921d97a23ae5bf6d0eb4ae84 100644 (file)
@@ -36,13 +36,12 @@ public class FuelStationUIController {
     @FXML
     private HBox resultTabContainer;
     @FXML
-    private GridPane priceTabContainer;
+    private VBox priceTabContainer;
     @FXML
-    private GridPane stockTabContainer;
+    private VBox stockTabContainer;
     @FXML
     private HBox searchTabContainer;
     @FXML
-    // private GridPane newStationTabContainer;
     private VBox newStationTabContainer;
     @FXML
     private BorderPane overviewTabContainer;
@@ -169,9 +168,9 @@ public class FuelStationUIController {
     public String getDisplayName(FuelStation fs) {
         int index = Main.fuelStations.indexOf(fs);
         if (index >= 0) {
-            return "Station " + (index + 1) + " (" + fs.getClass().getSimpleName() + ")";
+            return "Station " + (index + 1) + " (" + fs.getSimpleName() + ")";
         }
-        return fs.getClass().getSimpleName();
+        return fs.getSimpleName();
     }
 
     public void appendOutput(String text) {
index e8727d2cbe0ac23cd445d08e4c8eaabf1dc9db7f..0f728416f0c6d632fbde0d30bb422fbce17f60a8 100644 (file)
@@ -14,9 +14,9 @@
                 <Insets top="10" right="10" bottom="10" left="10" />
             </padding>
             <Label text="Fuel station:" />
-            <ComboBox fx:id="comboFuelStations" prefWidth="200" />
+            <ComboBox fx:id="comboFuelStations" />
             <Label text="Fuel type:" />
-            <ComboBox fx:id="comboFuelTypes" prefWidth="150" />
+            <ComboBox fx:id="comboFuelTypes" />
         </HBox>
     </top>
 
                     <HBox fx:id="resultTabContainer" />
                 </Tab>
                 <Tab text="Change price" closable="false">
-                    <GridPane fx:id="priceTabContainer" />
+                    <VBox fx:id="priceTabContainer" />
                 </Tab>
                 <Tab text="Change stock" closable="false">
-                    <GridPane fx:id="stockTabContainer" />
+                    <VBox fx:id="stockTabContainer" />
                 </Tab>
                 <Tab text="Search" closable="false">
                     <HBox fx:id="searchTabContainer" />
index a8545338fd0897eea7b66aed124515766b45972f..6a84a41b6cc20b65bc24d7ea75262296ecd43386 100644 (file)
               <fx:define>
                      <ToggleGroup fx:id="group" />
               </fx:define>
-              <RadioButton fx:id="rbSmall" text="Small" selected="true"
+              <RadioButton fx:id="rbSmall" text="Small " selected="true"
                      toggleGroup="$group"
                      onAction="#setAttributeTypeFromSmallStation" />
-              <RadioButton fx:id="rbMedium" text="Medium"
+              <RadioButton fx:id="rbMedium" text="Medium "
                      toggleGroup="$group"
                      onAction="#setAttributeTypeFromMediumStation" />
-              <RadioButton fx:id="rbLarge" text="Large"
+              <RadioButton fx:id="rbLarge" text="Large "
                      toggleGroup="$group"
                      onAction="#setAttributeTypeFromLargeStation" />
 
index c8acfdc2364513e64b0f285c380aa55d64b8d66f..f8190ac1b2e2bdd0529204e9e53c87ceb1355649 100644 (file)
@@ -3,17 +3,18 @@
 <?import javafx.scene.layout.*?>
 <?import javafx.scene.control.*?>
 
-<GridPane xmlns:fx="http://javafx.com/fxml"
-    fx:controller="de.diejungsvondertanke.tankstelle.controllers.PriceTabController"
-    hgap="10" vgap="10">
-    <padding>
-        <Insets top="15" right="15" bottom="15" left="15"/>
-    </padding>
+<VBox xmlns:fx="http://javafx.com/fxml"
+    fx:controller="de.diejungsvondertanke.tankstelle.controllers.PriceTabController">
+    <HBox VBox.vgrow="ALWAYS" spacing="10">
 
-    <Label text="New price (€/L):" GridPane.rowIndex="0" GridPane.columnIndex="0" />
-    <TextField fx:id="txtPrice" GridPane.rowIndex="0" GridPane.columnIndex="1" />
+        <padding>
+            <Insets top="15" right="15" bottom="15" left="15" />
+        </padding>
 
-    <Button text="Change price" onAction="#save"
-        GridPane.rowIndex="1" GridPane.columnIndex="0" GridPane.columnSpan="2" />
+        <Label text="New price (€ / L):" />
+        <TextField fx:id="txtPrice" />
 
-</GridPane>
\ No newline at end of file
+        <Button text="Change price" onAction="#save" />
+    </HBox>
+
+</VBox>
\ No newline at end of file
index 1703f2c3c883fc370929c3992297e4ad70e3e07f..4a56d6d7d032177e749f75e0843b8de8601909f9 100644 (file)
@@ -5,7 +5,7 @@
 
 <HBox xmlns:fx="http://javafx.com/fxml"
     fx:controller="de.diejungsvondertanke.tankstelle.controllers.ResultTabController"
-    spacing="20">
+    spacing="20" HBox.hgrow="ALWAYS">
     <padding>
         <Insets top="15" right="15" bottom="15" left="15" />
     </padding>
@@ -18,9 +18,9 @@
         <Button text="Total stock (selection)" onAction="#handleTotalStock" />
     </VBox>
 
-    <VBox spacing="10">
+    <VBox spacing="10" HBox.hgrow="ALWAYS">
         <Label text="Fuel station selection (multiple):" />
-        <ListView fx:id="listFuelStations" prefWidth="220" />
+        <ListView fx:id="listFuelStations" HBox.hgrow="ALWAYS" />
     </VBox>
 
 </HBox>
\ No newline at end of file
index 5f5501c67f17f185454dbee8486ccb2ba4e038ac..f9771365bfbab1d2054e0c564b721d61f0ab9871 100644 (file)
@@ -3,21 +3,18 @@
 <?import javafx.scene.control.*?>
 <?import javafx.scene.layout.*?>
 
-<GridPane xmlns:fx="http://javafx.com/fxml"
-      fx:controller="de.diejungsvondertanke.tankstelle.controllers.StockTabController"
-      hgap="10" vgap="10">
+<VBox xmlns:fx="http://javafx.com/fxml"
+      fx:controller="de.diejungsvondertanke.tankstelle.controllers.StockTabController"  spacing="10">
       <padding>
-            <Insets top="15" right="15" bottom="15" left="15"/>
+            <Insets top="15" right="15" bottom="15" left="15" />
       </padding>
+      <HBox>
+            <Label text="Amount (L): " />
+            <TextField fx:id="txtAmount" />
+      </HBox>
 
-      <Label text="Amount (L):" GridPane.rowIndex="0" GridPane.columnIndex="0" />
-      <TextField fx:id="txtAmount" GridPane.rowIndex="0" GridPane.columnIndex="1" />
+      <RadioButton fx:id="rbAbsolute" text="Set absolute" selected="true" />
+      <RadioButton fx:id="rbDelta" text="Change (+/-)" />
 
-      <RadioButton fx:id="rbAbsolute" text="Set absolute" selected="true"
-            GridPane.rowIndex="1" GridPane.columnIndex="0" GridPane.columnSpan="2" />
-      <RadioButton fx:id="rbDelta" text="Change (+/-)"
-            GridPane.rowIndex="2" GridPane.columnIndex="0" GridPane.columnSpan="2" />
-
-      <Button text="Change stock" onAction="#save"
-            GridPane.rowIndex="3" GridPane.columnIndex="0" GridPane.columnSpan="2" />
-</GridPane>
\ No newline at end of file
+      <Button text="Change stock" onAction="#save" />
+</VBox>
\ No newline at end of file