From 15468735cdd64a0fbc92d01f6cc06d81f55fe4e4 Mon Sep 17 00:00:00 2001 From: sageTheDM Date: Sun, 12 Jan 2025 22:42:29 +0100 Subject: [PATCH] Help me dear lord --- .../src/main/java/com/example/App.java | 2 +- .../main/java/com/example/CartController.java | 68 +++++------------- .../src/main/java/com/example/Item.java | 47 ++++++++++++ .../com/example/CartController$Item.class | Bin 1381 -> 0 bytes .../classes/com/example/CartController.class | Bin 2832 -> 1740 bytes .../target/classes/com/example/Item.class | Bin 0 -> 1291 bytes 6 files changed, 67 insertions(+), 50 deletions(-) create mode 100644 Code/ost/JAVA-FX-PROJECT/_javafx_website_task/src/main/java/com/example/Item.java delete mode 100644 Code/ost/JAVA-FX-PROJECT/_javafx_website_task/target/classes/com/example/CartController$Item.class create mode 100644 Code/ost/JAVA-FX-PROJECT/_javafx_website_task/target/classes/com/example/Item.class diff --git a/Code/ost/JAVA-FX-PROJECT/_javafx_website_task/src/main/java/com/example/App.java b/Code/ost/JAVA-FX-PROJECT/_javafx_website_task/src/main/java/com/example/App.java index 6e132cf..35457c7 100644 --- a/Code/ost/JAVA-FX-PROJECT/_javafx_website_task/src/main/java/com/example/App.java +++ b/Code/ost/JAVA-FX-PROJECT/_javafx_website_task/src/main/java/com/example/App.java @@ -28,7 +28,7 @@ public class App extends Application { // Set the stage properties stage.setScene(scene); stage.setTitle("Fantasy Brigade Bookshop"); - stage.setFullScreen(true); // Make the application fullscreen + stage.setFullScreen(true); stage.show(); } diff --git a/Code/ost/JAVA-FX-PROJECT/_javafx_website_task/src/main/java/com/example/CartController.java b/Code/ost/JAVA-FX-PROJECT/_javafx_website_task/src/main/java/com/example/CartController.java index 1a2d6c0..f37d7ae 100644 --- a/Code/ost/JAVA-FX-PROJECT/_javafx_website_task/src/main/java/com/example/CartController.java +++ b/Code/ost/JAVA-FX-PROJECT/_javafx_website_task/src/main/java/com/example/CartController.java @@ -8,6 +8,8 @@ import javafx.scene.control.TableColumn; import javafx.scene.control.TableView; import javafx.scene.control.cell.PropertyValueFactory; +import java.io.IOException; + public class CartController { @FXML @@ -57,65 +59,33 @@ public class CartController { @FXML private void handleCartButton(ActionEvent event) { System.out.println("Cart button clicked!"); - // Add logic to navigate to the cart view or perform related actions + try { + // Navigate to the cart page (using the setRoot method from App) + App.setRoot("cart"); + } catch (IOException e) { + e.printStackTrace(); + } } @FXML private void handleLoginButton(ActionEvent event) { System.out.println("Login button clicked!"); - // Add logic to open the login page or dialog + try { + // Navigate to the login page + App.setRoot("login"); + } catch (IOException e) { + e.printStackTrace(); + } } @FXML private void handleCheckOutButton(ActionEvent event) { System.out.println("Checkout button clicked!"); // Add logic to proceed to checkout - } - - // Inner class to represent items in the cart - public static class Item { - private String name; - private String description; - private int quantity; - private double price; - - public Item(String name, String description, int quantity, double price) { - this.name = name; - this.description = description; - this.quantity = quantity; - this.price = price; + try { + // Navigate to the checkout page + App.setRoot("checkout"); + } catch (IOException e) { + e.printStackTrace(); } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - public int getQuantity() { - return quantity; - } - - public void setQuantity(int quantity) { - this.quantity = quantity; - } - - public double getPrice() { - return price; - } - - public void setPrice(double price) { - this.price = price; - } - } } diff --git a/Code/ost/JAVA-FX-PROJECT/_javafx_website_task/src/main/java/com/example/Item.java b/Code/ost/JAVA-FX-PROJECT/_javafx_website_task/src/main/java/com/example/Item.java new file mode 100644 index 0000000..44c83ab --- /dev/null +++ b/Code/ost/JAVA-FX-PROJECT/_javafx_website_task/src/main/java/com/example/Item.java @@ -0,0 +1,47 @@ +package com.example; + +public static class Item { + private String name; + private String description; + private int quantity; + private double price; + + public Item(String name, String description, int quantity, double price) { + this.name = name; + this.description = description; + this.quantity = quantity; + this.price = price; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public int getQuantity() { + return quantity; + } + + public void setQuantity(int quantity) { + this.quantity = quantity; + } + + public double getPrice() { + return price; + } + + public void setPrice(double price) { + this.price = price; + } +} \ No newline at end of file diff --git a/Code/ost/JAVA-FX-PROJECT/_javafx_website_task/target/classes/com/example/CartController$Item.class b/Code/ost/JAVA-FX-PROJECT/_javafx_website_task/target/classes/com/example/CartController$Item.class deleted file mode 100644 index b594320309db8ded28237a0bc61675513b284156..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1381 zcmah{T~8BH5IwhSKWJCLw$xHYL{ZuWsb7f?8eZBMn-Kgc*2D+Rwp{Cy?Jn+KP~ZGP zCTe11;)6fHA7z}mT`80{zU-YlduHa$IrsOUpT7Xy!<{5z0?Qr0SCt>^-hnHtH9Jr> z-&29_x-wX8DA`NG5SZJykL;>zd)?~e_P*>W0mHL^( zDpy+55XhN`Bf-(UiR2)VbGBe9o{~7+VoBKQ^0I^o(yWP9fmSY;-)}p zvJm76KNT9aBSZDb4;5BO@hN&{24ZXqMKQKSpJa$W$qqW%8x!Z~J43fmRK=*0^#ilk zdLLP9qmR6`)JMT88hsSM>Dm%wH1ZkEXi}G5s(+3gT3EmfEYknGG?`Hsu|y|F%tYvj zxx{qDY?x_@p9l34xP;}1O_ff@$F1+kex)ErFhosW>LKO;5DgKytXJn%wg}B55_*jx z?X=FmA~LUahr$4LOfwPD6u2^$NPd(^dn}QwfI@Y4%p(2Z9=O_`6i1-tTut`j$jLI>Q7)1kXieE;E1Y?O}_Q>Rd+L`Kpn{J?4Gb4$)`c`m~`ji7%&(?ex1t z(Mg4~Pso%l^SY!a)QrH=DdsDs<3-pq%wJwbikzfAD=HECm}=n!j@Skf&rdZ_tSJ zwXNIXMqnqVlLIc%DigM8KIO7ydU1tIZdM6gn47N<=qsukOT%>nLw_f7Lu;io;1GEA zMrsx)almR0HnYJ+G-pmjD~!W`;^eaBLuqK!VHUICa2YUdoWhraV^jnY%rK`YXb`Nc z+F>pSGf)_SDY!{sVy?GIHmIQzm+WQeSDB7x&rY@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