MenueController
This commit is contained in:
		@@ -6,6 +6,10 @@ import javafx.fxml.FXML;
 | 
				
			|||||||
import javafx.scene.Node;
 | 
					import javafx.scene.Node;
 | 
				
			||||||
import javafx.scene.control.*;
 | 
					import javafx.scene.control.*;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import java.time.LocalDate;
 | 
				
			||||||
 | 
					import java.time.LocalDateTime;
 | 
				
			||||||
 | 
					import java.util.List;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
public class MenueController {
 | 
					public class MenueController {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    @FXML
 | 
					    @FXML
 | 
				
			||||||
@@ -71,14 +75,26 @@ public class MenueController {
 | 
				
			|||||||
    @FXML
 | 
					    @FXML
 | 
				
			||||||
    ComboBox<String> cbPickChild;
 | 
					    ComboBox<String> cbPickChild;
 | 
				
			||||||
    @FXML
 | 
					    @FXML
 | 
				
			||||||
    Button btLogin;
 | 
					 | 
				
			||||||
    @FXML
 | 
					 | 
				
			||||||
    Button btSaveOrder;
 | 
					    Button btSaveOrder;
 | 
				
			||||||
    @FXML
 | 
					    @FXML
 | 
				
			||||||
    ListView<String> lvFoodInfo;
 | 
					    ListView<String> lvFoodInfo;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    public ObservableList<Node> buttons = FXCollections.observableArrayList();
 | 
					    public ObservableList<Node> buttons = FXCollections.observableArrayList();
 | 
				
			||||||
 | 
					    public ObservableList<String> children = FXCollections.observableArrayList();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    public List<Child> allChildren = AccountMgr.getAllChildrenFromParentWithId(3);
 | 
				
			||||||
 | 
					    public void initialize(){
 | 
				
			||||||
 | 
					        FoodPlan foodplanMon = FoodMgr.getFoodPlanById(1);
 | 
				
			||||||
 | 
					        FoodPlan foodplanTue = FoodMgr.getFoodPlanById(2);
 | 
				
			||||||
 | 
					        FoodPlan foodplanWed = FoodMgr.getFoodPlanById(3);
 | 
				
			||||||
 | 
					        FoodPlan foodplanThu = FoodMgr.getFoodPlanById(4);
 | 
				
			||||||
 | 
					        FoodPlan foodplanFri = FoodMgr.getFoodPlanById(5);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        for (Child c : allChildren){
 | 
				
			||||||
 | 
					            children.add(c.getFirstname());
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        cbPickChild.setItems(children);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    public void setButtonActive(ActionEvent event) {
 | 
					    public void setButtonActive(ActionEvent event) {
 | 
				
			||||||
        Button b = (Button) event.getSource();
 | 
					        Button b = (Button) event.getSource();
 | 
				
			||||||
@@ -87,14 +103,7 @@ public class MenueController {
 | 
				
			|||||||
        buttons = p.getChildrenUnmodifiable();
 | 
					        buttons = p.getChildrenUnmodifiable();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        for(Node button : buttons){
 | 
					        for(Node button : buttons){
 | 
				
			||||||
            System.out.println(b.getStyleClass());
 | 
					            button.setDisable(button.equals(b));
 | 
				
			||||||
            /*
 | 
					 | 
				
			||||||
            b.getStyleClass().remove("active");
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            if (button.equals(b)){
 | 
					 | 
				
			||||||
                b.getStyleClass().add("active");;
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
             */
 | 
					 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user