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 6a80e6d34b6cfdd26a3c2810a4567314efdcdefe
parent f1764a8f52d48d8ce011d700a1024cf6fb86c147
Author: jamisonv93 <47033011+jamisonv93@users.noreply.github.com>
Date:   Wed, 18 Mar 2020 17:16:15 -0400

Changes to GUI and more model implementation (#41)

* rebuild DB with included Fall 2020 files

* Change default size of primary view; addLoadSelectedCourses() to switchSemester() in CoursesController

* fix addSelectedCourse & getSelectedCourses; delete User Model

* minor changes, style guide, comments

* add Semester model

* small change in Semester class

* small change in Semester class

* use models in controller methods to handle data; add constraint to prevent selected given class more than once

* reset Course Combo Box after selecting cousre or switching combo box

* Fix trailing whitespace issue Admin.generateCourseList

* remove unnecessary occurences of trim(); fix removeCourse bug

* refactor Semester class

* restructure GUI components, implement getSections, more model implementation

* implement search feature; more model integration

* remove debugging helper statements

* remove trailing whitespace

* implement Sections.setTImes

* fix search bug; adjust button heights

* Fixed most (not all) of the line break issues in regenDB.

* add drawGrid() method

* Revert "add drawGrid() method"

This reverts commit fdecdfabbd8bef3c6368b843533517bf1cc862b7.

Co-authored-by: Sfar <isfar314@gmail.com>
Diffstat:
MScheduleCreator/Admin.java | 8+++++---
MScheduleCreator/Translator.java | 40++++++++++++++++++++++++++++++----------
MScheduleCreator/controllers/CoursesController.java | 93++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-------
MScheduleCreator/models/Course.java | 91+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-------------------
MScheduleCreator/models/Section.java | 80++++++++++++++++++++++++++++++++++++++++++++++++++-----------------------------
MScheduleCreator/models/Semester.java | 49+++++++++++++++++++++----------------------------
DScheduleCreator/resources/main.css | 11-----------
RScheduleCreator/resources/raw/Fall 2020 -> ScheduleCreator/resources/raw/fall2020 | 0
RScheduleCreator/resources/raw/Spring 2020 -> ScheduleCreator/resources/raw/spring2020 | 0
RScheduleCreator/resources/raw/Summer 2020 -> ScheduleCreator/resources/raw/summer2020 | 0
MScheduleCreator/resources/views/select_courses.fxml | 180+++++++++++++++++++++++++++++++++++++++++++------------------------------------
11 files changed, 361 insertions(+), 191 deletions(-)

diff --git a/ScheduleCreator/Admin.java b/ScheduleCreator/Admin.java @@ -118,18 +118,20 @@ public class Admin { protected static void generateAllInfo(String _inputFilepath, String _outputFilepath) throws IOException { // initial regex - String regex = "(.+?(?= - (?:[0-9]{5}))[ ])|([ ][0-9]{5}[ ])|([ ]\\b[A-Z]{3}\\b.\\b[0-9]{3}\\b.+ [0-9]{2}\\b)|([\t](?:(?:(?:[0-9]|0[0-9]|1[0-9]|2[0-3]):[0-5][0-9].(?:[AaPp][Mm])\\b).-.(?:[0-9]|0[0-9]|1[0-9]|2[0-3]):[0-5][0-9].(?:[AaPp][Mm])\\b))|(\\b([\t](TR\\b|MW\\b|MWF\\b|M\\b|T\\b|W\\b|R\\b|F\\b|(TBA.*TBA\\b)))\\b)|(\t.*([0-9]{3}))(?=\t[A-z]{3} [0-9]{2})|((?=(\tLecture|\tLab|\tIndividual Study|\tSeminar|\tClinical|Colloquia|\tDissertation or Thesis|\tEnsemble|\tInternship, Field Exp, Coop Ed|\tLecture and lab|\tPerformance|\tPhysical Activity|\tPracticum - Dlvrd Ind Setting|\tRecitations|\tStudent Teaching|\tStudio|\tLecture and Lab|\tDissertation or Thesis)).+?(?<=((\\(P\\)E-mail)|(\\(P\\)))))|(((\\(P\\)E-mail)|(\\(P\\))))"; + String regex = "(.+?(?= - (?:[0-9]{5}))[ ])|([ ][0-9]{5}[ ])|([ ]\\b[A-Z]{3}\\b.\\b[0-9]{3}\\b.+ [0-9]{2}\\b)|([\\t](?:(?:(?:[0-9]|0[0-9]|1[0-9]|2[0-3]):[0-5][0-9].(?:[AaPp][Mm])\\\\b).-.(?:[0-9]|0[0-9]|1[0-9]|2[0-3]):[0-5][0-9].(?:[AaPp][Mm])\\b))|(\\b([\\t](TR\\b|MW\\b|MWF\\b|M\\b|T\\b|W\\b|R\\b|F\\b|(TBA.*TBA\\b)))\\b)|(\\t.*([0-9]{3}))(?=\\t[A-z]{3} [0-9]{2})|((?=(\\tLecture|\\tLab|\\tIndividual Study|\\tSeminar|\\tClinical|Colloquia|\\tDissertation or Thesis|\\tEnsemble|\\tInternship, Field Exp, Coop Ed|\\tLecture and lab|\\tPerformance|\\tPhysical Activity|\\tPracticum - Dlvrd Ind Setting|\\tPracticum - Dlvrd Org Course|\\tRecitations|\\tStudent Teaching|\\tStudio|\\tLecture and Lab|\\tDissertation or Thesis)).+?(?<=(((\\(P\\)E-mail)|(\\(P\\))|(TBA)))))"; String output = Admin.runRegexOnFile(regex, _inputFilepath); //Puts every class on a line of its own with time and day following. //Break to a new line where needed. - String results = output.replaceAll("\\(P\\)", "\n"); + String pass1 = output.replaceAll("(\\(P\\))", "\n"); + //same as above (new lines where needed) but another pass to handle some special cases that aren't handled by the previous regex + String pass2 = pass1.replaceAll("((?=(\\tLecture|\\tLab|\\tIndividual Study|\\tSeminar|\\tClinical|Colloquia|\\tDissertation or Thesis|\\tEnsemble|\\tInternship, Field Exp, Coop Ed|\\tLecture and lab|\\tPerformance|\\tPhysical Activity|\\tPracticum - Dlvrd Ind Setting|\\tPracticum - Dlvrd Org Course|\\tRecitations|\\tStudent Teaching|\\tStudio|\\tLecture and Lab|\\tDissertation or Thesis)).*?TBA)", "$1\n"); // Insert a equal sign inebtween the Building name and the instructor // This is done since a regex cant be made to stricly get a persons or building // name or since both lacks defined structure, so a = is used as a barrier - String finalOutput = results.replaceAll("(\tLecture|\tLab|\tIndividual Study|\tSeminar|\tClinical|Colloquia|\tDissertation or Thesis|\tEnsemble|\tInternship, Field Exp, Coop Ed|\tLecture and lab|\tPerformance|\tPhysical Activity|\tPracticum - Dlvrd Ind Setting|\tRecitations|\tStudent Teaching|\tStudio|\tLecture and Lab|\tDissertation or Thesis)", " = "); + String finalOutput = pass2.replaceAll("(\tLecture|\tLab|\tIndividual Study|\tSeminar|\tClinical|Colloquia|\tDissertation or Thesis|\tEnsemble|\tInternship, Field Exp, Coop Ed|\tLecture and lab|\tPerformance|\tPhysical Activity|\tPracticum - Dlvrd Ind Setting|\\tPracticum - Dlvrd Org Course|\tRecitations|\tStudent Teaching|\tStudio|\tLecture and Lab|\tDissertation or Thesis)", " = "); // write the file Admin.writeNewFile(_outputFilepath, finalOutput); diff --git a/ScheduleCreator/Translator.java b/ScheduleCreator/Translator.java @@ -19,9 +19,9 @@ import java.util.regex.Pattern; * This class is used to retrieve and modify persistent data for the * application. * - * @author Jamison Valentine, Ilyass Sfar, Nick Econopouly, Nathan Tolodzieki + * @author Jamison Valentine, Ilyass Sfar, Nick Econopouly * - * Last Updated: 3/16/2020 + * Last Updated: 3/17/2020 */ public class Translator { @@ -56,9 +56,25 @@ public class Translator { } // DUMMY - public static List<String> getSections(String _course, String _semesterName) { - ArrayList<String> sections = new ArrayList<>(); - sections.add("CSC 250 - 01"); + public static List<String> getSections(String _courseNumber, String _semester) { + + String path = "DB/" + _semester + "/all_info"; + ArrayList<String> sections = new ArrayList(); + + try { + String content = Translator.getFullText(path); + Scanner input = new Scanner(content).useDelimiter("\n"); + String line = ""; + + while (input.hasNext()) { + line = input.next(); + if (line.contains(_courseNumber)) { + sections.add(line); + } + } + } + catch (IOException ex) {} + return sections; } @@ -92,11 +108,17 @@ public class Translator { * * @param _semesterName * @return a List of courses (as Strings) available for the semester - * @throws java.io.FileNotFoundException + * */ - public static List<String> getCourses(String _semesterName) throws FileNotFoundException, IOException { + public static List<String> getCourses(String _semesterName) { + + List<String> courses = new ArrayList(); + try { String contents = Translator.getFullText("DB/" + _semesterName + "/courses"); - List<String> courses = Arrays.asList(contents.split("\n")); + courses = Arrays.asList(contents.split("\n")); + } + catch (Exception ex) {} + return courses; } @@ -240,9 +262,7 @@ public class Translator { } } catch (FileNotFoundException ex) { - System.out.println(_semester + "user_selected_courses.txt file does not exist yet (no selected courses for semester)"); - } finally { return selectedCourses; diff --git a/ScheduleCreator/controllers/CoursesController.java b/ScheduleCreator/controllers/CoursesController.java @@ -1,6 +1,8 @@ package ScheduleCreator.controllers; import ScheduleCreator.Translator; +import ScheduleCreator.models.Course; +import ScheduleCreator.models.Section; import ScheduleCreator.models.Semester; import java.io.IOException; import java.net.URL; @@ -9,6 +11,8 @@ import java.util.List; import java.util.ResourceBundle; import java.util.logging.Level; import java.util.logging.Logger; +import java.util.regex.Matcher; +import java.util.regex.Pattern; import javafx.collections.FXCollections; import javafx.event.ActionEvent; import javafx.fxml.FXML; @@ -16,6 +20,10 @@ import javafx.fxml.Initializable; import javafx.scene.control.Button; import javafx.scene.control.ComboBox; import javafx.scene.control.ListView; +import javafx.scene.control.TextField; +import javafx.scene.layout.GridPane; +import javafx.scene.layout.HBox; +import javafx.scene.layout.RowConstraints; /** * This class controls interactions in the Courses View. @@ -35,16 +43,25 @@ public class CoursesController implements Initializable { @FXML protected ListView selectedCourses; @FXML + protected ListView sectionListView; + @FXML protected Button courseButton; @FXML protected Button removeCourseButton; + @FXML + protected Button searchButton; + @FXML + protected TextField searchField; + @FXML + protected RowConstraints topRow; + @FXML + protected GridPane scheduleGrid; protected Semester currentSemester; protected Semester spring2020 = new Semester("spring2020"); protected Semester summer2020 = new Semester("summer2020"); protected Semester fall2020 = new Semester("fall2020"); - @Override public void initialize(URL url, ResourceBundle rb) { try { @@ -54,6 +71,14 @@ public class CoursesController implements Initializable { } } + public void displaySchedule(ActionEvent _event) { + + double blockHeight = scheduleGrid.getHeight() / 13; + HBox block = new HBox(); + block.setPrefHeight(blockHeight); + GridPane.setConstraints(block, 0, 0, 0, 2); + } + public void addSelectedCourse(ActionEvent _event) throws Exception { String selectedCourse = this.courseComboBox.getValue(); @@ -61,7 +86,9 @@ public class CoursesController implements Initializable { if (selectedCourse != null && selectedCourse != "-") { - if (currentSemester.addCourse(selectedCourse)) this.selectedCourses.getItems().add(selectedCourse); + if (currentSemester.addCourse(selectedCourse)) { + this.selectedCourses.getItems().add(selectedCourse); + } } } @@ -83,7 +110,7 @@ public class CoursesController implements Initializable { break; } - loadAllCourses(currentSemesterString); + loadAllCourses(this.currentSemester.getName()); loadSelectedCourses(this.currentSemester.getName()); } @@ -96,9 +123,25 @@ public class CoursesController implements Initializable { System.out.println("Dummy function to clear the list of available sections for when we switch semesters"); } + public void search(ActionEvent _event) { + String searchString = this.searchField.getText(); + List<String> filteredList = new ArrayList(); + + if (this.currentSemester != null) { + + for (String course : this.currentSemester.getAllCourses()) { + if (course.toLowerCase().contains(searchString.toLowerCase())) { + filteredList.add(course); + } + } + + } + this.courseComboBox.setItems(FXCollections.observableList(filteredList)); + } + public void removeSelectedCourse(ActionEvent _event) throws Exception { - Object itemToRemove = this.selectedCourses.getSelectionModel().getSelectedItem(); + Object itemToRemove = this.selectedCourses.getSelectionModel().getSelectedItem(); this.selectedCourses.getItems().remove(itemToRemove); String courseToDelete = (String) itemToRemove; @@ -106,15 +149,49 @@ public class CoursesController implements Initializable { } - public void loadAllCourses(String _semester) throws Exception { + public void loadCourseSections(ActionEvent _event) { + + List<Section> courseSections = new ArrayList(); + String currentSelection = this.selectedCourses.getFocusModel().getFocusedItem().toString(); + + for (Course course : this.currentSemester.getSelectedCourses()) { + if (course.getFullText().equals(currentSelection)) { + courseSections = course.getSections(); + } + } + + List<String> listCellLabels = new ArrayList(); + + for (Section section : courseSections) { + listCellLabels.add(section.toString()); + } + + this.sectionListView.setItems(FXCollections.observableList(listCellLabels)); - List<String> courses = Translator.getCourses(_semester); - this.courseComboBox.setItems(FXCollections.observableList(courses)); + } + + public void loadAllCourses(String _semester) throws Exception { + this.courseComboBox.setItems(FXCollections.observableList(this.currentSemester.getAllCourses())); } public void loadSemesters() throws IOException { List<String> semesters = Translator.getSemesters(); - this.semesterComboBox.setItems(FXCollections.observableList(semesters)); + + List<String> newList = new ArrayList(); + Pattern p = Pattern.compile("([a-z]*)([0-9]{4})"); + Matcher m; + + String formattedSemester = ""; + for (String semester : semesters) { + m = p.matcher(semester); + + if (m.matches()) { + formattedSemester = m.group(1).substring(0, 1).toUpperCase() + m.group(1).substring(1) + " " + m.group(2); + } + newList.add(formattedSemester); + } + + this.semesterComboBox.setItems(FXCollections.observableList(newList)); } public void loadSelectedCourses(String _semester) throws Exception { diff --git a/ScheduleCreator/models/Course.java b/ScheduleCreator/models/Course.java @@ -5,52 +5,101 @@ package ScheduleCreator.models; * * @author Jamison Valentine * - * Last Updated: 3/16/2020 + * Last Updated: 3/17/2020 */ +import ScheduleCreator.Translator; import java.util.ArrayList; +import java.util.List; +import java.util.regex.Matcher; +import java.util.regex.Pattern; public class Course { - protected final String name; - protected String abbreviation; - protected String courseNumber; - protected ArrayList<String> sections; + protected final String fullText; + protected final String id; + protected final String abbreviation; + protected final String courseNumber; + protected List<Section> sections; - public Course(String _name) { - this.name = _name; + public Course(String _name, String _semester) { + this.fullText = _name; + this.courseNumber = _name.substring(4, 7); + this.abbreviation = _name.substring(0, 4); + this.id = this.abbreviation + this.courseNumber; + loadSectionsFromFile( _semester); } - public String getName() { - return this.name; + public String getFullText() { + return this.fullText; + } public String getabbreviation() { return abbreviation; } - public void setabbreviation(String _abbreviation) { - this.abbreviation = _abbreviation; - } - //================= GETTERS =============== public String getCourseNumber() { return courseNumber; } - public ArrayList<String> getSections() { - return sections; + public List<Section> getSections() { + return this.sections; } - //================= SETTERS =============== + public void loadSectionsFromFile(String _semester) { + List<String> sectionStrings = Translator.getSections(this.id, _semester); + this.sections = new ArrayList(); + Pattern p = Pattern.compile(".*([0-9]{5}).*- ([0-9]{2})\\s*(\\S* [ap]m - \\S* [ap]m)\\s*(\\S*)(.*)=(.*)"); - public void setCourseNumber(String _courseNumber) { - this.courseNumber = _courseNumber; - } + //This pattern is to be matched with Courses with "TBA" as location and meeting times" + Pattern p2 = Pattern.compile(".*([0-9]{5}).*- ([0-9]{2})\\s*(TBA\\s*TBA )=(.*)"); + Matcher m, m2; + + String CRN = ""; + String sectionNumber = ""; + String daysAndTimes = ""; + String location = ""; + String instructor = ""; - public void addSection(ArrayList<String> _sections) { - this.sections = _sections; + for (String sectionString : sectionStrings) { + m = p.matcher(sectionString); + m2 = p2.matcher(sectionString); + if ((m.matches())) { + + CRN = m.group(1).trim(); + sectionNumber = m.group(2).trim(); + daysAndTimes = m.group(4).trim() + " " + m.group(3).trim(); + location = m.group(5).trim(); + instructor = m.group(6).trim(); +// System.out.println("CRN: " + CRN); +// System.out.println("Section #: " + sectionNumber); +// System.out.println("Times: " + daysAndTimes); +// System.out.println("Days: " + location); +// System.out.println("Location: " + location); +// System.out.println("Instructor: " + instructor); +// System.out.println("This is not an online course"); + Section newSection = new Section(sectionNumber, daysAndTimes, location, instructor, CRN, false); + + this.sections.add(newSection); + } + else if ((m2.matches())) { + CRN = m2.group(1).trim(); + sectionNumber = m2.group(2).trim(); + instructor = m2.group(4).trim(); +// System.out.println("CRN: " + CRN); +// System.out.println("Section #: " + sectionNumber); +// System.out.println("Online class"); +// System.out.println("Instructor: " + instructor); + Section newSection = new Section(sectionNumber, daysAndTimes, location, instructor, CRN, true); + this.sections.add(newSection); + } +// else System.out.println("Does not match"); + } } + + } diff --git a/ScheduleCreator/models/Section.java b/ScheduleCreator/models/Section.java @@ -1,25 +1,54 @@ package ScheduleCreator.models; -import java.util.HashMap; +import java.util.Scanner; /** * This class models information for course sections. * * @author Jamison Valentine * - * Last Updated: 3/16/2020 + * Last Updated: 3/17/2020 */ public class Section { - protected String location; - protected String instructor; - protected String daysAndTimes; - protected String CRN; - protected String sectionNumber; - - public Section() { + protected final String location; + protected final String instructor; + protected final String daysAndTimes; + protected int startTime; + protected int endTime; + protected final String CRN; + protected final String sectionNumber; + protected final Boolean isOnline; + public Section(String _sectionNumber, String _daysAndTimes, String _location, String _instructor, String _CRN, Boolean _isOnline) { + this.location = _location; + this.instructor = _instructor; + this.daysAndTimes = _daysAndTimes; + this.CRN = _CRN; + this.sectionNumber = _sectionNumber; + this.isOnline = _isOnline; + if (!this.isOnline) setTimes(_daysAndTimes); + } + + public void setTimes(String _daysAndTimes) { + Scanner input = new Scanner(_daysAndTimes); + input.next(); + int start = Integer.parseInt(input.next().replace(":", "")); + if (input.next().equals("pm")) { + start += 1200; + if (start >= 2400) start -= 2400; + } + input.next(); + int end = Integer.parseInt(input.next().replace(":", "")); + if (input.next().equals("pm")) { + end += 1200; + if (end >= 2400) end -= 2400; + } + this.startTime = start; + this.endTime = end; + System.out.println("Start time: " + this.startTime); + System.out.println("End time: " + this.endTime); } //================= GETTERS =============== @@ -44,25 +73,17 @@ public class Section { return sectionNumber; } -//================= SETTERS =============== - - public void setSectionNumber(String _sectionNumber) { - this.sectionNumber = _sectionNumber; - } - - public void setLocation(String _location) { - this.location = _location; - } - - public void setInstructor(String _instructor) { - this.instructor = _instructor; - } - - public void setDaysAndTimes(String _daysAndTimes) { - this.daysAndTimes = _daysAndTimes; + @Override + public String toString() { + String string = ""; + + if (!this.isOnline) { + string = this.sectionNumber + " | " + this.daysAndTimes + " | " + this.location + " | "+ this.instructor + " | " + this.CRN; + } + else { + string = this.sectionNumber + " | Online | " + this.instructor + " " + this.CRN; + } + return string; } - public void setCRN(String _CRN) { - this.CRN = _CRN; - } -} +}+ \ No newline at end of file diff --git a/ScheduleCreator/models/Semester.java b/ScheduleCreator/models/Semester.java @@ -2,8 +2,6 @@ package ScheduleCreator.models; import ScheduleCreator.Translator; import java.util.ArrayList; -import java.util.TreeMap; -import ScheduleCreator.models.Section; import java.util.List; /** @@ -13,15 +11,15 @@ import java.util.List; * * @author Nick Econopouly, Jamison Valentine * - * Last Updated: 3/16/2020 + * Last Updated: 3/17/2020 */ -public class Semester { +public class Semester { protected final String name; + protected final List<String> allCourses; protected ArrayList<Course> selectedCourses; protected ArrayList<Section> selectedSections; - protected TreeMap<String,Semester> courseList; protected Schedule schedule; /** @@ -37,7 +35,8 @@ public class Semester { */ public Semester(String _name) { this.name = _name; - setSelectedCourses(); + loadSelectedCoursesFromFile(); + this.allCourses = Translator.getCourses(this.name); } //WORK IN PROGRESS @@ -55,17 +54,21 @@ public class Semester { Boolean contains = false; for (Course course: this.selectedCourses) { - if (course.getName().equalsIgnoreCase(_course)) { + + if (course.getFullText().equalsIgnoreCase(_course)) { + contains = true; break; } } if (!contains) { - this.selectedCourses.add(new Course(_course)); + + this.selectedCourses.add(new Course(_course, this.name)); + Translator.saveCourse(_course, this.name); - printCourseNames(); return true; + } else { return false; } @@ -78,19 +81,24 @@ public class Semester { return this.name; } + public List<String> getAllCourses() { + return this.allCourses; + } + //WORK IN PROGRESS public List<Section> getAvailableSections(Course _course) { ArrayList<Section> list = new ArrayList(); return list; } - public void setSelectedCourses() { + public void loadSelectedCoursesFromFile() { + List<String> list = Translator.getSelectedCourses(this.name); this.selectedCourses = new ArrayList(); if (!list.isEmpty()) { for (String courseName: list) { - this.selectedCourses.add(new Course(courseName)); + this.selectedCourses.add(new Course(courseName, this.name)); } } @@ -101,7 +109,8 @@ public class Semester { for (Course course: this.selectedCourses) { - if (_course.equalsIgnoreCase(course.getName())) { + if (_course.equalsIgnoreCase(course.getFullText())) { + courseToRemove = course; this.selectedCourses.remove(courseToRemove); break; @@ -109,26 +118,10 @@ public class Semester { } Translator.removeCourse(_course, this.name); - printCourseNames(); - } public List<Course> getSelectedCourses() { return this.selectedCourses; } - public TreeMap<String, Semester> getCourseList() { - return this.courseList; - } - - public void printCourseNames() { - System.out.println(this.name); - StringBuilder content = new StringBuilder(); - - for (Course course: this.selectedCourses) { - System.out.println(course.getName()); - } - System.out.println("\n\n"); - - } } \ No newline at end of file diff --git a/ScheduleCreator/resources/main.css b/ScheduleCreator/resources/main.css @@ -1,11 +0,0 @@ -.combo-box, .text-field, .button{ - -fx-border-radius: 5; - -fx-padding: 3 6 6 6; - -fx-alignment: center; - -fx-max-width: infinity; - -fx-max-height: infinity; - -fx-pref-width: 1000px; - -fx-pref-height: 1000px; -} - - diff --git a/ScheduleCreator/resources/raw/Fall 2020 b/ScheduleCreator/resources/raw/fall2020 diff --git a/ScheduleCreator/resources/raw/Spring 2020 b/ScheduleCreator/resources/raw/spring2020 diff --git a/ScheduleCreator/resources/raw/Summer 2020 b/ScheduleCreator/resources/raw/summer2020 diff --git a/ScheduleCreator/resources/views/select_courses.fxml b/ScheduleCreator/resources/views/select_courses.fxml @@ -1,5 +1,10 @@ <?xml version="1.0" encoding="UTF-8"?> +<?import javafx.scene.effect.*?> +<?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?> @@ -12,9 +17,8 @@ <?import javafx.scene.layout.GridPane?> <?import javafx.scene.layout.RowConstraints?> -<AnchorPane fx:id="mainPane" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="560" prefWidth="1090" stylesheets="@../main.css" xmlns="http://javafx.com/javafx/8.0.171" xmlns:fx="http://javafx.com/fxml/1" fx:controller="ScheduleCreator.controllers.CoursesController"> +<AnchorPane fx:id="mainPane" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="560.0" prefWidth="1090.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="ScheduleCreator.controllers.CoursesController"> <children> - <SplitPane prefHeight="160.0" prefWidth="200.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0" /> <GridPane AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0"> <columnConstraints> <ColumnConstraints hgrow="SOMETIMES" maxWidth="539.0" minWidth="10.0" prefWidth="465.0" /> @@ -24,90 +28,66 @@ <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" /> </rowConstraints> <children> - <AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="160.0" prefWidth="100.0"> + <GridPane hgap="10.0" vgap="20.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0"> + <columnConstraints> + <ColumnConstraints hgrow="SOMETIMES" maxWidth="469.0" minWidth="10.0" prefWidth="289.0" /> + <ColumnConstraints hgrow="SOMETIMES" maxWidth="342.0" minWidth="10.0" prefWidth="155.0" /> + </columnConstraints> + <rowConstraints> + <RowConstraints maxHeight="214.0" minHeight="10.0" prefHeight="33.0" vgrow="NEVER" /> + <RowConstraints maxHeight="243.0" minHeight="0.0" prefHeight="34.0" vgrow="NEVER" /> + <RowConstraints maxHeight="375.0" minHeight="0.0" prefHeight="22.0" vgrow="NEVER" /> + <RowConstraints maxHeight="338.0" minHeight="10.0" prefHeight="128.0" vgrow="NEVER" /> + <RowConstraints maxHeight="305.0" minHeight="10.0" prefHeight="22.0" vgrow="NEVER" /> + <RowConstraints maxHeight="305.0" minHeight="10.0" prefHeight="177.0" vgrow="SOMETIMES" /> + <RowConstraints maxHeight="305.0" minHeight="10.0" prefHeight="31.0" vgrow="NEVER" /> + </rowConstraints> <children> - <GridPane AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0"> - <columnConstraints> - <ColumnConstraints hgrow="SOMETIMES" maxWidth="469.0" minWidth="10.0" prefWidth="259.0" /> - <ColumnConstraints hgrow="SOMETIMES" maxWidth="246.0" minWidth="10.0" prefWidth="52.0" /> - </columnConstraints> - <rowConstraints> - <RowConstraints maxHeight="214.0" minHeight="10.0" prefHeight="33.0" vgrow="SOMETIMES" /> - <RowConstraints maxHeight="243.0" minHeight="0.0" prefHeight="34.0" vgrow="SOMETIMES" /> - <RowConstraints maxHeight="375.0" minHeight="10.0" prefHeight="29.0" vgrow="SOMETIMES" /> - <RowConstraints maxHeight="130.0" minHeight="0.0" prefHeight="60.0" vgrow="SOMETIMES" /> - <RowConstraints maxHeight="337.0" minHeight="10.0" prefHeight="174.0" vgrow="SOMETIMES" /> - <RowConstraints maxHeight="305.0" minHeight="10.0" prefHeight="184.0" vgrow="SOMETIMES" /> - <RowConstraints maxHeight="276.0" minHeight="10.0" prefHeight="45.0" vgrow="SOMETIMES" /> - </rowConstraints> + <TextField fx:id="searchField" prefHeight="25.0" prefWidth="262.0" promptText="Search" GridPane.rowIndex="1" /> + <HBox maxWidth="1.7976931348623157E308" prefHeight="200.0" prefWidth="200.0" GridPane.columnIndex="1" GridPane.rowIndex="2"> <children> - - <ComboBox fx:id="sectionBox" prefHeight="26.0" prefWidth="660.0" promptText="Select Section" GridPane.rowIndex="6" /> - <Label text="Selected Courses" GridPane.rowIndex="3" /> - <Button fx:id="searchButton" mnemonicParsing="false" text="Search Classes" GridPane.columnIndex="1" GridPane.halignment="CENTER" GridPane.hgrow="ALWAYS" GridPane.rowIndex="1" GridPane.valignment="CENTER" /> - <TextField prefHeight="25.0" prefWidth="262.0" promptText="Search" GridPane.rowIndex="1" /> - <GridPane GridPane.columnSpan="2147483647" GridPane.rowIndex="4"> - <columnConstraints> - <ColumnConstraints hgrow="SOMETIMES" maxWidth="268.0" minWidth="10.0" prefWidth="259.0" /> - <ColumnConstraints hgrow="SOMETIMES" maxWidth="310.0" minWidth="10.0" prefWidth="196.0" /> - </columnConstraints> - <rowConstraints> - <RowConstraints maxHeight="200.0" minHeight="0.0" prefHeight="160.0" vgrow="SOMETIMES" /> - <RowConstraints maxHeight="200.0" minHeight="0.0" prefHeight="39.0" vgrow="SOMETIMES" /> - </rowConstraints> - <children> - <Button fx:id="removeCourseButton" mnemonicParsing="false" onAction="#removeSelectedCourse" prefHeight="52.0" prefWidth="658.0" text="Remove" GridPane.columnIndex="1" GridPane.rowIndex="1" GridPane.vgrow="ALWAYS" /> - <Button fx:id="getSectionsButton" mnemonicParsing="false" prefHeight="62.0" prefWidth="263.0" text="Get Sections" GridPane.rowIndex="1" /> - - <ListView fx:id="selectedCourses" prefHeight="85.0" prefWidth="262.0" GridPane.columnSpan="2" /> - </children> - </GridPane> - <GridPane GridPane.rowIndex="2"> - <columnConstraints> - <ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" /> - </columnConstraints> - <rowConstraints> - <RowConstraints maxHeight="149.0" minHeight="0.0" prefHeight="43.0" vgrow="SOMETIMES" /> - </rowConstraints> - <children> - - <ComboBox fx:id="courseComboBox" prefHeight="26.0" prefWidth="760.0" promptText="-" /> - </children> - </GridPane> - <GridPane GridPane.columnIndex="1" GridPane.rowIndex="2"> - <columnConstraints> - <ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" /> - </columnConstraints> - <rowConstraints> - <RowConstraints maxHeight="127.0" minHeight="10.0" prefHeight="33.0" vgrow="SOMETIMES" /> - <RowConstraints maxHeight="78.0" minHeight="10.0" prefHeight="35.0" vgrow="SOMETIMES" /> - </rowConstraints> - <children> - <Button fx:id="courseButton" mnemonicParsing="false" onAction="#addSelectedCourse" prefHeight="40.0" prefWidth="479.0" text="Add Class" GridPane.rowIndex="1" /> - </children> - </GridPane> - <ComboBox fx:id="semesterComboBox" onAction="#switchSemester" prefHeight="28.0" prefWidth="906.0" GridPane.columnIndex="1" /> - <Button fx:id="addClassButton" mnemonicParsing="false" prefHeight="68.0" prefWidth="178.0" text="Add To Schedule" GridPane.columnIndex="1" GridPane.rowIndex="6" /> - <Label text="Switch Semester:" /> + <Button fx:id="courseButton" maxWidth="1.7976931348623157E308" mnemonicParsing="false" onAction="#addSelectedCourse" prefHeight="200.0" prefWidth="177.0" text="Add Course" HBox.hgrow="ALWAYS" /> </children> - <padding> - <Insets bottom="5.0" left="5.0" right="5.0" top="5.0" /> - </padding> - </GridPane> + </HBox> + <HBox maxHeight="1.7976931348623157E308" prefHeight="200.0" prefWidth="200.0" GridPane.rowIndex="2"> + <children> + <ComboBox fx:id="courseComboBox" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" prefHeight="200.0" prefWidth="289.0" promptText="-" HBox.hgrow="ALWAYS" /> + </children> + </HBox> + <ComboBox fx:id="semesterComboBox" onAction="#switchSemester" prefHeight="62.0" prefWidth="226.0" promptText="Choose Semester" GridPane.columnIndex="1" GridPane.hgrow="NEVER" /> + <Button fx:id="searchButton" mnemonicParsing="false" onAction="#search" prefHeight="81.0" prefWidth="214.0" text="Search Classes" GridPane.columnIndex="1" GridPane.hgrow="NEVER" GridPane.rowIndex="1" GridPane.vgrow="NEVER" /> + <ListView fx:id="selectedCourses" prefHeight="114.0" prefWidth="454.0" GridPane.columnSpan="2" GridPane.rowIndex="3" /> + <Button fx:id="getSectionsButton" mnemonicParsing="false" onAction="#loadCourseSections" prefHeight="70.0" prefWidth="357.0" text="Get Sections" GridPane.hgrow="NEVER" GridPane.rowIndex="4" GridPane.vgrow="NEVER" /> + <Button maxWidth="1.7976931348623157E308" mnemonicParsing="false" onAction="#removeSelectedCourse" prefHeight="72.0" prefWidth="172.0" text="Remove" GridPane.columnIndex="1" GridPane.hgrow="NEVER" GridPane.rowIndex="4" GridPane.vgrow="NEVER" /> + <ListView fx:id="sectionListView" prefHeight="200.0" prefWidth="200.0" GridPane.columnSpan="2" GridPane.rowIndex="5" /> + <Button mnemonicParsing="false" prefHeight="79.0" prefWidth="517.0" text="Select/Deselect All" GridPane.hgrow="NEVER" GridPane.rowIndex="6" GridPane.vgrow="NEVER" /> + <Button mnemonicParsing="false" prefHeight="43.0" prefWidth="248.0" text="Add Sections" GridPane.columnIndex="1" GridPane.hgrow="NEVER" GridPane.rowIndex="6" GridPane.vgrow="NEVER" /> </children> - </AnchorPane> - <AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="160.0" prefWidth="100.0" GridPane.columnIndex="1"> + <padding> + <Insets bottom="5.0" left="5.0" right="5.0" top="5.0" /> + </padding> + </GridPane> + <GridPane GridPane.columnIndex="1"> + <columnConstraints> + <ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" /> + </columnConstraints> + <rowConstraints> + <RowConstraints maxHeight="560.0" minHeight="10.0" prefHeight="520.0" vgrow="SOMETIMES" /> + <RowConstraints maxHeight="275.0" minHeight="0.0" prefHeight="40.0" vgrow="SOMETIMES" /> + </rowConstraints> <children> - - <GridPane gridLinesVisible="true" prefHeight="822.0" prefWidth="872.0" style="-fx-border-color: black;" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0"> + + <GridPane fx:id="scheduleGrid" gridLinesVisible="true" prefHeight="822.0" prefWidth="872.0" style="-fx-border-color: black;"> <columnConstraints> <ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" /> <ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" /> <ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" /> <ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" /> <ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" /> + <ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" /> </columnConstraints> <rowConstraints> + <RowConstraints fx:id="topRow" minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" /> <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" /> <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" /> <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" /> @@ -117,20 +97,58 @@ <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" /> <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" /> <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" /> - <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" /> + <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" /> + <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" /> + <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" /> + <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" /> + <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" /> </rowConstraints> <children> - <Label text="Monday" /> - <Label text="Tuesday" GridPane.columnIndex="1" /> - <Label text="Wednesday" GridPane.columnIndex="2" /> - <Label text="Thursday" GridPane.columnIndex="3" /> - <Label text="Friday" GridPane.columnIndex="4" /> + <Label text="Monday" GridPane.columnIndex="1" GridPane.halignment="CENTER" /> + <Label text="Tuesday" GridPane.columnIndex="2" GridPane.halignment="CENTER" /> + <Label text="Wednesday" GridPane.columnIndex="3" GridPane.halignment="CENTER" /> + <Label text="Thursday" GridPane.columnIndex="4" GridPane.halignment="CENTER" /> + <Label text="Friday" GridPane.columnIndex="5" GridPane.halignment="CENTER" /> + <Label text="8:00 AM" GridPane.halignment="CENTER" GridPane.rowIndex="1" GridPane.valignment="TOP" /> + <Label text="9:00 AM" GridPane.halignment="CENTER" GridPane.rowIndex="2" GridPane.valignment="TOP" /> + <Label text="10:00 AM" GridPane.halignment="CENTER" GridPane.rowIndex="3" GridPane.valignment="TOP" /> + <Label text="2:00 PM" GridPane.halignment="CENTER" GridPane.rowIndex="7" GridPane.valignment="TOP" /> + <Label text="1:00 PM" GridPane.halignment="CENTER" GridPane.rowIndex="6" GridPane.valignment="TOP" /> + <Label text="12:00 PM" GridPane.halignment="CENTER" GridPane.rowIndex="5" GridPane.valignment="TOP" /> + <Label text="11:00 AM" GridPane.halignment="CENTER" GridPane.rowIndex="4" GridPane.valignment="TOP" /> + <Label text="3:00 PM" GridPane.halignment="CENTER" GridPane.rowIndex="8" GridPane.valignment="TOP" /> + <Label text="4:00 PM" GridPane.halignment="CENTER" GridPane.rowIndex="9" GridPane.valignment="TOP" /> + <Label text="5:00 PM" GridPane.halignment="CENTER" GridPane.rowIndex="10" GridPane.valignment="TOP" /> + <Label text="6:00 PM" GridPane.halignment="CENTER" GridPane.rowIndex="11" GridPane.valignment="TOP" /> + <Label text="7:00 PM" GridPane.halignment="CENTER" GridPane.rowIndex="12" GridPane.valignment="TOP" /> + <Label text="8:00 PM" GridPane.halignment="CENTER" GridPane.rowIndex="13" GridPane.valignment="TOP" /> + <Label text="9:00 PM" GridPane.halignment="CENTER" GridPane.rowIndex="14" GridPane.valignment="TOP" /> + <GridPane GridPane.rowIndex="1"> + <columnConstraints> + <ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" /> + <ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" /> + </columnConstraints> + <rowConstraints> + <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" /> + <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" /> + <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" /> + </rowConstraints> + </GridPane> </children> </GridPane> + <GridPane GridPane.rowIndex="1"> + <columnConstraints> + <ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" /> + <ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" /> + </columnConstraints> + <rowConstraints> + <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" /> + </rowConstraints> + </GridPane> </children> - </AnchorPane> + </GridPane> </children> </GridPane> - + </children> </AnchorPane>