Class CookBookFrame.CookBookButtonHandler

java.lang.Object
edu.ntnu.stud.controller.framecontroller.CookBookFrame.CookBookButtonHandler
Enclosing class:
CookBookFrame

protected static class CookBookFrame.CookBookButtonHandler extends Object
Nested class to handle the "Add" and "More" buttons for the recipes. The class creates the buttons and sets the actions for the buttons. The class also sets the style of the buttons.
  • Constructor Details

    • CookBookButtonHandler

      public CookBookButtonHandler(MainApplication mainApplication)
      The constructor for this class creates a new CookBookButtonHandler object. This is used to set the main application object. for the buttons in this class to interact with.
      Parameters:
      mainApplication - The main application object.
  • Method Details

    • setAddMoreButtons

      public javafx.scene.layout.HBox setAddMoreButtons(int index, org.json.JSONArray jsonArray, int rowCounter, CookBookFrame.CookBookJsonReader jsonHandler)
      Sets the "Add" and "More" buttons for a recipe in the JSON array. The method creates the buttons and sets the actions for the buttons. The method also sets the style of the buttons.
      Parameters:
      index - The index of the recipe in the JSON array.
      jsonArray - The JSON array containing the recipes.
      rowCounter - The row number of the recipe in the frame.
      jsonHandler - The JSON reader object.
      Returns:
      The HBox containing the "Add" and "More" buttons for the recipe.