Package Controller

Class InventoryController

java.lang.Object
Controller.InventoryController

public class InventoryController extends Object
Controller for the Inventory Screen
Since:
2023-03-07
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private javafx.scene.control.Button
    Button that will add an item
    private javafx.scene.control.TextField
    TextField that allows user input to add an item
    private javafx.scene.control.TextField
    TextField that allows user input to add an item
    Connection to the database
    private javafx.scene.control.Button
    Button Button to navigate to the data trends scene
    private javafx.scene.control.Button
    Button that will delete the item
    private javafx.scene.control.TextField
    TextField that allows user input to delete an item
    private javafx.scene.control.Button
    Button Button to navigate edit menu scene
    private javafx.scene.control.Button
    Button Button to navigate employees scene
    private javafx.scene.control.Button
    Button Button to navigate inventory scene
    private javafx.scene.control.TableColumn<InventoryItem,Long>
    TableColumn displaying identificaiton numbers of all inventory items
    private javafx.scene.control.TableView<InventoryItem>
    TableView of InventoryItem that will display the entire inventory
    private javafx.scene.control.TableColumn<InventoryItem,String>
    TableColumn displaying name of all inventory items
    private javafx.scene.control.Button
    Button Button to logout
    private javafx.scene.control.Button
    Button Button to navigate order scene
    private javafx.scene.control.Button
    Button Button to navigate order history scene
    private javafx.scene.control.TableColumn<InventoryItem,Long>
    TableColumn displaying the quantity of all inventory items
    private SceneSwitch
    Switches between scenes or tabs
    private SessionData
    Current session data
    private javafx.scene.control.Button
    Button update inventory button.
    private javafx.scene.control.TextField
    TextField to allow managers to update stock through the item's name
    private javafx.scene.control.TextField
    TextField to allow managers to update stock
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructor
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Adds an item to the inventory database
    private void
    Reset all text fields that get user input for editing a menu item to null
    void
    Deletes an item from the database
    private javafx.collections.ObservableList<InventoryItem>
    Helper method to retreive all items from the Inventory.
    void
    Initialize Graphical User Interface
    void
    navButtonClicked(javafx.event.ActionEvent event)
    Handles switching to a new scene
    private void
    Initializes inventoryTable
    void
    Updates the actual database through the database
    private void
    Updates the inventoryTable in the Graphical User Interface

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • session

      private SessionData session
      Current session data
      See Also:
    • database

      private DatabaseConnect database
      Connection to the database
      See Also:
    • sceneSwitch

      private SceneSwitch sceneSwitch
      Switches between scenes or tabs
      See Also:
    • orderButton

      private javafx.scene.control.Button orderButton
      Button Button to navigate order scene
    • orderHistoryButton

      private javafx.scene.control.Button orderHistoryButton
      Button Button to navigate order history scene
    • inventoryButton

      private javafx.scene.control.Button inventoryButton
      Button Button to navigate inventory scene
    • employeesButton

      private javafx.scene.control.Button employeesButton
      Button Button to navigate employees scene
    • editMenuButton

      private javafx.scene.control.Button editMenuButton
      Button Button to navigate edit menu scene
    • dataTrendsButton

      private javafx.scene.control.Button dataTrendsButton
      Button Button to navigate to the data trends scene
    • logoutButton

      private javafx.scene.control.Button logoutButton
      Button Button to logout
    • inventoryTable

      private javafx.scene.control.TableView<InventoryItem> inventoryTable
      TableView of InventoryItem that will display the entire inventory
    • inventoryID

      private javafx.scene.control.TableColumn<InventoryItem,Long> inventoryID
      TableColumn displaying identificaiton numbers of all inventory items
    • itemName

      private javafx.scene.control.TableColumn<InventoryItem,String> itemName
      TableColumn displaying name of all inventory items
    • quantityCol

      private javafx.scene.control.TableColumn<InventoryItem,Long> quantityCol
      TableColumn displaying the quantity of all inventory items
    • updateItemID

      private javafx.scene.control.TextField updateItemID
      TextField to allow managers to update stock through the item's name
    • updateItemQuant

      private javafx.scene.control.TextField updateItemQuant
      TextField to allow managers to update stock
    • updateItem

      private javafx.scene.control.Button updateItem
      Button update inventory button. Triggers updateInventory()
    • deleteItemID

      private javafx.scene.control.TextField deleteItemID
      TextField that allows user input to delete an item
    • deleteItem

      private javafx.scene.control.Button deleteItem
      Button that will delete the item
    • addItemName

      private javafx.scene.control.TextField addItemName
      TextField that allows user input to add an item
    • addItemQuant

      private javafx.scene.control.TextField addItemQuant
      TextField that allows user input to add an item
    • addItem

      private javafx.scene.control.Button addItem
      Button that will add an item
  • Constructor Details

  • Method Details

    • initialize

      public void initialize()
      Initialize Graphical User Interface
    • setUpTable

      private void setUpTable()
      Initializes inventoryTable
    • addItem

      public void addItem()
      Adds an item to the inventory database
    • deleteItem

      public void deleteItem()
      Deletes an item from the database
    • updateInventory

      public void updateInventory()
      Updates the actual database through the database
    • clearTextFields

      private void clearTextFields()
      Reset all text fields that get user input for editing a menu item to null
    • updateTable

      private void updateTable()
      Updates the inventoryTable in the Graphical User Interface
    • getInventory

      private javafx.collections.ObservableList<InventoryItem> getInventory()
      Helper method to retreive all items from the Inventory.
      Returns:
      ObservableList of InventoryItem holding every item in the inventory