ahhhhhhhhhhhh
This commit is contained in:
parent
7836821c51
commit
7663a81750
50 changed files with 860 additions and 341 deletions
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Code/Steiner/fractionsSteinerTask/bin/LegacyTest.class
Normal file
BIN
Code/Steiner/fractionsSteinerTask/bin/LegacyTest.class
Normal file
Binary file not shown.
|
@ -1,33 +1,34 @@
|
|||
public class Anteil extends Bruch {
|
||||
public static Bruch verteilt = new Bruch(0, 1);
|
||||
|
||||
private static Bruch verteilt = new Bruch(0, 1);
|
||||
|
||||
// Standardkonstruktor: Anteil = 0
|
||||
public Anteil() {
|
||||
super(0, 1);
|
||||
}
|
||||
|
||||
// Konstruktor mit Zähler und Nenner
|
||||
public Anteil(int z, int n) {
|
||||
super(z, n);
|
||||
|
||||
if (n == 0) {
|
||||
throw new IllegalArgumentException("Nenner darf nicht 0 sein.");
|
||||
}
|
||||
|
||||
Bruch neuerAnteil = new Bruch(z, n);
|
||||
verteilt = verteilt.addiere(neuerAnteil);
|
||||
Bruch neueVerteilung = verteilt.addiere(neuerAnteil);
|
||||
|
||||
if (verteilt.dezimalwert() > 1) {
|
||||
System.out.println("Fehler: Der Gesamtwert der verteilten Anteile übersteigt 1.");
|
||||
verteilt = verteilt.subtrahiere(neuerAnteil); // Rollback des Fehlers
|
||||
setZaehler(0); // Setzt Anteil zurück
|
||||
if (neueVerteilung.dezimalwert() > 1) {
|
||||
System.out.println("Fehler: Der Gesamtwert der verteilten Anteile übersteigt 1/1.");
|
||||
setZaehler(0);
|
||||
setNenner(1);
|
||||
} else {
|
||||
verteilt = neueVerteilung;
|
||||
}
|
||||
}
|
||||
|
||||
// Methode, um den verteilten Anteil als double zu erhalten
|
||||
public static double getVerteilt() {
|
||||
return verteilt.dezimalwert();
|
||||
}
|
||||
|
||||
// Methode, um den verbleibenden Anteil als Bruch zu erhalten
|
||||
public static Bruch getRest() {
|
||||
public Bruch getRest() {
|
||||
Bruch eins = new Bruch(1, 1);
|
||||
return eins.subtrahiere(verteilt);
|
||||
}
|
||||
|
|
|
@ -1,57 +0,0 @@
|
|||
public class AnteilTest {
|
||||
public static void main(String[] args) {
|
||||
|
||||
// Bruch-Test
|
||||
|
||||
System.out.println("*** Aufgabe Bruch ergänzen");
|
||||
|
||||
Bruch bruch1 = new Bruch(1, 2);
|
||||
|
||||
Bruch bruch2 = new Bruch(3, 4);
|
||||
|
||||
Bruch bruch3 = bruch1.addiere(bruch2);
|
||||
|
||||
bruch3.gekuerztausgeben();
|
||||
|
||||
System.out.println("");
|
||||
|
||||
System.out.println(bruch3.dezimalwert());
|
||||
|
||||
Bruch bruch4 = bruch1.subtrahiere(bruch2);
|
||||
|
||||
bruch4.gekuerztausgeben();
|
||||
|
||||
System.out.println("");
|
||||
|
||||
System.out.println(bruch4.dezimalwert());
|
||||
|
||||
// Anteil-Test
|
||||
|
||||
System.out.println("");
|
||||
|
||||
System.out.println("*** Aufgabe Anteil");
|
||||
|
||||
int vermoegen = 200000;
|
||||
|
||||
Anteil anteil1 = new Anteil(1, 4);
|
||||
|
||||
Anteil anteil2 = new Anteil(1, 2);
|
||||
|
||||
System.out.println("Anteil anteil1: " + anteil1.bruchToString());
|
||||
|
||||
System.out.println("Betrag von anteil1: " + vermoegen * anteil1.dezimalwert());
|
||||
|
||||
System.out.println("Anteil anteil2: " + anteil2.bruchToString());
|
||||
|
||||
System.out.println("Betrag von anteil2: " + vermoegen * anteil2.dezimalwert());
|
||||
|
||||
System.out.println("");
|
||||
|
||||
// System.out.println("Verteilt: " + Anteil.verteilt.bruchToString());
|
||||
|
||||
System.out.println("Rest: " + anteil1.getRest().bruchToString());
|
||||
|
||||
System.out.println("Restbetrag: " + vermoegen * anteil1.getRest().dezimalwert());
|
||||
|
||||
}
|
||||
}
|
|
@ -1,78 +1,49 @@
|
|||
import java.util.ArrayList;
|
||||
|
||||
public class BruchTest {
|
||||
|
||||
public static void main(String[] args) {
|
||||
ArrayList<Bruch> brueche = new ArrayList<>();
|
||||
// Bruch-Test
|
||||
System.out.println("*** Aufgabe Bruch ergänzen");
|
||||
|
||||
// Test 1: Standardkonstruktor
|
||||
brueche.add(new Bruch());
|
||||
System.out.println("Test 1: " + brueche.get(0).bruchToString()); // Erwartet: 0/1
|
||||
Bruch bruch1 = new Bruch(1, 2);
|
||||
Bruch bruch2 = new Bruch(3, 4);
|
||||
Bruch bruch3 = bruch1.addiere(bruch2);
|
||||
bruch3.gekuerztausgeben();
|
||||
System.out.println(bruch3.dezimalwert());
|
||||
Bruch bruch4 = bruch1.subtrahiere(bruch2);
|
||||
bruch4.gekuerztausgeben();
|
||||
System.out.println(bruch4.dezimalwert());
|
||||
|
||||
// Test 2: Konstruktor mit einem Parameter
|
||||
brueche.add(new Bruch(3));
|
||||
System.out.println("Test 2: " + brueche.get(1).bruchToString()); // Erwartet: 3/1
|
||||
// Anteil-Test
|
||||
System.out.println("");
|
||||
System.out.println("*** Aufgabe Anteil");
|
||||
int vermoegen = 200000;
|
||||
Anteil anteil1 = new Anteil(1, 4);
|
||||
Anteil anteil2 = new Anteil(1, 2);
|
||||
System.out.println("Anteil anteil1: y" + anteil1.bruchToString());
|
||||
System.out.println("Betrag von anteil1: " + vermoegen * anteil1.dezimalwert());
|
||||
System.out.println("Anteil anteil2: " + anteil2.bruchToString());
|
||||
System.out.println("Betrag von anteil2: " + vermoegen * anteil2.dezimalwert());
|
||||
System.out.println("");
|
||||
System.out.println("Verteilt: " + Anteil.verteilt.bruchToString());
|
||||
System.out.println("Rest: " + anteil1.getRest().bruchToString());
|
||||
System.out.println("Restbetrag: " + vermoegen * anteil1.getRest().dezimalwert());
|
||||
|
||||
// Test 3: Konstruktor mit zwei Parametern (positive Werte)
|
||||
brueche.add(new Bruch(4, 8));
|
||||
System.out.println("Test 3: " + brueche.get(2).bruchToString()); // Erwartet: 4/8
|
||||
brueche.get(2).gekuerztausgeben(); // Erwartet: 1/2
|
||||
// Anteil-Test - Überprüfung auf Überschreitung
|
||||
System.out.println("");
|
||||
System.out.println("*** Aufgabe Anteil mit Überschreitung testen");
|
||||
Anteil anteil3 = new Anteil(100, 1);
|
||||
System.out.println("Anteil anteil3: " + anteil3.bruchToString());
|
||||
System.out.println("");
|
||||
|
||||
// Test 4: Konstruktor mit zwei Parametern (negative Werte)
|
||||
brueche.add(new Bruch(-4, 8));
|
||||
System.out.println("Test 4: " + brueche.get(3).bruchToString()); // Erwartet: -4/8
|
||||
brueche.get(3).gekuerztausgeben(); // Erwartet: -1/2
|
||||
try {
|
||||
Anteil neueVerteilung = anteil3;
|
||||
System.out.println("Neue Verteilung: " + neueVerteilung.bruchToString());
|
||||
if (neueVerteilung.dezimalwert() > 1) {
|
||||
throw new IllegalArgumentException("Die Anteile überschreiten 100%!");
|
||||
}
|
||||
} catch (IllegalArgumentException e) {
|
||||
System.out.println("Fehler: " + e.getMessage());
|
||||
}
|
||||
|
||||
// Test 5: Setzen von Zähler und Nenner (normal)
|
||||
brueche.get(2).setZaehler(6);
|
||||
brueche.get(2).setNenner(9);
|
||||
System.out.println("Test 5: " + brueche.get(2).bruchToString()); // Erwartet: 6/9
|
||||
brueche.get(2).gekuerztausgeben(); // Erwartet: 2/3
|
||||
|
||||
// Test 6: Setzen von Zähler und Nenner (mit Null)
|
||||
brueche.get(2).setZaehler(0);
|
||||
brueche.get(2).setNenner(9);
|
||||
System.out.println("Test 6: " + brueche.get(2).bruchToString()); // Erwartet: 0/9
|
||||
|
||||
// Test 7: Setzen von Zähler und Nenner (Division durch Null)
|
||||
brueche.get(2).setNenner(0);
|
||||
System.out.println("Test 7: " + brueche.get(2).bruchToString());
|
||||
|
||||
// Test 8: Multiplikation
|
||||
Bruch bruch4 = new Bruch(2, 3);
|
||||
Bruch produkt = brueche.get(2).multipliziere(bruch4);
|
||||
System.out.println("Test 8: " + produkt.bruchToString()); // Erwartet: 0/1
|
||||
|
||||
// Test 9: Gleichheit
|
||||
Bruch bruch5 = new Bruch(2, 3);
|
||||
Bruch bruch6 = new Bruch(4, 6);
|
||||
System.out.println("Test 9: " + bruch5.equals(bruch6)); // Erwartet: true
|
||||
|
||||
// Test 10: Ungleichheit
|
||||
Bruch bruch7 = new Bruch(1, 2);
|
||||
System.out.println("Test 10: " + bruch5.equals(bruch7)); // Erwartet: false
|
||||
|
||||
// Test 11: Addition (positive und negative Werte)
|
||||
Bruch bruch8 = new Bruch(1, 4);
|
||||
Bruch summe = bruch5.addiere(bruch8);
|
||||
System.out.println("Test 11: " + summe.bruchToString()); // Erwartet: 11/12
|
||||
|
||||
// Test 12: Subtraktion (negatives Ergebnis)
|
||||
Bruch bruch9 = new Bruch(3, 4);
|
||||
Bruch differenz = bruch5.subtrahiere(bruch9);
|
||||
System.out.println("Test 12: " + differenz.bruchToString()); // Erwartet: -1/12
|
||||
|
||||
// Test 13: Dezimalwert
|
||||
double dezimalwert = bruch5.dezimalwert();
|
||||
System.out.println("Test 13: " + dezimalwert); // Erwartet: 0.6666666666666666 (2/3)
|
||||
|
||||
// Test 14: Dezimalwert eines anderen Bruchs
|
||||
Bruch bruch10 = new Bruch(3, 4);
|
||||
double dezimalwert2 = bruch10.dezimalwert();
|
||||
System.out.println("Test 14: " + dezimalwert2); // Erwartet: 0.75
|
||||
|
||||
// Test 16: Dezimalwert eines anderen Bruchs (null)
|
||||
Bruch bruch11 = new Bruch(3, 0);
|
||||
double dezimalwert3 = bruch11.dezimalwert();
|
||||
System.out.println("Test 15: " + dezimalwert3); // Erwartet: 0
|
||||
}
|
||||
}
|
78
Code/Steiner/fractionsSteinerTask/src/LegacyTest.java
Normal file
78
Code/Steiner/fractionsSteinerTask/src/LegacyTest.java
Normal file
|
@ -0,0 +1,78 @@
|
|||
import java.util.ArrayList;
|
||||
|
||||
public class LegacyTest {
|
||||
public static void main(String[] args) {
|
||||
ArrayList<Bruch> brueche = new ArrayList<>();
|
||||
|
||||
// Test 1: Standardkonstruktor
|
||||
brueche.add(new Bruch());
|
||||
System.out.println("Test 1: " + brueche.get(0).bruchToString()); // Erwartet: 0/1
|
||||
|
||||
// Test 2: Konstruktor mit einem Parameter
|
||||
brueche.add(new Bruch(3));
|
||||
System.out.println("Test 2: " + brueche.get(1).bruchToString()); // Erwartet: 3/1
|
||||
|
||||
// Test 3: Konstruktor mit zwei Parametern (positive Werte)
|
||||
brueche.add(new Bruch(4, 8));
|
||||
System.out.println("Test 3: " + brueche.get(2).bruchToString()); // Erwartet: 4/8
|
||||
brueche.get(2).gekuerztausgeben(); // Erwartet: 1/2
|
||||
|
||||
// Test 4: Konstruktor mit zwei Parametern (negative Werte)
|
||||
brueche.add(new Bruch(-4, 8));
|
||||
System.out.println("Test 4: " + brueche.get(3).bruchToString()); // Erwartet: -4/8
|
||||
brueche.get(3).gekuerztausgeben(); // Erwartet: -1/2
|
||||
|
||||
// Test 5: Setzen von Zähler und Nenner (normal)
|
||||
brueche.get(2).setZaehler(6);
|
||||
brueche.get(2).setNenner(9);
|
||||
System.out.println("Test 5: " + brueche.get(2).bruchToString()); // Erwartet: 6/9
|
||||
brueche.get(2).gekuerztausgeben(); // Erwartet: 2/3
|
||||
|
||||
// Test 6: Setzen von Zähler und Nenner (mit Null)
|
||||
brueche.get(2).setZaehler(0);
|
||||
brueche.get(2).setNenner(9);
|
||||
System.out.println("Test 6: " + brueche.get(2).bruchToString()); // Erwartet: 0/9
|
||||
|
||||
// Test 7: Setzen von Zähler und Nenner (Division durch Null)
|
||||
brueche.get(2).setNenner(0);
|
||||
System.out.println("Test 7: " + brueche.get(2).bruchToString());
|
||||
|
||||
// Test 8: Multiplikation
|
||||
Bruch bruch4 = new Bruch(2, 3);
|
||||
Bruch produkt = brueche.get(2).multipliziere(bruch4);
|
||||
System.out.println("Test 8: " + produkt.bruchToString()); // Erwartet: 0/1
|
||||
|
||||
// Test 9: Gleichheit
|
||||
Bruch bruch5 = new Bruch(2, 3);
|
||||
Bruch bruch6 = new Bruch(4, 6);
|
||||
System.out.println("Test 9: " + bruch5.equals(bruch6)); // Erwartet: true
|
||||
|
||||
// Test 10: Ungleichheit
|
||||
Bruch bruch7 = new Bruch(1, 2);
|
||||
System.out.println("Test 10: " + bruch5.equals(bruch7)); // Erwartet: false
|
||||
|
||||
// Test 11: Addition (positive und negative Werte)
|
||||
Bruch bruch8 = new Bruch(1, 4);
|
||||
Bruch summe = bruch5.addiere(bruch8);
|
||||
System.out.println("Test 11: " + summe.bruchToString()); // Erwartet: 11/12
|
||||
|
||||
// Test 12: Subtraktion (negatives Ergebnis)
|
||||
Bruch bruch9 = new Bruch(3, 4);
|
||||
Bruch differenz = bruch5.subtrahiere(bruch9);
|
||||
System.out.println("Test 12: " + differenz.bruchToString()); // Erwartet: -1/12
|
||||
|
||||
// Test 13: Dezimalwert
|
||||
double dezimalwert = bruch5.dezimalwert();
|
||||
System.out.println("Test 13: " + dezimalwert); // Erwartet: 0.6666666666666666 (2/3)
|
||||
|
||||
// Test 14: Dezimalwert eines anderen Bruchs
|
||||
Bruch bruch10 = new Bruch(3, 4);
|
||||
double dezimalwert2 = bruch10.dezimalwert();
|
||||
System.out.println("Test 14: " + dezimalwert2); // Erwartet: 0.75
|
||||
|
||||
// Test 16: Dezimalwert eines anderen Bruchs (null)
|
||||
Bruch bruch11 = new Bruch(3, 0);
|
||||
double dezimalwert3 = bruch11.dezimalwert();
|
||||
System.out.println("Test 15: " + dezimalwert3); // Erwartet: 0
|
||||
}
|
||||
}
|
7
Code/Steiner/hotelBookKeeping/.vscode/settings.json
vendored
Normal file
7
Code/Steiner/hotelBookKeeping/.vscode/settings.json
vendored
Normal file
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"java.project.sourcePaths": ["src"],
|
||||
"java.project.outputPath": "bin",
|
||||
"java.project.referencedLibraries": [
|
||||
"lib/**/*.jar"
|
||||
]
|
||||
}
|
18
Code/Steiner/hotelBookKeeping/README.md
Normal file
18
Code/Steiner/hotelBookKeeping/README.md
Normal file
|
@ -0,0 +1,18 @@
|
|||
## Getting Started
|
||||
|
||||
Welcome to the VS Code Java world. Here is a guideline to help you get started to write Java code in Visual Studio Code.
|
||||
|
||||
## Folder Structure
|
||||
|
||||
The workspace contains two folders by default, where:
|
||||
|
||||
- `src`: the folder to maintain sources
|
||||
- `lib`: the folder to maintain dependencies
|
||||
|
||||
Meanwhile, the compiled output files will be generated in the `bin` folder by default.
|
||||
|
||||
> If you want to customize the folder structure, open `.vscode/settings.json` and update the related settings there.
|
||||
|
||||
## Dependency Management
|
||||
|
||||
The `JAVA PROJECTS` view allows you to manage your dependencies. More details can be found [here](https://github.com/microsoft/vscode-java-dependency#manage-dependencies).
|
BIN
Code/Steiner/hotelBookKeeping/bin/Euro.class
Normal file
BIN
Code/Steiner/hotelBookKeeping/bin/Euro.class
Normal file
Binary file not shown.
BIN
Code/Steiner/hotelBookKeeping/bin/USDollar.class
Normal file
BIN
Code/Steiner/hotelBookKeeping/bin/USDollar.class
Normal file
Binary file not shown.
BIN
Code/Steiner/hotelBookKeeping/bin/Waehrung.class
Normal file
BIN
Code/Steiner/hotelBookKeeping/bin/Waehrung.class
Normal file
Binary file not shown.
BIN
Code/Steiner/hotelBookKeeping/bin/WaehrungTest.class
Normal file
BIN
Code/Steiner/hotelBookKeeping/bin/WaehrungTest.class
Normal file
Binary file not shown.
BIN
Code/Steiner/hotelBookKeeping/bin/Yen.class
Normal file
BIN
Code/Steiner/hotelBookKeeping/bin/Yen.class
Normal file
Binary file not shown.
16
Code/Steiner/hotelBookKeeping/src/Euro.java
Normal file
16
Code/Steiner/hotelBookKeeping/src/Euro.java
Normal file
|
@ -0,0 +1,16 @@
|
|||
class Euro extends Waehrung {
|
||||
private static double kurs;
|
||||
|
||||
public Euro(double betrag) {
|
||||
super(betrag);
|
||||
}
|
||||
|
||||
public static void setKurs(double kurs) {
|
||||
Euro.kurs = kurs;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double dollarBetrag() {
|
||||
return getBetrag() * kurs;
|
||||
}
|
||||
}
|
11
Code/Steiner/hotelBookKeeping/src/USDollar.java
Normal file
11
Code/Steiner/hotelBookKeeping/src/USDollar.java
Normal file
|
@ -0,0 +1,11 @@
|
|||
class USDollar extends Waehrung {
|
||||
|
||||
public USDollar(double betrag) {
|
||||
super(betrag);
|
||||
}
|
||||
|
||||
@Override
|
||||
public double dollarBetrag() {
|
||||
return this.getBetrag();
|
||||
}
|
||||
}
|
17
Code/Steiner/hotelBookKeeping/src/Waehrung.java
Normal file
17
Code/Steiner/hotelBookKeeping/src/Waehrung.java
Normal file
|
@ -0,0 +1,17 @@
|
|||
abstract class Waehrung {
|
||||
private double betrag;
|
||||
|
||||
public Waehrung(double betrag) {
|
||||
this.betrag = betrag;
|
||||
}
|
||||
|
||||
public double getBetrag() {
|
||||
return betrag;
|
||||
}
|
||||
|
||||
public void setBetrag(double betrag) {
|
||||
this.betrag = betrag;
|
||||
}
|
||||
|
||||
public abstract double dollarBetrag();
|
||||
}
|
25
Code/Steiner/hotelBookKeeping/src/WaehrungTest.java
Normal file
25
Code/Steiner/hotelBookKeeping/src/WaehrungTest.java
Normal file
|
@ -0,0 +1,25 @@
|
|||
public class WaehrungTest {
|
||||
|
||||
public static void main(String[] args) {
|
||||
Yen.setKurs(1.0 / 130);
|
||||
Euro.setKurs(1.0 / 1.05);
|
||||
Waehrung[] geld = new Waehrung[5];
|
||||
geld[0] = new USDollar(2500);
|
||||
geld[1] = new Yen(200000);
|
||||
geld[2] = new Euro(600);
|
||||
geld[3] = new USDollar(20);
|
||||
geld[4] = new Euro(500);
|
||||
double dollarGeldBetrag = berechneDollarGeldBetrag(geld);
|
||||
System.out.println(dollarGeldBetrag);
|
||||
}
|
||||
|
||||
public static double berechneDollarGeldBetrag(Waehrung[] geld) {
|
||||
double summeInDollar = 0;
|
||||
for (Waehrung waehrung : geld) {
|
||||
summeInDollar += waehrung.dollarBetrag();
|
||||
}
|
||||
return summeInDollar;
|
||||
|
||||
}
|
||||
|
||||
}
|
16
Code/Steiner/hotelBookKeeping/src/Yen.java
Normal file
16
Code/Steiner/hotelBookKeeping/src/Yen.java
Normal file
|
@ -0,0 +1,16 @@
|
|||
class Yen extends Waehrung {
|
||||
private static double kurs;
|
||||
|
||||
public Yen(double betrag) {
|
||||
super(betrag);
|
||||
}
|
||||
|
||||
public static void setKurs(double kurs) {
|
||||
Yen.kurs = kurs;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double dollarBetrag() {
|
||||
return getBetrag() * kurs;
|
||||
}
|
||||
}
|
|
@ -17,8 +17,16 @@ public class App extends Application {
|
|||
|
||||
@Override
|
||||
public void start(Stage stage) throws IOException {
|
||||
scene = new Scene(loadFXML("shop"), 640, 480);
|
||||
// Load FXML and create the scene
|
||||
scene = new Scene(loadFXML("shop"));
|
||||
|
||||
// Apply the CSS stylesheet
|
||||
scene.getStylesheets().add(getClass().getResource("styles.css").toExternalForm());
|
||||
|
||||
// Set the stage properties
|
||||
stage.setScene(scene);
|
||||
stage.setTitle("Fantasy Brigade Bookshop");
|
||||
stage.setFullScreen(true); // Make the application fullscreen
|
||||
stage.show();
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,121 @@
|
|||
package com.example;
|
||||
|
||||
import javafx.event.ActionEvent;
|
||||
import javafx.fxml.FXML;
|
||||
import javafx.scene.control.Button;
|
||||
import javafx.scene.control.Label;
|
||||
import javafx.scene.control.TableColumn;
|
||||
import javafx.scene.control.TableView;
|
||||
import javafx.scene.control.cell.PropertyValueFactory;
|
||||
|
||||
public class CartController {
|
||||
|
||||
@FXML
|
||||
private Button cartBtn;
|
||||
|
||||
@FXML
|
||||
private Button loginBtn;
|
||||
|
||||
@FXML
|
||||
private Button btnCheckOut;
|
||||
|
||||
@FXML
|
||||
private TableView<Item> cartContent;
|
||||
|
||||
@FXML
|
||||
private TableColumn<Item, String> nameColumn;
|
||||
|
||||
@FXML
|
||||
private TableColumn<Item, String> descriptionColumn;
|
||||
|
||||
@FXML
|
||||
private TableColumn<Item, Integer> quantityColumn;
|
||||
|
||||
@FXML
|
||||
private TableColumn<Item, Double> priceColumn;
|
||||
|
||||
@FXML
|
||||
private Label cartTitle;
|
||||
|
||||
@FXML
|
||||
private Label mainTitle;
|
||||
|
||||
// Initialize method to set up the TableView
|
||||
@FXML
|
||||
public void initialize() {
|
||||
nameColumn.setCellValueFactory(new PropertyValueFactory<>("name"));
|
||||
descriptionColumn.setCellValueFactory(new PropertyValueFactory<>("description"));
|
||||
quantityColumn.setCellValueFactory(new PropertyValueFactory<>("quantity"));
|
||||
priceColumn.setCellValueFactory(new PropertyValueFactory<>("price"));
|
||||
|
||||
// Populate the table with some sample data (replace with actual logic later)
|
||||
cartContent.getItems().addAll(
|
||||
new Item("Book A", "A fascinating fantasy novel.", 1, 12.99),
|
||||
new Item("Book B", "A thrilling sequel.", 2, 10.50));
|
||||
}
|
||||
|
||||
@FXML
|
||||
private void handleCartButton(ActionEvent event) {
|
||||
System.out.println("Cart button clicked!");
|
||||
// Add logic to navigate to the cart view or perform related actions
|
||||
}
|
||||
|
||||
@FXML
|
||||
private void handleLoginButton(ActionEvent event) {
|
||||
System.out.println("Login button clicked!");
|
||||
// Add logic to open the login page or dialog
|
||||
}
|
||||
|
||||
@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;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,118 @@
|
|||
package com.example;
|
||||
|
||||
import javafx.event.ActionEvent;
|
||||
import javafx.fxml.FXML;
|
||||
import javafx.scene.control.*;
|
||||
import javafx.scene.layout.HBox;
|
||||
import javafx.scene.layout.VBox;
|
||||
|
||||
public class CheckOutController {
|
||||
|
||||
@FXML
|
||||
private Label mainTitle;
|
||||
|
||||
@FXML
|
||||
private Button cartBtn;
|
||||
|
||||
@FXML
|
||||
private Button loginBtn;
|
||||
|
||||
@FXML
|
||||
private Label checkoutHeader;
|
||||
|
||||
@FXML
|
||||
private Label paymentTitle;
|
||||
|
||||
@FXML
|
||||
private Label paymentSubtitle;
|
||||
|
||||
@FXML
|
||||
private Button creditCard;
|
||||
|
||||
@FXML
|
||||
private Button bill;
|
||||
|
||||
@FXML
|
||||
private Button paypal;
|
||||
|
||||
@FXML
|
||||
private TextField fullNameField;
|
||||
|
||||
@FXML
|
||||
private TextField addressField;
|
||||
|
||||
@FXML
|
||||
private TextField cityField;
|
||||
|
||||
@FXML
|
||||
private TextField zipField;
|
||||
|
||||
@FXML
|
||||
private ComboBox<String> countryComboBox;
|
||||
|
||||
@FXML
|
||||
private TextField cardNumberField;
|
||||
|
||||
@FXML
|
||||
private TextField cardHolderNameField;
|
||||
|
||||
@FXML
|
||||
private TextField expiryDateField;
|
||||
|
||||
@FXML
|
||||
private PasswordField cvvField;
|
||||
|
||||
@FXML
|
||||
private Button submitButton;
|
||||
|
||||
public void initialize() {
|
||||
// Initialize the country combo box with some values
|
||||
countryComboBox.getItems().addAll("United States", "Canada", "United Kingdom", "Germany", "Australia");
|
||||
countryComboBox.getSelectionModel().selectFirst();
|
||||
}
|
||||
|
||||
@FXML
|
||||
private void handleCartButton(ActionEvent event) {
|
||||
System.out.println("Cart button clicked.");
|
||||
// Logic to navigate to the cart page
|
||||
}
|
||||
|
||||
@FXML
|
||||
private void handleLoginButton(ActionEvent event) {
|
||||
System.out.println("Login button clicked.");
|
||||
// Logic to navigate to the login page
|
||||
}
|
||||
|
||||
@FXML
|
||||
private void handlePaymentMethod(ActionEvent event) {
|
||||
Button clickedButton = (Button) event.getSource();
|
||||
System.out.println("Selected payment method: " + clickedButton.getId());
|
||||
// Highlight the selected payment method or save the selection
|
||||
}
|
||||
|
||||
@FXML
|
||||
private void handleSubmit(ActionEvent event) {
|
||||
System.out.println("Submit button clicked.");
|
||||
|
||||
String fullName = fullNameField.getText();
|
||||
String address = addressField.getText();
|
||||
String city = cityField.getText();
|
||||
String zip = zipField.getText();
|
||||
String country = countryComboBox.getValue();
|
||||
String cardNumber = cardNumberField.getText();
|
||||
String cardHolderName = cardHolderNameField.getText();
|
||||
String expiryDate = expiryDateField.getText();
|
||||
String cvv = cvvField.getText();
|
||||
|
||||
// Validate the input fields
|
||||
if (fullName.isEmpty() || address.isEmpty() || city.isEmpty() || zip.isEmpty() || cardNumber.isEmpty()
|
||||
|| cardHolderName.isEmpty() || expiryDate.isEmpty() || cvv.isEmpty()) {
|
||||
System.out.println("Please fill out all fields.");
|
||||
} else {
|
||||
System.out.println("Form submitted successfully.");
|
||||
System.out.printf("Billing Info: %s, %s, %s, %s, %s\n", fullName, address, city, zip, country);
|
||||
System.out.printf("Credit Card Info: %s, %s, %s, CVV: %s\n", cardNumber, cardHolderName, expiryDate, cvv);
|
||||
// Process the payment here
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,56 @@
|
|||
package com.example;
|
||||
|
||||
import javafx.fxml.FXML;
|
||||
import javafx.scene.control.Button;
|
||||
import javafx.scene.control.Label;
|
||||
import javafx.scene.control.PasswordField;
|
||||
import javafx.scene.control.TextField;
|
||||
import javafx.scene.input.MouseEvent;
|
||||
|
||||
public class LoginController {
|
||||
|
||||
@FXML
|
||||
private Label mainTitle;
|
||||
|
||||
@FXML
|
||||
private Button cartBtn;
|
||||
|
||||
@FXML
|
||||
private Button loginBtn;
|
||||
|
||||
@FXML
|
||||
private TextField usernameInput;
|
||||
|
||||
@FXML
|
||||
private PasswordField passwordInput;
|
||||
|
||||
@FXML
|
||||
private Button loginButton;
|
||||
|
||||
@FXML
|
||||
private Label footerCopyText;
|
||||
|
||||
@FXML
|
||||
private void handleCartButtonClick(MouseEvent event) {
|
||||
System.out.println("Cart button clicked.");
|
||||
// Logic to navigate to the cart page
|
||||
}
|
||||
|
||||
@FXML
|
||||
private void handleLoginButtonClick(MouseEvent event) {
|
||||
String username = usernameInput.getText();
|
||||
String password = passwordInput.getText();
|
||||
|
||||
if (validateCredentials(username, password)) {
|
||||
System.out.println("Login successful!");
|
||||
// Navigate to the main page or user dashboard
|
||||
} else {
|
||||
System.out.println("Invalid username or password.");
|
||||
}
|
||||
}
|
||||
|
||||
private boolean validateCredentials(String username, String password) {
|
||||
// Replace this with actual authentication logic
|
||||
return "user".equals(username) && "password".equals(password);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,87 @@
|
|||
package com.example;
|
||||
|
||||
import javafx.fxml.FXML;
|
||||
import javafx.scene.control.Button;
|
||||
import javafx.scene.control.Label;
|
||||
import javafx.scene.control.TextField;
|
||||
import javafx.scene.input.MouseEvent;
|
||||
|
||||
public class RegisterController {
|
||||
|
||||
@FXML
|
||||
private Label mainTitle;
|
||||
|
||||
@FXML
|
||||
private Button cartBtn;
|
||||
|
||||
@FXML
|
||||
private Button loginBtn;
|
||||
|
||||
@FXML
|
||||
private TextField nameInput;
|
||||
|
||||
@FXML
|
||||
private TextField surnameInput;
|
||||
|
||||
@FXML
|
||||
private TextField emailInput;
|
||||
|
||||
@FXML
|
||||
private TextField phoneInput;
|
||||
|
||||
@FXML
|
||||
private TextField streetInput;
|
||||
|
||||
@FXML
|
||||
private TextField cityInput;
|
||||
|
||||
@FXML
|
||||
private TextField cityCodeInput;
|
||||
|
||||
@FXML
|
||||
private Button createAccountButton;
|
||||
|
||||
@FXML
|
||||
private Label footerCopyText;
|
||||
|
||||
@FXML
|
||||
private void handleCartButtonClick(MouseEvent event) {
|
||||
System.out.println("Cart button clicked.");
|
||||
// Logic to navigate to the cart page
|
||||
}
|
||||
|
||||
@FXML
|
||||
private void handleLoginButtonClick(MouseEvent event) {
|
||||
System.out.println("Login button clicked.");
|
||||
// Logic to navigate to the login page
|
||||
}
|
||||
|
||||
@FXML
|
||||
private void handleCreateAccountButtonClick(MouseEvent event) {
|
||||
String name = nameInput.getText();
|
||||
String surname = surnameInput.getText();
|
||||
String email = emailInput.getText();
|
||||
String phone = phoneInput.getText();
|
||||
String street = streetInput.getText();
|
||||
String city = cityInput.getText();
|
||||
String cityCode = cityCodeInput.getText();
|
||||
|
||||
if (validateForm(name, surname, email, phone, street, city, cityCode)) {
|
||||
System.out.println("Account created successfully!");
|
||||
System.out.println("Name: " + name + " " + surname);
|
||||
System.out.println("Email: " + email);
|
||||
System.out.println("Phone: " + phone);
|
||||
System.out.println("Address: " + street + ", " + city + " - " + cityCode);
|
||||
// Add logic to save user data or navigate to a new page
|
||||
} else {
|
||||
System.out.println("Please fill in all the fields correctly.");
|
||||
}
|
||||
}
|
||||
|
||||
private boolean validateForm(String name, String surname, String email, String phone, String street, String city,
|
||||
String cityCode) {
|
||||
// Basic validation to ensure no fields are empty
|
||||
return !(name.isEmpty() || surname.isEmpty() || email.isEmpty() || phone.isEmpty() || street.isEmpty()
|
||||
|| city.isEmpty() || cityCode.isEmpty());
|
||||
}
|
||||
}
|
|
@ -0,0 +1,132 @@
|
|||
package com.example;
|
||||
|
||||
import javafx.fxml.FXML;
|
||||
import javafx.scene.control.Button;
|
||||
import javafx.scene.control.Label;
|
||||
import javafx.scene.control.TextArea;
|
||||
|
||||
public class ShopController {
|
||||
|
||||
@FXML
|
||||
private Button cartBtn;
|
||||
|
||||
@FXML
|
||||
private Button loginBtn;
|
||||
|
||||
@FXML
|
||||
private Button cardBtn1;
|
||||
|
||||
@FXML
|
||||
private Button cardBtn2;
|
||||
|
||||
@FXML
|
||||
private Button cardBtn3;
|
||||
|
||||
@FXML
|
||||
private Button cardBtn4;
|
||||
|
||||
@FXML
|
||||
private Button cardBtn5;
|
||||
|
||||
@FXML
|
||||
private Button cardBtn6;
|
||||
|
||||
@FXML
|
||||
private Button cardBtn7;
|
||||
|
||||
@FXML
|
||||
private Button cardBtn8;
|
||||
|
||||
@FXML
|
||||
private Label mainTitle;
|
||||
|
||||
@FXML
|
||||
private TextArea cardText1;
|
||||
|
||||
@FXML
|
||||
private TextArea cardText2;
|
||||
|
||||
@FXML
|
||||
private TextArea cardText3;
|
||||
|
||||
@FXML
|
||||
private TextArea cardText4;
|
||||
|
||||
@FXML
|
||||
private TextArea cardText5;
|
||||
|
||||
@FXML
|
||||
private TextArea cardText6;
|
||||
|
||||
@FXML
|
||||
private TextArea cardText7;
|
||||
|
||||
@FXML
|
||||
private TextArea cardText8;
|
||||
|
||||
@FXML
|
||||
public void initialize() {
|
||||
// Initialization logic can go here.
|
||||
System.out.println("ShopController initialized.");
|
||||
}
|
||||
|
||||
@FXML
|
||||
private void handleCartButton() {
|
||||
System.out.println("Cart button clicked!");
|
||||
// Logic for displaying the cart.
|
||||
}
|
||||
|
||||
@FXML
|
||||
private void handleLoginButton() {
|
||||
System.out.println("Login button clicked!");
|
||||
// Logic for handling login.
|
||||
}
|
||||
|
||||
@FXML
|
||||
private void handleAddToCartButton1() {
|
||||
System.out.println("Added 'Lord of the Rings' to cart!");
|
||||
// Logic for adding the first book to the cart.
|
||||
}
|
||||
|
||||
@FXML
|
||||
private void handleAddToCartButton2() {
|
||||
System.out.println("Added 'The Wheel of Time' to cart!");
|
||||
// Logic for adding the second book to the cart.
|
||||
}
|
||||
|
||||
@FXML
|
||||
private void handleAddToCartButton3() {
|
||||
System.out.println("Added 'The Chronicles of Narnia' to cart!");
|
||||
// Logic for adding the third book to the cart.
|
||||
}
|
||||
|
||||
@FXML
|
||||
private void handleAddToCartButton4() {
|
||||
System.out.println("Added 'The Earthsea Cycle' to cart!");
|
||||
// Logic for adding the fourth book to the cart.
|
||||
}
|
||||
|
||||
@FXML
|
||||
private void handleAddToCartButton5() {
|
||||
System.out.println("Added 'The First Law Trilogy' to cart!");
|
||||
// Logic for adding the fifth book to the cart.
|
||||
}
|
||||
|
||||
@FXML
|
||||
private void handleAddToCartButton6() {
|
||||
System.out.println("Added 'The Kingkiller Chronicle' to cart!");
|
||||
// Logic for adding the sixth book to the cart.
|
||||
}
|
||||
|
||||
@FXML
|
||||
private void handleAddToCartButton7() {
|
||||
System.out.println("Added 'The Mistborn Series' to cart!");
|
||||
// Logic for adding the seventh book to the cart.
|
||||
}
|
||||
|
||||
@FXML
|
||||
private void handleAddToCartButton8() {
|
||||
System.out.println("Added 'The Stormlight Archive' to cart!");
|
||||
// Logic for adding the eighth book to the cart.
|
||||
}
|
||||
}
|
|
@ -1,5 +0,0 @@
|
|||
package com.example;
|
||||
|
||||
public class cartController {
|
||||
|
||||
}
|
|
@ -1,45 +0,0 @@
|
|||
package com.example;
|
||||
|
||||
import javafx.fxml.FXML;
|
||||
import javafx.scene.control.Button;
|
||||
import javafx.scene.control.ComboBox;
|
||||
import javafx.scene.control.PasswordField;
|
||||
import javafx.scene.control.TextField;
|
||||
import javafx.scene.layout.GridPane;
|
||||
|
||||
public class checkOutController {
|
||||
|
||||
@FXML
|
||||
private TextField addressField;
|
||||
|
||||
@FXML
|
||||
private TextField addressField1;
|
||||
|
||||
@FXML
|
||||
private GridPane billingForm;
|
||||
|
||||
@FXML
|
||||
private TextField cardHolderNameField;
|
||||
|
||||
@FXML
|
||||
private TextField cardNumberField;
|
||||
|
||||
@FXML
|
||||
private TextField cityField;
|
||||
|
||||
@FXML
|
||||
private ComboBox<?> countryComboBox;
|
||||
|
||||
@FXML
|
||||
private PasswordField cvvField;
|
||||
|
||||
@FXML
|
||||
private TextField expiryDateField;
|
||||
|
||||
@FXML
|
||||
private Button submitButton;
|
||||
|
||||
@FXML
|
||||
private TextField zipField;
|
||||
|
||||
}
|
|
@ -1,5 +0,0 @@
|
|||
package com.example;
|
||||
|
||||
public class loginController {
|
||||
|
||||
}
|
|
@ -1,5 +0,0 @@
|
|||
package com.example;
|
||||
|
||||
public class registerController {
|
||||
|
||||
}
|
|
@ -1,5 +0,0 @@
|
|||
package com.example;
|
||||
|
||||
public class shopController {
|
||||
|
||||
}
|
|
@ -13,7 +13,7 @@
|
|||
<?import javafx.scene.layout.RowConstraints?>
|
||||
<?import javafx.scene.layout.VBox?>
|
||||
|
||||
<BorderPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="800.0" prefWidth="1200.0" xmlns="http://javafx.com/javafx/23.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.example.cartController">
|
||||
<fx:root maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="800.0" prefWidth="1200.0" type="BorderPane" xmlns="http://javafx.com/javafx/23.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.example.cartController">
|
||||
<top>
|
||||
<HBox id="header" alignment="CENTER" prefHeight="60.0" prefWidth="631.0" spacing="20.0" styleClass="header" BorderPane.alignment="CENTER">
|
||||
<children>
|
||||
|
@ -48,12 +48,12 @@
|
|||
<children>
|
||||
<Button id="btnCheckOut" mnemonicParsing="false" styleClass="btnCheckOut" text="Check out" GridPane.rowIndex="2" />
|
||||
<Label id="cartTitle" styleClass="cartTitle" text="Your cart" />
|
||||
<TableView prefHeight="0.0" prefWidth="364.0" GridPane.rowIndex="1">
|
||||
<TableView id="cartContent" prefHeight="0.0" prefWidth="364.0" GridPane.rowIndex="1">
|
||||
<columns>
|
||||
<TableColumn prefWidth="243.0" text="Name" />
|
||||
<TableColumn prefWidth="615.0" text="Description" />
|
||||
<TableColumn minWidth="0.0" prefWidth="154.0" text="Quantaty" />
|
||||
<TableColumn minWidth="0.0" prefWidth="147.0" text="Price" />
|
||||
<TableColumn id="nameColumn" prefWidth="243.0" text="Name" />
|
||||
<TableColumn id="descriptionColumn" prefWidth="615.0" text="Description" />
|
||||
<TableColumn id="quantityColumn" minWidth="0.0" prefWidth="154.0" text="Quantity" />
|
||||
<TableColumn id="priceColumn" minWidth="0.0" prefWidth="147.0" text="Price" />
|
||||
</columns>
|
||||
</TableView>
|
||||
</children>
|
||||
|
@ -97,4 +97,4 @@
|
|||
</children>
|
||||
</VBox>
|
||||
</bottom>
|
||||
</BorderPane>
|
||||
</fx:root>
|
||||
|
|
|
@ -18,13 +18,8 @@
|
|||
<top>
|
||||
<HBox id="header" alignment="CENTER" prefHeight="60.0" prefWidth="631.0" spacing="20.0" styleClass="header" BorderPane.alignment="CENTER">
|
||||
<children>
|
||||
<!-- Main Title -->
|
||||
<Label id="mainTitle" styleClass="mainTitle" text="Bookshop - Fantasy Brigade" />
|
||||
|
||||
<!-- Spacer for alignment -->
|
||||
<Pane HBox.hgrow="ALWAYS" />
|
||||
|
||||
<!-- Buttons -->
|
||||
<Pane id="headerSpacer" HBox.hgrow="ALWAYS" />
|
||||
<Button id="cartBtn" mnemonicParsing="false" styleClass="cartBtn" text="Cart" />
|
||||
<Button id="loginBtn" mnemonicParsing="false" styleClass="loginBtn" text="Login" />
|
||||
</children>
|
||||
|
@ -72,72 +67,52 @@
|
|||
</VBox>
|
||||
</bottom>
|
||||
<center>
|
||||
<GridPane id="main" styleClass="main" BorderPane.alignment="CENTER">
|
||||
<columnConstraints>
|
||||
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
|
||||
</columnConstraints>
|
||||
<rowConstraints>
|
||||
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
|
||||
</rowConstraints>
|
||||
<GridPane id="main" alignment="TOP_CENTER" styleClass="main" BorderPane.alignment="CENTER">
|
||||
<children>
|
||||
<GridPane fx:id="billingForm" alignment="TOP_CENTER" hgap="10" prefHeight="600.0" prefWidth="800.0" style="-fx-background-color: rgba(238, 130, 238, 0.8);" vgap="20">
|
||||
<GridPane id="billingForm" alignment="TOP_CENTER" hgap="10" prefHeight="600.0" prefWidth="800.0" style="-fx-background-color: rgba(238, 130, 238, 0.8);" vgap="20">
|
||||
<children>
|
||||
<!-- Check Out Header -->
|
||||
<Label id="checkoutHeader" style="-fx-font-size: 24px; -fx-font-weight: bold;" text="Check out" textFill="WHITE" GridPane.columnSpan="2" GridPane.rowIndex="0" />
|
||||
|
||||
<!-- Payment Title -->
|
||||
<Label id="paymentTitle" style="-fx-font-size: 30px; -fx-font-weight: bold;" text="Payment" textFill="WHITE" GridPane.columnSpan="2" GridPane.rowIndex="1" />
|
||||
<Label id="paymentSubtitle" style="-fx-font-size: 14px;" text="Choose payment method below" textFill="WHITE" GridPane.columnSpan="2" GridPane.rowIndex="2" />
|
||||
|
||||
<!-- Payment Icons -->
|
||||
<HBox id="paymentMethods" alignment="CENTER" spacing="20" GridPane.columnSpan="2" GridPane.rowIndex="3">
|
||||
<Button id="creditCard" mnemonicParsing="false" styleClass="creditCard" />
|
||||
<Button id="bill" mnemonicParsing="false" styleClass="bill" />
|
||||
<Button id="paypal" mnemonicParsing="false" styleClass="paypal" />
|
||||
</HBox>
|
||||
|
||||
<!-- Billing Info Section -->
|
||||
<Label id="billingInfoTitle" style="-fx-font-size: 18px; -fx-font-weight: bold;" text="Billing Info" textFill="WHITE" GridPane.columnIndex="0" GridPane.rowIndex="4" />
|
||||
<HBox id="billingName" spacing="10" GridPane.columnIndex="0" GridPane.rowIndex="5">
|
||||
<Label id="fullNameLabel" text="Full Name:" textFill="WHITE" />
|
||||
<TextField fx:id="addressField1" prefWidth="200" promptText="Jon Doe" />
|
||||
<TextField id="fullNameField" fx:id="addressField1" prefWidth="200" promptText="Jon Doe" />
|
||||
</HBox>
|
||||
|
||||
<HBox id="billingAddress" spacing="10" GridPane.columnIndex="0" GridPane.rowIndex="6">
|
||||
<Label id="addressLabel" text="Address:" textFill="WHITE" />
|
||||
<TextField fx:id="addressField" prefWidth="200" promptText="497 Evergreen Rd." />
|
||||
<TextField id="addressField" fx:id="addressField" prefWidth="200" promptText="497 Evergreen Rd." />
|
||||
</HBox>
|
||||
|
||||
<HBox id="billingCityZip" spacing="10" GridPane.columnIndex="0" GridPane.rowIndex="7">
|
||||
<Label id="cityLabel" text="City:" textFill="WHITE" />
|
||||
<TextField fx:id="cityField" prefWidth="100" promptText="Roseville" />
|
||||
<TextField id="cityField" fx:id="cityField" prefWidth="100" promptText="Roseville" />
|
||||
<Label id="zipLabel" text="ZIP Code:" textFill="WHITE" />
|
||||
<TextField fx:id="zipField" prefWidth="80" promptText="95673" />
|
||||
<TextField id="zipField" fx:id="zipField" prefWidth="80" promptText="95673" />
|
||||
</HBox>
|
||||
|
||||
<HBox id="billingCountry" spacing="10" GridPane.columnIndex="0" GridPane.rowIndex="8">
|
||||
<Label id="countryLabel" text="Country:" textFill="WHITE" />
|
||||
<ComboBox fx:id="countryComboBox" prefWidth="150.0" />
|
||||
<ComboBox id="countryComboBox" fx:id="countryComboBox" prefWidth="150.0" />
|
||||
</HBox>
|
||||
|
||||
<!-- Credit Card Info Section -->
|
||||
<Label id="creditCardInfoTitle" style="-fx-font-size: 18px; -fx-font-weight: bold;" text="Credit Card Info" textFill="WHITE" GridPane.columnIndex="1" GridPane.rowIndex="4" />
|
||||
<HBox id="creditCardNumber" spacing="10" GridPane.columnIndex="1" GridPane.rowIndex="5">
|
||||
<Label id="cardNumberLabel" text="Card Number:" textFill="WHITE" />
|
||||
<TextField fx:id="cardNumberField" prefWidth="200" promptText="1234 5678 3456 2456" />
|
||||
<TextField id="cardNumberField" fx:id="cardNumberField" prefWidth="200" promptText="1234 5678 3456 2456" />
|
||||
</HBox>
|
||||
<HBox id="creditCardHolder" spacing="10" GridPane.columnIndex="1" GridPane.rowIndex="6">
|
||||
<Label id="cardHolderNameLabel" text="Cardholder Name:" textFill="WHITE" />
|
||||
<TextField fx:id="cardHolderNameField" prefWidth="200" promptText="John Doe" />
|
||||
<TextField id="cardHolderNameField" fx:id="cardHolderNameField" prefWidth="200" promptText="John Doe" />
|
||||
</HBox>
|
||||
<HBox id="creditCardExpiry" spacing="10" GridPane.columnIndex="1" GridPane.rowIndex="7">
|
||||
<Label id="expiryDateLabel" text="Expire Date:" textFill="WHITE" />
|
||||
<TextField fx:id="expiryDateField" prefWidth="80" promptText="MM / YY" />
|
||||
<TextField id="expiryDateField" fx:id="expiryDateField" prefWidth="80" promptText="MM / YY" />
|
||||
<Label id="cvvLabel" text="CVV:" textFill="WHITE" />
|
||||
<PasswordField fx:id="cvvField" />
|
||||
<PasswordField id="cvvField" fx:id="cvvField" />
|
||||
</HBox>
|
||||
|
||||
<!-- Submit Button -->
|
||||
<Button id="submitBtn" fx:id="submitButton" alignment="CENTER" contentDisplay="CENTER" prefWidth="150" style="-fx-alignment: #4CAF50; -fx-text-fill: white; -fx-font-size: 16px; -fx-font-weight: bold;" styleClass="cartBtn" text="Submit" GridPane.columnSpan="2" GridPane.rowIndex="9" />
|
||||
</children>
|
||||
<columnConstraints>
|
||||
|
@ -156,17 +131,14 @@
|
|||
<RowConstraints />
|
||||
<RowConstraints />
|
||||
</rowConstraints>
|
||||
<opaqueInsets>
|
||||
<Insets />
|
||||
</opaqueInsets>
|
||||
<GridPane.margin>
|
||||
<Insets />
|
||||
</GridPane.margin>
|
||||
<padding>
|
||||
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0" />
|
||||
</padding>
|
||||
</GridPane>
|
||||
</children>
|
||||
<columnConstraints>
|
||||
<ColumnConstraints />
|
||||
</columnConstraints>
|
||||
<rowConstraints>
|
||||
<RowConstraints />
|
||||
</rowConstraints>
|
||||
</GridPane>
|
||||
</center>
|
||||
</BorderPane>
|
||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -13,7 +13,7 @@
|
|||
<?import javafx.scene.layout.RowConstraints?>
|
||||
<?import javafx.scene.layout.VBox?>
|
||||
|
||||
<BorderPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="800.0" prefWidth="1200.0" xmlns="http://javafx.com/javafx/23.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.example.cartController">
|
||||
<fx:root maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="800.0" prefWidth="1200.0" type="BorderPane" xmlns="http://javafx.com/javafx/23.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.example.cartController">
|
||||
<top>
|
||||
<HBox id="header" alignment="CENTER" prefHeight="60.0" prefWidth="631.0" spacing="20.0" styleClass="header" BorderPane.alignment="CENTER">
|
||||
<children>
|
||||
|
@ -48,12 +48,12 @@
|
|||
<children>
|
||||
<Button id="btnCheckOut" mnemonicParsing="false" styleClass="btnCheckOut" text="Check out" GridPane.rowIndex="2" />
|
||||
<Label id="cartTitle" styleClass="cartTitle" text="Your cart" />
|
||||
<TableView prefHeight="0.0" prefWidth="364.0" GridPane.rowIndex="1">
|
||||
<TableView id="cartContent" prefHeight="0.0" prefWidth="364.0" GridPane.rowIndex="1">
|
||||
<columns>
|
||||
<TableColumn prefWidth="243.0" text="Name" />
|
||||
<TableColumn prefWidth="615.0" text="Description" />
|
||||
<TableColumn minWidth="0.0" prefWidth="154.0" text="Quantaty" />
|
||||
<TableColumn minWidth="0.0" prefWidth="147.0" text="Price" />
|
||||
<TableColumn id="nameColumn" prefWidth="243.0" text="Name" />
|
||||
<TableColumn id="descriptionColumn" prefWidth="615.0" text="Description" />
|
||||
<TableColumn id="quantityColumn" minWidth="0.0" prefWidth="154.0" text="Quantity" />
|
||||
<TableColumn id="priceColumn" minWidth="0.0" prefWidth="147.0" text="Price" />
|
||||
</columns>
|
||||
</TableView>
|
||||
</children>
|
||||
|
@ -97,4 +97,4 @@
|
|||
</children>
|
||||
</VBox>
|
||||
</bottom>
|
||||
</BorderPane>
|
||||
</fx:root>
|
||||
|
|
Binary file not shown.
|
@ -18,13 +18,8 @@
|
|||
<top>
|
||||
<HBox id="header" alignment="CENTER" prefHeight="60.0" prefWidth="631.0" spacing="20.0" styleClass="header" BorderPane.alignment="CENTER">
|
||||
<children>
|
||||
<!-- Main Title -->
|
||||
<Label id="mainTitle" styleClass="mainTitle" text="Bookshop - Fantasy Brigade" />
|
||||
|
||||
<!-- Spacer for alignment -->
|
||||
<Pane HBox.hgrow="ALWAYS" />
|
||||
|
||||
<!-- Buttons -->
|
||||
<Pane id="headerSpacer" HBox.hgrow="ALWAYS" />
|
||||
<Button id="cartBtn" mnemonicParsing="false" styleClass="cartBtn" text="Cart" />
|
||||
<Button id="loginBtn" mnemonicParsing="false" styleClass="loginBtn" text="Login" />
|
||||
</children>
|
||||
|
@ -72,72 +67,52 @@
|
|||
</VBox>
|
||||
</bottom>
|
||||
<center>
|
||||
<GridPane id="main" styleClass="main" BorderPane.alignment="CENTER">
|
||||
<columnConstraints>
|
||||
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
|
||||
</columnConstraints>
|
||||
<rowConstraints>
|
||||
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
|
||||
</rowConstraints>
|
||||
<GridPane id="main" alignment="TOP_CENTER" styleClass="main" BorderPane.alignment="CENTER">
|
||||
<children>
|
||||
<GridPane fx:id="billingForm" alignment="TOP_CENTER" hgap="10" prefHeight="600.0" prefWidth="800.0" style="-fx-background-color: rgba(238, 130, 238, 0.8);" vgap="20">
|
||||
<GridPane id="billingForm" alignment="TOP_CENTER" hgap="10" prefHeight="600.0" prefWidth="800.0" style="-fx-background-color: rgba(238, 130, 238, 0.8);" vgap="20">
|
||||
<children>
|
||||
<!-- Check Out Header -->
|
||||
<Label id="checkoutHeader" style="-fx-font-size: 24px; -fx-font-weight: bold;" text="Check out" textFill="WHITE" GridPane.columnSpan="2" GridPane.rowIndex="0" />
|
||||
|
||||
<!-- Payment Title -->
|
||||
<Label id="paymentTitle" style="-fx-font-size: 30px; -fx-font-weight: bold;" text="Payment" textFill="WHITE" GridPane.columnSpan="2" GridPane.rowIndex="1" />
|
||||
<Label id="paymentSubtitle" style="-fx-font-size: 14px;" text="Choose payment method below" textFill="WHITE" GridPane.columnSpan="2" GridPane.rowIndex="2" />
|
||||
|
||||
<!-- Payment Icons -->
|
||||
<HBox id="paymentMethods" alignment="CENTER" spacing="20" GridPane.columnSpan="2" GridPane.rowIndex="3">
|
||||
<Button id="creditCard" mnemonicParsing="false" styleClass="creditCard" />
|
||||
<Button id="bill" mnemonicParsing="false" styleClass="bill" />
|
||||
<Button id="paypal" mnemonicParsing="false" styleClass="paypal" />
|
||||
</HBox>
|
||||
|
||||
<!-- Billing Info Section -->
|
||||
<Label id="billingInfoTitle" style="-fx-font-size: 18px; -fx-font-weight: bold;" text="Billing Info" textFill="WHITE" GridPane.columnIndex="0" GridPane.rowIndex="4" />
|
||||
<HBox id="billingName" spacing="10" GridPane.columnIndex="0" GridPane.rowIndex="5">
|
||||
<Label id="fullNameLabel" text="Full Name:" textFill="WHITE" />
|
||||
<TextField fx:id="addressField1" prefWidth="200" promptText="Jon Doe" />
|
||||
<TextField id="fullNameField" fx:id="addressField1" prefWidth="200" promptText="Jon Doe" />
|
||||
</HBox>
|
||||
|
||||
<HBox id="billingAddress" spacing="10" GridPane.columnIndex="0" GridPane.rowIndex="6">
|
||||
<Label id="addressLabel" text="Address:" textFill="WHITE" />
|
||||
<TextField fx:id="addressField" prefWidth="200" promptText="497 Evergreen Rd." />
|
||||
<TextField id="addressField" fx:id="addressField" prefWidth="200" promptText="497 Evergreen Rd." />
|
||||
</HBox>
|
||||
|
||||
<HBox id="billingCityZip" spacing="10" GridPane.columnIndex="0" GridPane.rowIndex="7">
|
||||
<Label id="cityLabel" text="City:" textFill="WHITE" />
|
||||
<TextField fx:id="cityField" prefWidth="100" promptText="Roseville" />
|
||||
<TextField id="cityField" fx:id="cityField" prefWidth="100" promptText="Roseville" />
|
||||
<Label id="zipLabel" text="ZIP Code:" textFill="WHITE" />
|
||||
<TextField fx:id="zipField" prefWidth="80" promptText="95673" />
|
||||
<TextField id="zipField" fx:id="zipField" prefWidth="80" promptText="95673" />
|
||||
</HBox>
|
||||
|
||||
<HBox id="billingCountry" spacing="10" GridPane.columnIndex="0" GridPane.rowIndex="8">
|
||||
<Label id="countryLabel" text="Country:" textFill="WHITE" />
|
||||
<ComboBox fx:id="countryComboBox" prefWidth="150.0" />
|
||||
<ComboBox id="countryComboBox" fx:id="countryComboBox" prefWidth="150.0" />
|
||||
</HBox>
|
||||
|
||||
<!-- Credit Card Info Section -->
|
||||
<Label id="creditCardInfoTitle" style="-fx-font-size: 18px; -fx-font-weight: bold;" text="Credit Card Info" textFill="WHITE" GridPane.columnIndex="1" GridPane.rowIndex="4" />
|
||||
<HBox id="creditCardNumber" spacing="10" GridPane.columnIndex="1" GridPane.rowIndex="5">
|
||||
<Label id="cardNumberLabel" text="Card Number:" textFill="WHITE" />
|
||||
<TextField fx:id="cardNumberField" prefWidth="200" promptText="1234 5678 3456 2456" />
|
||||
<TextField id="cardNumberField" fx:id="cardNumberField" prefWidth="200" promptText="1234 5678 3456 2456" />
|
||||
</HBox>
|
||||
<HBox id="creditCardHolder" spacing="10" GridPane.columnIndex="1" GridPane.rowIndex="6">
|
||||
<Label id="cardHolderNameLabel" text="Cardholder Name:" textFill="WHITE" />
|
||||
<TextField fx:id="cardHolderNameField" prefWidth="200" promptText="John Doe" />
|
||||
<TextField id="cardHolderNameField" fx:id="cardHolderNameField" prefWidth="200" promptText="John Doe" />
|
||||
</HBox>
|
||||
<HBox id="creditCardExpiry" spacing="10" GridPane.columnIndex="1" GridPane.rowIndex="7">
|
||||
<Label id="expiryDateLabel" text="Expire Date:" textFill="WHITE" />
|
||||
<TextField fx:id="expiryDateField" prefWidth="80" promptText="MM / YY" />
|
||||
<TextField id="expiryDateField" fx:id="expiryDateField" prefWidth="80" promptText="MM / YY" />
|
||||
<Label id="cvvLabel" text="CVV:" textFill="WHITE" />
|
||||
<PasswordField fx:id="cvvField" />
|
||||
<PasswordField id="cvvField" fx:id="cvvField" />
|
||||
</HBox>
|
||||
|
||||
<!-- Submit Button -->
|
||||
<Button id="submitBtn" fx:id="submitButton" alignment="CENTER" contentDisplay="CENTER" prefWidth="150" style="-fx-alignment: #4CAF50; -fx-text-fill: white; -fx-font-size: 16px; -fx-font-weight: bold;" styleClass="cartBtn" text="Submit" GridPane.columnSpan="2" GridPane.rowIndex="9" />
|
||||
</children>
|
||||
<columnConstraints>
|
||||
|
@ -156,17 +131,14 @@
|
|||
<RowConstraints />
|
||||
<RowConstraints />
|
||||
</rowConstraints>
|
||||
<opaqueInsets>
|
||||
<Insets />
|
||||
</opaqueInsets>
|
||||
<GridPane.margin>
|
||||
<Insets />
|
||||
</GridPane.margin>
|
||||
<padding>
|
||||
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0" />
|
||||
</padding>
|
||||
</GridPane>
|
||||
</children>
|
||||
<columnConstraints>
|
||||
<ColumnConstraints />
|
||||
</columnConstraints>
|
||||
<rowConstraints>
|
||||
<RowConstraints />
|
||||
</rowConstraints>
|
||||
</GridPane>
|
||||
</center>
|
||||
</BorderPane>
|
||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -0,0 +1,8 @@
|
|||
com/example/CheckOutController.class
|
||||
com/example/App.class
|
||||
com/example/CartController.class
|
||||
module-info.class
|
||||
com/example/ShopController.class
|
||||
com/example/RegisterController.class
|
||||
com/example/LoginController.class
|
||||
com/example/CartController$Item.class
|
|
@ -0,0 +1,7 @@
|
|||
/home/sage/Desktop/Programming/IMS-java/Code/ost/JAVA-FX-PROJECT/_javafx_website_task/src/main/java/com/example/RegisterController.java
|
||||
/home/sage/Desktop/Programming/IMS-java/Code/ost/JAVA-FX-PROJECT/_javafx_website_task/src/main/java/com/example/CheckOutController.java
|
||||
/home/sage/Desktop/Programming/IMS-java/Code/ost/JAVA-FX-PROJECT/_javafx_website_task/src/main/java/com/example/CartController.java
|
||||
/home/sage/Desktop/Programming/IMS-java/Code/ost/JAVA-FX-PROJECT/_javafx_website_task/src/main/java/com/example/App.java
|
||||
/home/sage/Desktop/Programming/IMS-java/Code/ost/JAVA-FX-PROJECT/_javafx_website_task/src/main/java/com/example/LoginController.java
|
||||
/home/sage/Desktop/Programming/IMS-java/Code/ost/JAVA-FX-PROJECT/_javafx_website_task/src/main/java/com/example/ShopController.java
|
||||
/home/sage/Desktop/Programming/IMS-java/Code/ost/JAVA-FX-PROJECT/_javafx_website_task/src/main/java/module-info.java
|
Loading…
Reference in a new issue