Schedule-Creator

Java GUI to create schedules for UNCG students
git clone git://git.wrycode.com/wrycode/archive/Schedule-Creator.git
Log | Files | Refs | README

commit 8e3dde13f08dc5ff90e0bf9661c520a606ef9067
parent 25f8b79156ff00af81df88a957dbaa1036f8b138
Author: wrycode <wry@mm.st>
Date:   Sun, 29 Mar 2020 20:43:51 -0400

Add button to remove all selected courses (#50)


Diffstat:
M.gitignore | 4++--
MScheduleCreator/controllers/CoursesController.java | 13+++++++++++++
MScheduleCreator/resources/views/select_courses.fxml | 11++++-------
3 files changed, 19 insertions(+), 9 deletions(-)

diff --git a/.gitignore b/.gitignore @@ -1,4 +1,5 @@ ScheduleCreator/resources/raw/user_selected_courses.txt ScheduleCreator/resources/DB/ *.html -*.js- \ No newline at end of file +*.js +/ScheduleCreator/JavaDoc/ diff --git a/ScheduleCreator/controllers/CoursesController.java b/ScheduleCreator/controllers/CoursesController.java @@ -215,6 +215,19 @@ public class CoursesController implements Initializable { } } + public void removeAllCourses(ActionEvent _event) { + List<String> courses = this.currentSemester.getSelectedCourseStrings(); + + for(String course: courses){ + this.currentSemester.removeCourse(course); + } + + this.currentSemester.generateSchedules(); + this.regenerateSchedules(); + this.loadSelectedCourses(); + } + + /** * Generates all possible schedules consisting of selected sections. */ diff --git a/ScheduleCreator/resources/views/select_courses.fxml b/ScheduleCreator/resources/views/select_courses.fxml @@ -1,9 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<?import java.lang.*?> -<?import javafx.geometry.*?> -<?import javafx.scene.control.*?> -<?import javafx.scene.layout.*?> <?import javafx.geometry.Insets?> <?import javafx.scene.control.Button?> <?import javafx.scene.control.ComboBox?> @@ -19,7 +15,7 @@ <?import javafx.scene.layout.RowConstraints?> <?import javafx.scene.layout.VBox?> -<GridPane xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="ScheduleCreator.controllers.CoursesController"> +<GridPane xmlns="http://javafx.com/javafx/8.0.171" xmlns:fx="http://javafx.com/fxml/1" fx:controller="ScheduleCreator.controllers.CoursesController"> <columnConstraints> <ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" percentWidth="2.0" prefWidth="20.0" /> <ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" /> @@ -38,16 +34,17 @@ <TextField fx:id="searchField" onAction="#addSelectedCourse" prefHeight="25.0" prefWidth="262.0" promptText="Search" GridPane.columnSpan="2" GridPane.rowIndex="1" /> <ComboBox fx:id="semesterComboBox" onAction="#switchSemester" prefHeight="26.0" prefWidth="692.0" promptText="Choose Semester" GridPane.columnSpan="2" GridPane.hgrow="ALWAYS" /> <ListView fx:id="selectedCoursesListView" maxHeight="1.7976931348623157E308" prefHeight="114.0" prefWidth="454.0" GridPane.columnSpan="2" GridPane.rowIndex="4" /> - <Button maxWidth="1.7976931348623157E308" mnemonicParsing="false" onAction="#removeSelectedCourse" prefHeight="72.0" prefWidth="172.0" text="Remove" GridPane.columnSpan="2" GridPane.hgrow="NEVER" GridPane.rowIndex="5" GridPane.vgrow="NEVER" /> + <Button maxWidth="1.7976931348623157E308" mnemonicParsing="false" onAction="#removeSelectedCourse" prefHeight="72.0" prefWidth="172.0" text="Remove" GridPane.hgrow="NEVER" GridPane.rowIndex="5" GridPane.vgrow="NEVER" /> <Button mnemonicParsing="false" onAction="#selectAll" prefHeight="79.0" prefWidth="517.0" text="Select/Deselect All" GridPane.hgrow="NEVER" GridPane.rowIndex="7" GridPane.vgrow="NEVER" /> <Button fx:id="sectionsButton" mnemonicParsing="false" onAction="#setSections" prefHeight="43.0" prefWidth="248.0" text="Submit" GridPane.columnIndex="1" GridPane.hgrow="NEVER" GridPane.rowIndex="7" GridPane.vgrow="NEVER" /> <ListView fx:id="availableCourses" prefHeight="184.0" prefWidth="271.0" GridPane.columnSpan="2" GridPane.rowIndex="2" /> - <Button mnemonicParsing="false" onAction="#addSelectedCourse" prefHeight="26.0" prefWidth="703.0" text="Add Course" GridPane.columnSpan="2" GridPane.rowIndex="3" /> + <Button mnemonicParsing="false" onAction="#addSelectedCourse" prefHeight="26.0" prefWidth="635.0" text="Add Course" GridPane.columnSpan="2" GridPane.rowIndex="3" /> <TabPane fx:id="sectionTabPane" prefHeight="200.0" prefWidth="200.0" style="-fx-border-color: grey;" tabClosingPolicy="UNAVAILABLE" GridPane.columnSpan="2" GridPane.rowIndex="6"> <tabs> </tabs> </TabPane> + <Button mnemonicParsing="false" onAction="#removeAllCourses" prefHeight="26.0" prefWidth="421.0" text="Remove All" GridPane.columnIndex="1" GridPane.rowIndex="5" /> </children> <columnConstraints> <ColumnConstraints hgrow="SOMETIMES" maxWidth="469.0" minWidth="10.0" prefWidth="289.0" />