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 3fc975f0ef81e8c2abb42bda946a89bd991e2b5c
parent 6ed46827b407dd2225581d9bcdf40e756f481be7
Author: Nick Econopouly <wry@mm.st>
Date:   Tue, 18 Feb 2020 16:49:46 -0500

Merge pull request #4 from jamisonv93/master

Add comments and file name changes

Classes modified: App, PrimaryController, Course, Section, User, and Schedule
Diffstat:
Msrc/ScheduleCreator/App.java | 23+++++++++++++++++++----
Msrc/ScheduleCreator/PrimaryController.java | 37+++++++++++++++++++------------------
Msrc/ScheduleCreator/models/Course.java | 41+++++++++++++++++++++++++++--------------
Msrc/ScheduleCreator/models/Schedule.java | 13++++++++-----
Msrc/ScheduleCreator/models/Section.java | 61++++++++++++++++++++++++++++++++-----------------------------
Msrc/ScheduleCreator/models/User.java | 22+++++++++++++++++-----
Dsrc/ScheduleCreator/resources/ClassView.fxml | 20--------------------
Msrc/ScheduleCreator/resources/primary.fxml | 4++--
Rsrc/ScheduleCreator/resources/registrationScreen.fxml -> src/ScheduleCreator/resources/registration_screen.fxml | 0
Asrc/ScheduleCreator/resources/select_classes.fxml | 20++++++++++++++++++++
10 files changed, 144 insertions(+), 97 deletions(-)

