Added UI
This commit is contained in:
9
src/main/java/org/example/petshopdesktop/Launcher.java
Normal file
9
src/main/java/org/example/petshopdesktop/Launcher.java
Normal file
@@ -0,0 +1,9 @@
|
||||
package org.example.petshopdesktop;
|
||||
|
||||
import javafx.application.Application;
|
||||
|
||||
public class Launcher {
|
||||
public static void main(String[] args) {
|
||||
Application.launch(PetShopApplication.class, args);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package org.example.petshopdesktop;
|
||||
|
||||
import javafx.application.Application;
|
||||
import javafx.fxml.FXMLLoader;
|
||||
import javafx.scene.Scene;
|
||||
import javafx.stage.Stage;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
public class PetShopApplication extends Application {
|
||||
@Override
|
||||
public void start(Stage stage) throws IOException {
|
||||
FXMLLoader fxmlLoader = new FXMLLoader(PetShopApplication.class.getResource("main-layout-view.fxml"));
|
||||
Scene scene = new Scene(fxmlLoader.load());
|
||||
stage.setTitle("Pet Shop Manager");
|
||||
stage.setScene(scene);
|
||||
stage.show();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
package org.example.petshopdesktop.controllers;
|
||||
|
||||
import javafx.event.ActionEvent;
|
||||
import javafx.fxml.FXML;
|
||||
import javafx.scene.control.Button;
|
||||
import javafx.scene.control.TableColumn;
|
||||
import javafx.scene.control.TableView;
|
||||
import javafx.scene.control.TextField;
|
||||
|
||||
public class AdoptionController {
|
||||
|
||||
@FXML
|
||||
private Button btnAdd;
|
||||
|
||||
@FXML
|
||||
private Button btnDelete;
|
||||
|
||||
@FXML
|
||||
private Button btnEdit;
|
||||
|
||||
@FXML
|
||||
private TableColumn<?, ?> colAdoptionDate;
|
||||
|
||||
@FXML
|
||||
private TableColumn<?, ?> colAdoptionFee;
|
||||
|
||||
@FXML
|
||||
private TableColumn<?, ?> colAdoptionId;
|
||||
|
||||
@FXML
|
||||
private TableColumn<?, ?> colAdoptionStatus;
|
||||
|
||||
@FXML
|
||||
private TableColumn<?, ?> colCustomerName;
|
||||
|
||||
@FXML
|
||||
private TableColumn<?, ?> colPetId;
|
||||
|
||||
@FXML
|
||||
private TableView<?> tvAdoptions;
|
||||
|
||||
@FXML
|
||||
private TextField txtSearch;
|
||||
|
||||
@FXML
|
||||
void btnAddClicked(ActionEvent event) {
|
||||
|
||||
}
|
||||
|
||||
@FXML
|
||||
void btnDeleteClicked(ActionEvent event) {
|
||||
|
||||
}
|
||||
|
||||
@FXML
|
||||
void btnEditClicked(ActionEvent event) {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
package org.example.petshopdesktop.controllers;
|
||||
|
||||
import javafx.event.ActionEvent;
|
||||
import javafx.fxml.FXML;
|
||||
import javafx.scene.control.Button;
|
||||
import javafx.scene.control.TableColumn;
|
||||
import javafx.scene.control.TableView;
|
||||
import javafx.scene.control.TextField;
|
||||
|
||||
public class AppointmentController {
|
||||
|
||||
@FXML
|
||||
private Button btnAdd;
|
||||
|
||||
@FXML
|
||||
private Button btnDelete;
|
||||
|
||||
@FXML
|
||||
private Button btnEdit;
|
||||
|
||||
@FXML
|
||||
private TableColumn<?, ?> colAppointmentDate;
|
||||
|
||||
@FXML
|
||||
private TableColumn<?, ?> colAppointmentId;
|
||||
|
||||
@FXML
|
||||
private TableColumn<?, ?> colAppointmentStatus;
|
||||
|
||||
@FXML
|
||||
private TableColumn<?, ?> colAppointmentTime;
|
||||
|
||||
@FXML
|
||||
private TableColumn<?, ?> colCustomerName;
|
||||
|
||||
@FXML
|
||||
private TableColumn<?, ?> colPetName;
|
||||
|
||||
@FXML
|
||||
private TableColumn<?, ?> colServiceName;
|
||||
|
||||
@FXML
|
||||
private TableView<?> tvAppointments;
|
||||
|
||||
@FXML
|
||||
private TextField txtSearch;
|
||||
|
||||
@FXML
|
||||
void btnAddClicked(ActionEvent event) {
|
||||
|
||||
}
|
||||
|
||||
@FXML
|
||||
void btnDeleteClicked(ActionEvent event) {
|
||||
|
||||
}
|
||||
|
||||
@FXML
|
||||
void btnEditClicked(ActionEvent event) {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
package org.example.petshopdesktop.controllers;
|
||||
|
||||
import javafx.event.ActionEvent;
|
||||
import javafx.fxml.FXML;
|
||||
import javafx.scene.control.Button;
|
||||
import javafx.scene.control.TableColumn;
|
||||
import javafx.scene.control.TableView;
|
||||
import javafx.scene.control.TextField;
|
||||
|
||||
public class InventoryController {
|
||||
|
||||
@FXML
|
||||
private Button btnAdd;
|
||||
|
||||
@FXML
|
||||
private Button btnDelete;
|
||||
|
||||
@FXML
|
||||
private Button btnEdit;
|
||||
|
||||
@FXML
|
||||
private TableColumn<?, ?> colInventoryId;
|
||||
|
||||
@FXML
|
||||
private TableColumn<?, ?> colProductId;
|
||||
|
||||
@FXML
|
||||
private TableColumn<?, ?> colProductName;
|
||||
|
||||
@FXML
|
||||
private TableColumn<?, ?> colQuantity;
|
||||
|
||||
@FXML
|
||||
private TableView<?> tvInventory;
|
||||
|
||||
@FXML
|
||||
private TextField txtSearch;
|
||||
|
||||
@FXML
|
||||
void btnAddClicked(ActionEvent event) {
|
||||
|
||||
}
|
||||
|
||||
@FXML
|
||||
void btnDeleteClicked(ActionEvent event) {
|
||||
|
||||
}
|
||||
|
||||
@FXML
|
||||
void btnEditClicked(ActionEvent event) {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,140 @@
|
||||
package org.example.petshopdesktop.controllers;
|
||||
|
||||
import javafx.event.ActionEvent;
|
||||
import javafx.fxml.FXML;
|
||||
import javafx.fxml.FXMLLoader;
|
||||
import javafx.scene.Parent;
|
||||
import javafx.scene.control.Button;
|
||||
import javafx.scene.layout.StackPane;
|
||||
|
||||
public class MainLayoutController {
|
||||
|
||||
@FXML
|
||||
private Button btnAdoptions;
|
||||
|
||||
@FXML
|
||||
private Button btnAppointments;
|
||||
|
||||
@FXML
|
||||
private Button btnInventory;
|
||||
|
||||
@FXML
|
||||
private Button btnPets;
|
||||
|
||||
@FXML
|
||||
private Button btnProductSuppliers;
|
||||
|
||||
@FXML
|
||||
private Button btnProducts;
|
||||
|
||||
@FXML
|
||||
private Button btnSalesHistory;
|
||||
|
||||
@FXML
|
||||
private Button btnServices;
|
||||
|
||||
@FXML
|
||||
private Button btnSuppliers;
|
||||
|
||||
@FXML
|
||||
private StackPane spContentArea;
|
||||
|
||||
@FXML
|
||||
void btnAdoptionsClicked(ActionEvent event) {
|
||||
loadView("adoption-view.fxml");
|
||||
updateButtons(btnAdoptions);
|
||||
}
|
||||
|
||||
@FXML
|
||||
void btnAppointmentsClicked(ActionEvent event) {
|
||||
loadView("appointment-view.fxml");
|
||||
updateButtons(btnAppointments);
|
||||
}
|
||||
|
||||
@FXML
|
||||
void btnInventoryClicked(ActionEvent event) {
|
||||
loadView("inventory-view.fxml");
|
||||
updateButtons(btnInventory);
|
||||
}
|
||||
|
||||
@FXML
|
||||
void btnPetsClicked(ActionEvent event) {
|
||||
loadView("pet-view.fxml");
|
||||
updateButtons(btnPets);
|
||||
}
|
||||
|
||||
@FXML
|
||||
void btnProductSuppliersClicked(ActionEvent event) {
|
||||
loadView("product-supplier-view.fxml");
|
||||
updateButtons(btnProductSuppliers);
|
||||
}
|
||||
|
||||
@FXML
|
||||
void btnProductsClicked(ActionEvent event) {
|
||||
loadView("product-view.fxml");
|
||||
updateButtons(btnProducts);
|
||||
}
|
||||
|
||||
@FXML
|
||||
void btnSalesHistoryClicked(ActionEvent event) {
|
||||
loadView("sale-view.fxml");
|
||||
updateButtons(btnSalesHistory);
|
||||
}
|
||||
|
||||
@FXML
|
||||
void btnServicesClicked(ActionEvent event) {
|
||||
loadView("service-view.fxml");
|
||||
updateButtons(btnServices);
|
||||
}
|
||||
|
||||
@FXML
|
||||
void btnSuppliersClicked(ActionEvent event) {
|
||||
loadView("supplier-view.fxml");
|
||||
updateButtons(btnSuppliers);
|
||||
}
|
||||
|
||||
@FXML
|
||||
public void initialize() {
|
||||
loadView("pet-view.fxml");
|
||||
}
|
||||
|
||||
/**
|
||||
* Load a view when a button is clicked on the navigation
|
||||
* @param fxmlFile the fxmlFile name to be loaded
|
||||
*/
|
||||
private void loadView(String fxmlFile) {
|
||||
try {
|
||||
//Get the location of the fxml for view
|
||||
FXMLLoader loader = new FXMLLoader(getClass().getResource("/org/example/petshopdesktop/modelviews/" + fxmlFile));
|
||||
Parent view = loader.load();
|
||||
//Clear any content that is in the stack pane and add the new view to display
|
||||
spContentArea.getChildren().clear();
|
||||
spContentArea.getChildren().add(view);
|
||||
} catch (Exception e) {
|
||||
System.out.println("Error loading view: " + fxmlFile);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* update the button visuals when a button is clicked on the navigation
|
||||
* @param activeButton the button to be set active
|
||||
*/
|
||||
private void updateButtons(Button activeButton) {
|
||||
//reset all buttons
|
||||
Button[] BUTTONS = {btnAdoptions, btnPets, btnAppointments, btnInventory,
|
||||
btnSalesHistory, btnServices, btnSuppliers, btnProductSuppliers, btnProducts};
|
||||
for (Button button : BUTTONS) {
|
||||
//set all buttons to inactive
|
||||
button.setStyle("-fx-background-color: transparent; " +
|
||||
"-fx-text-fill: #CCCCCC; " +
|
||||
"-fx-cursor: hand");
|
||||
}
|
||||
|
||||
//set active button
|
||||
activeButton.setStyle("-fx-background-color: #FF6B6B; " +
|
||||
"-fx-text-fill: white; " +
|
||||
"-fx-cursor: hand; " +
|
||||
"-fx-background-radius: 8");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
package org.example.petshopdesktop.controllers;
|
||||
|
||||
import javafx.event.ActionEvent;
|
||||
import javafx.fxml.FXML;
|
||||
import javafx.scene.control.Button;
|
||||
import javafx.scene.control.TableColumn;
|
||||
import javafx.scene.control.TableView;
|
||||
import javafx.scene.control.TextField;
|
||||
|
||||
public class PetController {
|
||||
|
||||
@FXML
|
||||
private Button btnAdd;
|
||||
|
||||
@FXML
|
||||
private Button btnDelete;
|
||||
|
||||
@FXML
|
||||
private Button btnEdit;
|
||||
|
||||
@FXML
|
||||
private TableColumn<?, ?> colPetAge;
|
||||
|
||||
@FXML
|
||||
private TableColumn<?, ?> colPetBreed;
|
||||
|
||||
@FXML
|
||||
private TableColumn<?, ?> colPetId;
|
||||
|
||||
@FXML
|
||||
private TableColumn<?, ?> colPetName;
|
||||
|
||||
@FXML
|
||||
private TableColumn<?, ?> colPetPrice;
|
||||
|
||||
@FXML
|
||||
private TableColumn<?, ?> colPetSpecies;
|
||||
|
||||
@FXML
|
||||
private TableColumn<?, ?> colPetStatus;
|
||||
|
||||
@FXML
|
||||
private TableView<?> tvPets;
|
||||
|
||||
@FXML
|
||||
private TextField txtSearch;
|
||||
|
||||
@FXML
|
||||
void btnAddClicked(ActionEvent event) {
|
||||
|
||||
}
|
||||
|
||||
@FXML
|
||||
void btnDeleteClicked(ActionEvent event) {
|
||||
|
||||
}
|
||||
|
||||
@FXML
|
||||
void btnEditClicked(ActionEvent event) {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
package org.example.petshopdesktop.controllers;
|
||||
|
||||
import javafx.event.ActionEvent;
|
||||
import javafx.fxml.FXML;
|
||||
import javafx.scene.control.Button;
|
||||
import javafx.scene.control.TableColumn;
|
||||
import javafx.scene.control.TableView;
|
||||
import javafx.scene.control.TextField;
|
||||
|
||||
public class ProductController {
|
||||
|
||||
@FXML
|
||||
private Button btnAdd;
|
||||
|
||||
@FXML
|
||||
private Button btnDelete;
|
||||
|
||||
@FXML
|
||||
private Button btnEdit;
|
||||
|
||||
@FXML
|
||||
private TableColumn<?, ?> colProductCategory;
|
||||
|
||||
@FXML
|
||||
private TableColumn<?, ?> colProductDesc;
|
||||
|
||||
@FXML
|
||||
private TableColumn<?, ?> colProductId;
|
||||
|
||||
@FXML
|
||||
private TableColumn<?, ?> colProductName;
|
||||
|
||||
@FXML
|
||||
private TableColumn<?, ?> colProductPrice;
|
||||
|
||||
@FXML
|
||||
private TableColumn<?, ?> colProductSKU;
|
||||
|
||||
@FXML
|
||||
private TableView<?> tvProducts;
|
||||
|
||||
@FXML
|
||||
private TextField txtSearch;
|
||||
|
||||
@FXML
|
||||
void btnAddClicked(ActionEvent event) {
|
||||
|
||||
}
|
||||
|
||||
@FXML
|
||||
void btnDeleteClicked(ActionEvent event) {
|
||||
|
||||
}
|
||||
|
||||
@FXML
|
||||
void btnEditClicked(ActionEvent event) {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
package org.example.petshopdesktop.controllers;
|
||||
|
||||
import javafx.event.ActionEvent;
|
||||
import javafx.fxml.FXML;
|
||||
import javafx.scene.control.Button;
|
||||
import javafx.scene.control.TableColumn;
|
||||
import javafx.scene.control.TableView;
|
||||
import javafx.scene.control.TextField;
|
||||
|
||||
public class ProductSupplierController {
|
||||
|
||||
@FXML
|
||||
private Button btnAdd;
|
||||
|
||||
@FXML
|
||||
private Button btnDelete;
|
||||
|
||||
@FXML
|
||||
private Button btnEdit;
|
||||
|
||||
@FXML
|
||||
private TableColumn<?, ?> colCost;
|
||||
|
||||
@FXML
|
||||
private TableColumn<?, ?> colProductId;
|
||||
|
||||
@FXML
|
||||
private TableColumn<?, ?> colProductName;
|
||||
|
||||
@FXML
|
||||
private TableColumn<?, ?> colSupplierId;
|
||||
|
||||
@FXML
|
||||
private TableColumn<?, ?> colSupplierName;
|
||||
|
||||
@FXML
|
||||
private TableView<?> tvProductSuppliers;
|
||||
|
||||
@FXML
|
||||
private TextField txtSearch;
|
||||
|
||||
@FXML
|
||||
void btnAddClicked(ActionEvent event) {
|
||||
|
||||
}
|
||||
|
||||
@FXML
|
||||
void btnDeleteClicked(ActionEvent event) {
|
||||
|
||||
}
|
||||
|
||||
@FXML
|
||||
void btnEditClicked(ActionEvent event) {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
package org.example.petshopdesktop.controllers;
|
||||
|
||||
import javafx.event.ActionEvent;
|
||||
import javafx.fxml.FXML;
|
||||
import javafx.scene.control.Button;
|
||||
import javafx.scene.control.TableColumn;
|
||||
import javafx.scene.control.TableView;
|
||||
import javafx.scene.control.TextField;
|
||||
|
||||
public class SaleController {
|
||||
|
||||
@FXML
|
||||
private Button btnRefresh;
|
||||
|
||||
@FXML
|
||||
private TableColumn<?, ?> colCustomerName;
|
||||
|
||||
@FXML
|
||||
private TableColumn<?, ?> colSaleDate;
|
||||
|
||||
@FXML
|
||||
private TableColumn<?, ?> colSaleId;
|
||||
|
||||
@FXML
|
||||
private TableColumn<?, ?> colSalePaymentType;
|
||||
|
||||
@FXML
|
||||
private TableColumn<?, ?> colSaleQuantity;
|
||||
|
||||
@FXML
|
||||
private TableColumn<?, ?> colSaleTotal;
|
||||
|
||||
@FXML
|
||||
private TableColumn<?, ?> colSaleUnitPrice;
|
||||
|
||||
@FXML
|
||||
private TableColumn<?, ?> colServiceProduct;
|
||||
|
||||
@FXML
|
||||
private TableView<?> tvSales;
|
||||
|
||||
@FXML
|
||||
private TextField txtSearch;
|
||||
|
||||
@FXML
|
||||
void btnRefresh(ActionEvent event) {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
package org.example.petshopdesktop.controllers;
|
||||
|
||||
import javafx.event.ActionEvent;
|
||||
import javafx.fxml.FXML;
|
||||
import javafx.scene.control.Button;
|
||||
import javafx.scene.control.TableColumn;
|
||||
import javafx.scene.control.TableView;
|
||||
import javafx.scene.control.TextField;
|
||||
|
||||
public class ServiceController {
|
||||
|
||||
@FXML
|
||||
private Button btnAdd;
|
||||
|
||||
@FXML
|
||||
private Button btnDelete;
|
||||
|
||||
@FXML
|
||||
private Button btnEdit;
|
||||
|
||||
@FXML
|
||||
private TableColumn<?, ?> colServiceDesc;
|
||||
|
||||
@FXML
|
||||
private TableColumn<?, ?> colServiceDuration;
|
||||
|
||||
@FXML
|
||||
private TableColumn<?, ?> colServiceId;
|
||||
|
||||
@FXML
|
||||
private TableColumn<?, ?> colServiceName;
|
||||
|
||||
@FXML
|
||||
private TableColumn<?, ?> colServicePrice;
|
||||
|
||||
@FXML
|
||||
private TableView<?> tvServices;
|
||||
|
||||
@FXML
|
||||
private TextField txtSearch;
|
||||
|
||||
@FXML
|
||||
void btnAddClicked(ActionEvent event) {
|
||||
|
||||
}
|
||||
|
||||
@FXML
|
||||
void btnDeleteClicked(ActionEvent event) {
|
||||
|
||||
}
|
||||
|
||||
@FXML
|
||||
void btnEditClicked(ActionEvent event) {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
package org.example.petshopdesktop.controllers;
|
||||
|
||||
import javafx.event.ActionEvent;
|
||||
import javafx.fxml.FXML;
|
||||
import javafx.scene.control.Button;
|
||||
import javafx.scene.control.TableColumn;
|
||||
import javafx.scene.control.TableView;
|
||||
import javafx.scene.control.TextField;
|
||||
|
||||
public class SupplierController {
|
||||
|
||||
@FXML
|
||||
private Button btnAdd;
|
||||
|
||||
@FXML
|
||||
private Button btnDelete;
|
||||
|
||||
@FXML
|
||||
private Button btnEdit;
|
||||
|
||||
@FXML
|
||||
private TableColumn<?, ?> colContactPerson;
|
||||
|
||||
@FXML
|
||||
private TableColumn<?, ?> colSupplierEmail;
|
||||
|
||||
@FXML
|
||||
private TableColumn<?, ?> colSupplierId;
|
||||
|
||||
@FXML
|
||||
private TableColumn<?, ?> colSupplierName;
|
||||
|
||||
@FXML
|
||||
private TableColumn<?, ?> colSupplierPhone;
|
||||
|
||||
@FXML
|
||||
private TableView<?> tvSuppliers;
|
||||
|
||||
@FXML
|
||||
private TextField txtSearch;
|
||||
|
||||
@FXML
|
||||
void btnAddClicked(ActionEvent event) {
|
||||
|
||||
}
|
||||
|
||||
@FXML
|
||||
void btnDeleteClicked(ActionEvent event) {
|
||||
|
||||
}
|
||||
|
||||
@FXML
|
||||
void btnEditClicked(ActionEvent event) {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user