package scheduler.view; import scheduler.Main; import javafx.collections.FXCollections; import javafx.collections.ObservableList; import javafx.fxml.FXML; import javafx.scene.control.ComboBox; import javafx.scene.control.ListView; public class PrefCoursesController { @FXML private ListView courses; @FXML private ComboBox selectDay; @FXML private ComboBox selNumSections; private Main mainApp; private ObservableList dayPatterns; private ObservableList numSections; /** * The constructor. * The constructor is called before the initialize() method. */ public PrefCoursesController() { this.dayPatterns = FXCollections.observableArrayList("MWF", "MTWR", "TWRF", "TR"); this.numSections = FXCollections.observableArrayList("1", "2", "3", "4", "5", "6", "7", "8", "9", "10"); } /** * Initializes the controller class. This method is automatically called * after the fxml file has been loaded. */ @FXML private void initialize() { } public void setMainApp(Main main) { this.mainApp = main; this.courses.setItems(mainApp.getCourseData()); this.selectDay.setItems(this.dayPatterns); this.selectDay.setPrefWidth(200.0); this.selNumSections.setItems(this.numSections); this.selNumSections.setPrefWidth(200.0); } }