diff --git a/src/ScheduleCreator/App.java b/src/ScheduleCreator/App.java @@ -1,5 +1,13 @@ package ScheduleCreator; +/** + * This class is used to start and initialize the application + * + * @author Jamison Valentine, Ilyass Sfar, Nick Econopouly, Nathan Tolodzieki + * + * Last Updated: 2/17/2020 + */ + import java.io.IOException; import javafx.application.Application; import javafx.event.ActionEvent; @@ -13,21 +21,28 @@ import javafx.stage.Stage; public class App extends Application { + /** + * Starts application and opens to first window/stage. + */ @Override public void start(Stage primaryStage) throws IOException { + // loads GUI components from primary.xml Parent root = FXMLLoader.load(getClass().getResource("resources/primary.fxml")); + // adds components to Scene Scene primaryScene = new Scene(root); + // set title of application window primaryStage.setTitle("Schedule Creator"); + + // sets primary scene primaryStage.setScene(primaryScene); + + // shows window on screen primaryStage.show(); - } + } - /** - * @param args the command line arguments - */ public static void main(String[] args) { launch(args); } diff --git a/src/ScheduleCreator/PrimaryController.java b/src/ScheduleCreator/PrimaryController.java @@ -1,5 +1,13 @@ package ScheduleCreator; +/** + * This class serves as the controller for the primary view + * + * @author Jamison Valentine, Ilyass Sfar, Nick Econopouly, Nathan Tolodzieki + * + * Last Updated: 2/17/2020 + */ + import javafx.application.Application; import javafx.event.ActionEvent; import javafx.event.EventHandler; @@ -15,40 +23,37 @@ import java.net.URL; import java.util.ResourceBundle; import javafx.fxml.Initializable; - public class PrimaryController implements Initializable { - - - public void changeToBrowseClasses(ActionEvent event) throws Exception { + + public void changeToSelectClasses(ActionEvent _event) throws Exception { //new FXML loader and scene for new screen - Parent root = FXMLLoader.load(getClass().getResource("resources/ClassView.fxml")); + Parent root = FXMLLoader.load(getClass().getResource("resources/select_classes.fxml")); Scene classViewScene = new Scene(root); //Get information from primary stage - Stage window = (Stage)((Node)event.getSource()).getScene().getWindow(); + Stage window = (Stage)((Node)_event.getSource()).getScene().getWindow(); window.setScene(classViewScene); window.show(); - } - public void backToPrimary(ActionEvent event) throws Exception { + public void backToPrimary(ActionEvent _event) throws Exception { Parent root = FXMLLoader.load(getClass().getResource("resources/primary.fxml")); Scene primaryScene = new Scene(root); //Get information from primary stage - Stage window = (Stage)((Node)event.getSource()).getScene().getWindow(); + Stage window = (Stage)((Node)_event.getSource()).getScene().getWindow(); window.setScene(primaryScene); - window.show(); + window.show(); } - public void changeToRegistrationScreen(ActionEvent event) throws Exception { + public void changeToRegistrationScreen(ActionEvent _event) throws Exception { - Parent root = FXMLLoader.load(getClass().getResource("resources/registrationScreen.fxml")); + Parent root = FXMLLoader.load(getClass().getResource("resources/registration_screen.fxml")); Scene scene = new Scene(root); - Stage stage = (Stage)((Node)event.getSource()).getScene().getWindow(); + Stage stage = (Stage)((Node)_event.getSource()).getScene().getWindow(); stage.setScene(scene); stage.show(); } @@ -56,9 +61,5 @@ public class PrimaryController implements Initializable { @Override public void initialize(URL url, ResourceBundle rb) { - - - } - - + } } diff --git a/src/ScheduleCreator/models/Course.java b/src/ScheduleCreator/models/Course.java @@ -1,38 +1,51 @@ +package ScheduleCreator.models; + +/** + * This class stores various course information. + * + * @author Jamison Valentine, Ilyass Sfar, Nick Econopouly, Nathan Tolodzieki + * + * Last Updated: 2/17/2020 + */ + +import java.util.ArrayList; + public class Course { protected String abbreviation; protected int courseNumber; -protected Section[] sections; +protected ArrayList<String> sections; public Course() { - + } - + public String getabbreviation() { return abbreviation; } - public void setabbreviation(String ABBREVIATION) { - this.abbreviation = ABBREVIATION; + public void setabbreviation(String _abbreviation) { + this.abbreviation = _abbreviation; } + //================= GETTERS =============== + public int getCourseNumber() { return courseNumber; } - public void setCourseNumber(int courseNumber) { - this.courseNumber = courseNumber; - } - - public Section[] getSections() { + public ArrayList<String> getSections() { return sections; } - public void setSections(Section[] sections) { - this.sections = sections; - } + //================= SETTERS =============== + public void setCourseNumber(int _courseNumber) { + this.courseNumber = _courseNumber; + } + public void addSection(ArrayList<String> _sections) { + this.sections = _sections; + } - } diff --git a/src/ScheduleCreator/models/Schedule.java b/src/ScheduleCreator/models/Schedule.java @@ -1,10 +1,13 @@ +package ScheduleCreator.models; /** + * This class keeps track of added course sections and produces CRNs. * - * @author jamis + * @author @author Jamison Valentine, Ilyass Sfar, Nick Econopouly, Nathan Tolodzieki */ + public class Schedule { - + protected Section[] sections; protected int credits; //checkConflicts @@ -14,9 +17,9 @@ public class Schedule { //saveSchedule //resetSchedule //generateRandomSchedules - + public Schedule() { - + } - + } diff --git a/src/ScheduleCreator/models/Section.java b/src/ScheduleCreator/models/Section.java @@ -1,65 +1,68 @@ +package ScheduleCreator.models; import java.util.HashMap; - /** + * This class models information for course sections. + * + * @author Jamison Valentine, Ilyass Sfar, Nick Econopouly, Nathan Tolodzieki * - * @author Jamison Valentine, - * Last Updated: + * Last Updated: 2/17/2020 */ + public class Section { - - + protected String location; protected String instructor; protected HashMap daysAndTimes; protected String CRN; protected int sectionNumber; - + public Section() { - - } - - public int getSectionNumber() { - return sectionNumber; } - public void setSectionNumber(int sectionNumber) { - this.sectionNumber = sectionNumber; - } +//================= GETTERS =============== - public String getLocation() { - return location; + public HashMap getDaysAndTimes() { + return daysAndTimes; } - public void setLocation(String location) { - this.location = location; + public String getCRN() { + return CRN; } public String getInstructor() { return instructor; } - public void setInstructor(String instructor) { - this.instructor = instructor; + public String getLocation() { + return location; } - public HashMap getDaysAndTimes() { - return daysAndTimes; + public int getSectionNumber() { + return sectionNumber; } - public void setDaysAndTimes(HashMap daysAndTimes) { - this.daysAndTimes = daysAndTimes; +//================= SETTERS =============== + + public void setSectionNumber(int _sectionNumber) { + this.sectionNumber = _sectionNumber; } - public String getCRN() { - return CRN; + public void setLocation(String _location) { + this.location = _location; } - public void setCRN(String CRN) { - this.CRN = CRN; + public void setInstructor(String _instructor) { + this.instructor = _instructor; } - + public void setDaysAndTimes(HashMap _daysAndTimes) { + this.daysAndTimes = _daysAndTimes; + } + + public void setCRN(String _CRN) { + this.CRN = _CRN; + } } diff --git a/src/ScheduleCreator/models/User.java b/src/ScheduleCreator/models/User.java @@ -1,12 +1,24 @@ -package ScheduleCreator; +package ScheduleCreator.models; + /** + * The class stores user information and class selections. * - * @author jamis + * @author Jamison Valentine, Ilyass Sfar, Nick Econopouly, Nathan Tolodzieki + * + * Last Updated: 2/17/2020 */ + public class User { - + protected String advisor; + protected Schedule schedule; protected int advisingCode; - - + + public User() { + + } + + public void selectCourse(Course _course) { + + } } diff --git a/src/ScheduleCreator/resources/ClassView.fxml b/src/ScheduleCreator/resources/ClassView.fxml @@ -1,20 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<?import java.lang.*?> -<?import java.util.*?> -<?import javafx.scene.*?> -<?import javafx.scene.control.*?> -<?import javafx.scene.layout.*?> - -<AnchorPane id="AnchorPane" prefHeight="400.0" prefWidth="600.0" xmlns:fx="http://javafx.com/fxml/1" xmlns="http://javafx.com/javafx/1" fx:controller="ScheduleCreator.PrimaryController"> - <children> - <Button text="Back" onAction="#backToPrimary" /> - <StackPane layoutX="200.0" layoutY="131.0" prefHeight="150.0" prefWidth="200.0"> - <children> - <ChoiceBox prefWidth="150.0" /> - <ListView></ListView> - - </children> - </StackPane> - </children> -</AnchorPane> diff --git a/src/ScheduleCreator/resources/primary.fxml b/src/ScheduleCreator/resources/primary.fxml @@ -8,7 +8,7 @@ <AnchorPane id="AnchorPane" prefHeight="400.0" prefWidth="600.0" xmlns:fx="http://javafx.com/fxml/1" xmlns="http://javafx.com/javafx/1" fx:controller="ScheduleCreator.PrimaryController"> <children> - <Button layoutX="245.0" layoutY="123.0" onAction="#changeToBrowseClasses" prefHeight="37.0" prefWidth="111.0" text="Browse Classes" /> - <Button layoutX="245.0" layoutY="213.0" onAction="#changeToRegistrationScreen" prefHeight="37.0" prefWidth="111.0" text="myRegistration" /> + <Button layoutX="245.0" layoutY="123.0" onAction="#changeToSelectClasses" prefHeight="37.0" prefWidth="130.0" text="Browse Classes" /> + <Button layoutX="245.0" layoutY="213.0" onAction="#changeToRegistrationScreen" prefHeight="37.0" prefWidth="130.0" text="myRegistration" /> </children> </AnchorPane> diff --git a/src/ScheduleCreator/resources/registrationScreen.fxml b/src/ScheduleCreator/resources/registration_screen.fxml diff --git a/src/ScheduleCreator/resources/select_classes.fxml b/src/ScheduleCreator/resources/select_classes.fxml @@ -0,0 +1,20 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<?import java.lang.*?> +<?import java.util.*?> +<?import javafx.scene.*?> +<?import javafx.scene.control.*?> +<?import javafx.scene.layout.*?> + +<AnchorPane id="AnchorPane" prefHeight="400.0" prefWidth="600.0" xmlns:fx="http://javafx.com/fxml/1" xmlns="http://javafx.com/javafx/1" fx:controller="ScheduleCreator.PrimaryController"> + <children> + <Button text="Back" onAction="#backToPrimary" /> + <StackPane layoutX="200.0" layoutY="131.0" prefHeight="150.0" prefWidth="200.0"> + <children> + <ChoiceBox prefWidth="150.0" /> + <ListView /> + + </children> + </StackPane> + </children> +</AnchorPane>