diff --git a/src/JavaFXGUI/EnterInfoTab.java b/src/JavaFXGUI/EnterInfoTab.java index 4292d67..81a0d8f 100644 --- a/src/JavaFXGUI/EnterInfoTab.java +++ b/src/JavaFXGUI/EnterInfoTab.java @@ -81,8 +81,6 @@ public EnterInfoTab(MenuTabPane par, EnterStudentTab prev, String title, while(file.hasNext()){ if(goingIn){ stringData = file.nextLine(); - System.out.println(stringData+ ", " + v + ", " + version); - if (stringData.equals("+++")){ v++; } @@ -199,6 +197,8 @@ public void addData(ArrayList option){ try { PrintWriter printWriter = new PrintWriter (f); printWriter.println("DATE,ID,NAME,GR,TIME,REASON"); + TimeComparator c = new TimeComparator(); + data.get("in").getStudentList().sort(c); for(Student st : data.get("in").getStudentList()){ printWriter.print("\"" + st.getDate() + "\","); printWriter.print("\"" + st.getStudentID() + "\","); @@ -225,6 +225,8 @@ public void addData(ArrayList option){ try { PrintWriter printWriter = new PrintWriter (f); printWriter.println("DATE,ID,NAME,GR,REASON,EXCUSED,TIME,ARRTIME"); + TimeComparator c = new TimeComparator(); + data.get("outin").getStudentList().sort(c); for(Student st : data.get("outin").getStudentList()){ printWriter.print("\"" + st.getDate() + "\","); printWriter.print("\"" + st.getStudentID() + "\","); @@ -266,6 +268,8 @@ public void addData(ArrayList option){ try { PrintWriter printWriter = new PrintWriter (f); printWriter.println("DATE,ID,NAME,GR,TIME,REASON"); + TimeComparator c = new TimeComparator(); + data.get("in").getStudentList().sort(c); for(Student st : data.get("in").getStudentList()){ printWriter.print("\"" + st.getDate() + "\","); printWriter.print("\"" + st.getStudentID() + "\","); @@ -292,6 +296,8 @@ public void addData(ArrayList option){ try { PrintWriter printWriter = new PrintWriter (f); printWriter.println("DATE,ID,NAME,GR,REASON,EXCUSED,TIME,ARRTIME"); + TimeComparator c = new TimeComparator(); + data.get("outin").getStudentList().sort(c); for(Student st : data.get("outin").getStudentList()){ printWriter.print("\"" + st.getDate() + "\","); printWriter.print("\"" + st.getStudentID() + "\","); diff --git a/src/JavaFXGUI/EnterStudentTab.java b/src/JavaFXGUI/EnterStudentTab.java index 5376f14..7a89cea 100644 --- a/src/JavaFXGUI/EnterStudentTab.java +++ b/src/JavaFXGUI/EnterStudentTab.java @@ -259,10 +259,6 @@ private void submitButton(){ } } } - - - - } else{ @@ -283,10 +279,17 @@ private void moveOn(boolean signIn, Student student){ EnterInfoTab tab3; boolean outin = false; int j = 0; + for(int i = 0;i handle()); @@ -112,6 +112,7 @@ public void init(){ bottomHBox = new HBox(); bottomHBox.getStyleClass().add("bottomHBox"); + bottomHBox.setFillHeight(false); getChildren().add(bottomHBox); } @@ -215,7 +216,12 @@ public void splitScreen(int page, ArrayList data){ OptionButton opt = new OptionButton(data.get(i), data.get(i), page); left.add(opt); } + buttonList.get(page).addAll(left) ; + buttonList.get(page).get(0).getStyleClass().add("optionButton-top"); + buttonList.get(page).get(1).getStyleClass().add("optionButton-mid"); + buttonList.get(page).get(2).getStyleClass().add("optionButton-bottom"); + option.add(""); updateState(0); @@ -243,6 +249,7 @@ public void addRadButton(){ }); HBox hb = new HBox(60); + hb.getStyleClass().add("hbox"); hb.getChildren().addAll(l,h,p); hb.setAlignment(Pos.CENTER); diff --git a/src/JavaFXGUI/SettingHBox.java b/src/JavaFXGUI/SettingHBox.java index 0b3214c..da873f2 100644 --- a/src/JavaFXGUI/SettingHBox.java +++ b/src/JavaFXGUI/SettingHBox.java @@ -157,7 +157,7 @@ public SettingHBox(StartApplication p, double width, TabPane tableTabPane = new TabPane(); tableTabPane.setSide(Side.LEFT); - tableTabPane.getStyleClass().add("tabTable"); + tableTabPane.getStyleClass().add("tab"); tableSignIn = createTableIn(); @@ -317,6 +317,8 @@ private void saveFile(){ } writer.println(); ArrayList temp = data.get("in").getStudentList(); + TimeComparator c = new TimeComparator(); + temp.sort(c); for (int i = 0; i < temp.size(); i++){ writer.print (temp.get(i).getDate() + ", "); writer.print (temp.get(i).getName() + ", "); @@ -342,6 +344,7 @@ private void saveFile(){ } writerOutIn.println(); temp = data.get("outIn").getStudentList(); + data.get("outIn").getStudentList().sort(c); for (int i = 0; i < temp.size(); i++){ writerOutIn.print (temp.get(i).getDate() + ", "); writerOutIn.print (temp.get(i).getName() + ", "); diff --git a/src/JavaFXGUI/StartApplication.java b/src/JavaFXGUI/StartApplication.java index 257748a..23e52d1 100644 --- a/src/JavaFXGUI/StartApplication.java +++ b/src/JavaFXGUI/StartApplication.java @@ -134,6 +134,9 @@ public void start(Stage primaryStage) throws Exception { borderPane.prefHeightProperty().bind(scene.heightProperty()); borderPane.prefWidthProperty().bind(scene.widthProperty()); + content.getStyleClass().add("background"); + borderPane.getStyleClass().add("background"); + borderPane.setCenter(tabPane); content.getChildren().add(borderPane); root.getChildren().add(content); @@ -141,12 +144,13 @@ public void start(Stage primaryStage) throws Exception { primaryStage.show(); optionBorderPane= new BorderPane(); - optionBorderPane.getStyleClass().add("optionContent"); +// optionBorderPane.getStyleClass().add("optionContent"); + optionBorderPane.getStyleClass().add("background"); optionBorderPane.setOpacity(0); contentPane = new HBox(); - contentPane.getStyleClass().add("ContentPane"); +// contentPane.getStyleClass().add("ContentPane"); contentPane.setPrefHeight(primaryStage.getHeight()-100); @@ -244,9 +248,7 @@ else if (opt == "i"){ String name = student.get(field.get("NAME")); int grade = Integer.parseInt(student.get(field.get("GR"))); Student st = new Student (name,grade,id); - System.out.println(student.get(field.get("TIME"))); st.setTime(student.get(field.get("TIME"))); - System.out.println(student.get(field.get("TIME"))); st.setReason(student.get(field.get("REASON"))); st.setDate(student.get(field.get("DATE"))); list.add(st); diff --git a/src/JavaFXGUI/StartTab.java b/src/JavaFXGUI/StartTab.java index c1ebb97..7c2e283 100644 --- a/src/JavaFXGUI/StartTab.java +++ b/src/JavaFXGUI/StartTab.java @@ -73,7 +73,8 @@ public StartTab(MenuTabPane p, String title, HashMap data, content.setBottom(menuBar); alert = new AnimatedAlertBox("Submission Sucessful!", false); content.setTop(alert); - + menuBar.getStyleClass().add("background"); + settings.getStyleClass().add("settings"); setContent(content); switchMode(); @@ -132,6 +133,7 @@ public void switchMode(){ submitButton.setDefaultButton(true); submitButton.setPrefSize(100, 20); submitButton.setOnAction(e -> submitButton()); + submitButton.getStyleClass().add("submitButton"); labelHBox.getChildren().addAll(studentIDLabel); labelHBox.setAlignment(Pos.CENTER); @@ -182,18 +184,19 @@ public void handle(MouseEvent click) { } else{ - HBox contentHBox = new HBox(); + VBox contentHBox = new VBox(); contentHBox.setAlignment(Pos.CENTER); contentHBox.setPadding(new Insets(15, 12, 15, 12)); contentHBox.setSpacing(10); + contentHBox.getStyleClass().add("background"); - Button buttonSignIn = new Button("Student Sign In"); - buttonSignIn.setPrefSize(300, 50); + Button buttonSignIn = new Button("STUDENT SIGN IN"); + buttonSignIn.setPrefSize(300, 60); buttonSignIn.setOnAction(e -> moveOn(true)); buttonSignIn.getStyleClass().add("signButton"); - Button buttonSignOut = new Button("Student Sign Out"); - buttonSignOut.setPrefSize(300, 50); + Button buttonSignOut = new Button("STUDENT SIGN OUT"); + buttonSignOut.setPrefSize(300, 60); buttonSignOut.setOnAction(e -> moveOn(false)); buttonSignOut.getStyleClass().add("signButton"); @@ -301,7 +304,8 @@ else if (searchTextField.getText().isEmpty()){ /** * Handles late bus entries. The student's reason is automatically set as "Late Bus," and their time * of arrival is recorded in the log. - * @param txt Name of student + * @param txt Keyboard input of student (name or ID) + * @param id true if the student is entering their ID, false if student is entering name */ public void submit(String txt, boolean id){ searchTextField.clear(); @@ -328,6 +332,8 @@ public void submit(String txt, boolean id){ try { PrintWriter printWriter = new PrintWriter (f); printWriter.println("DATE,ID,NAME,GR,TIME,REASON"); + TimeComparator c = new TimeComparator(); + data.get("in").getStudentList().sort(c); for(Student st : data.get("in").getStudentList()){ printWriter.print("\"" + st.getDate() + "\","); printWriter.print("\"" + st.getStudentID() + "\","); diff --git a/src/JavaFXGUI/TimeComparator.java b/src/JavaFXGUI/TimeComparator.java index bafe65f..8fa4d23 100644 --- a/src/JavaFXGUI/TimeComparator.java +++ b/src/JavaFXGUI/TimeComparator.java @@ -5,7 +5,7 @@ import backend.Student; /** - * Comparator class for a student toString() that sorts by time the program is updated. + * Comparator class for a student toString() that sorts by time the student signs in/out. * @author Ishana */ public class TimeComparator implements Comparator{ @@ -13,7 +13,7 @@ public class TimeComparator implements Comparator{ @Override public int compare(Student o1, Student o2) { - return o1.getTime().compareTo(o2.getTime()); + return o2.getTime().compareTo(o1.getTime()); } } diff --git a/src/css/application.css b/src/css/application.css index e5a72bc..c37d944 100644 --- a/src/css/application.css +++ b/src/css/application.css @@ -6,9 +6,11 @@ .root{ -fx-font-family: "Avenir"; - + -fx-background-color: #000000; +} +.background{ + -fx-background-color: #000000; } - .alertMessage{ -fx-background-color: #b94a48; -fx-border-color: #b94a48; @@ -31,22 +33,41 @@ .sucessText{ -fx-text-fill: #fff; } +.signButton{ + font-size: 22; + -fx-font-weight: bold; + -fx-border-radius: 4px; + -fx-background-radius: 4px; + -fx-padding: 3px 16px 3px 12px; + -fx-text-fill: #000000; + -fx-background-color: #F9D803; + -fx-border-color: #F9D803; + } +.signButton:hover{ + -fx-text-fill: #F9D803; + -fx-background-color: #FFFFFF; + -fx-border-color: #285e8e; +} + +.signButton:armed{ + -fx-text-fill: #ffffff !important; + -fx-background-color: #286090 !important; + -fx-border-color: #204d74 !important; +} .button { -fx-border-radius: 4px; -fx-background-radius: 4px; -fx-padding: 3px 17px 3px 12px; -fx-text-fill: #000000; - -fx-background-color: #FFD700; - -fx-border-color: #FFD700; - -fx-font-size: 21.5px; - width: 20px; - height: 10px; + -fx-background-color: #F9D803; + -fx-border-color: #F9D803; + -fx-font-size: 25px; + font-weight: bold; } .button:hover { -fx-text-fill: #ffffff; -fx-background-color: #3276b1; -fx-border-color: #285e8e; - } .button:armed { @@ -118,14 +139,12 @@ } - - .optionSelect{ -fx-alignment: center; -fx-background-color: transparent; - -fx-border-color: #808080; - -fx-border-width: 1; - -fx-border-radius: 5; + -fx-border-color: #F9D803; + -fx-border-width: 5; + -fx-border-radius: 10; } @@ -138,7 +157,7 @@ -fx-text-fill: #000000; -fx-border-radius: 0; -fx-background-radius: 5 5 0 0; - -fx-font-size: 12pt; + -fx-font-size: 21.5px; } .optionButton-top { @@ -147,7 +166,7 @@ -fx-background-radius: 0 0 0 0; -fx-border-radius: 0 0 0 0; -fx-background-color: #fff; - -fx-border-color: #ccc; + -fx-border-color: #F9D803; -fx-text-fill: black; -fx-border-width: 0 0 0.5 0; -fx-font-size: 20px; @@ -159,7 +178,7 @@ -fx-background-radius: 0 0 0 0; -fx-border-radius: 0 0 0 0; -fx-background-color: #fff; - -fx-border-color: #ccc; + -fx-border-color: #F9D803; -fx-text-fill: black; -fx-border-width: 0.5 0 0.5 0; -fx-font-size: 20px; @@ -168,7 +187,7 @@ .optionButton-bottom{ -fx-max-height: 10000; -fx-max-width: 10000; - -fx-border-color: #ccc #ccc #337ab7 #ccc; + -fx-border-color: #F9D803 #F9D803 #337ab7 #F9D803; -fx-text-fill: black; -fx-border-width: 0.5 0 0 0; -fx-border-radius: 0 0 0 0; @@ -202,10 +221,12 @@ .optionTextFieldOther{ - -fx-border-color: #ccc #ccc #337ab7 #ccc; + -fx-border-color: #F9D803 #F9D803 #F9D803 #F9D803; -fx-text-fill: black; - -fx-border-width: 0.5 0 0 0; - -fx-border-radius: 0 0 0 0; + -fx-font-size: 18px; + -fx-background-color: white; + -fx-border-width: 0.5 0 0.5 0; + -fx-border-radius: 0.5 0 0.5 0; -fx-background-radius: 0 0 0 0; -fx-padding: 0; @@ -215,7 +236,7 @@ .textFieldOtherButton{ -fx-font-size: 20pt; -fx-background-color: #5cb85c; - -fx-border-color: #4cae4c; + -fx-border-color: #F9D803; } .textFieldOtherButton:hover { @@ -231,8 +252,14 @@ } .textFieldOther{ -fx-min-height: 10; + -fx-border-color: #F9D803; +} +.settings{ + -fx-background-color: #F9D803; + -fx-border-color: #F9D803; + -fx-text-fill: white; + -fx-font-color: white; } - .submitButton{ -fx-font-size: 20px; -fx-background-color: #5cb85c; @@ -263,27 +290,32 @@ } .bottomHBox{ - -fx-max-height: 40; + -fx-max-height: 50; -fx-pref-height: 40; -fx-max-width: 10000; - -fx-border-color: #ccc #ccc #337ab7 #ccc; + -fx-border-color: #F9D803 #F9D803 #F9D803 #F9D803; -fx-text-fill: black; - -fx-border-width: 0.5 0 0 0; - -fx-border-radius: 0 0 0 0; + -fx-border-width: 0.5 0 0.5 0; + -fx-border-radius: 0.5 0 0.5 0; -fx-background-radius: 0 0 0 0; + -fx-background-color: white; -fx-alignment: center; } .buttonVBox { -fx-alignment: center; } - +.hbox{ + -fx-background-color: white; + -fx-border-width: 0.5 0 0.5 0; + -fx-border-radius: 0.5 0 0.5 0; +} .RadioButton { -fx-font-size: 18px; } .tab{ -fx-background-color: #FFF; - -fx-border-color: #eeeeee; + -fx-border-color: #000000; -fx-padding-left: 5; -fx-padding-right: 4; -fx-border-width: 1 1 1 1; @@ -387,12 +419,13 @@ .tab-header-background{ - -fx-background-color: rgb(231,231,231); + -fx-background-color: white; } .tab-pane .tab:selected { -fx-background-color: #FFF; + -fx-border-color: #000000; } .tab:selected .tab-label { -fx-alignment: CENTER; @@ -409,7 +442,7 @@ } .ContentPane{ - -fx-background-color: #fff; + -fx-background-color: #F9D803; -fx-background-radius: 0; -fx-border-radius: 0; -fx-border-color: #357ebd; @@ -421,7 +454,7 @@ -fx-border-color: transparent; -fx-background-radius: 0; -fx-border-radius: 0; - -fx-background-color: #fff; + -fx-background-color: #FFFFFF; } @@ -637,5 +670,7 @@ -fx-background-color: transparent; } .studentIDLabel{ - -fx-font-size: 15; + -fx-font-color: #FFFFFF; + -fx-text-fill: white; + -fx-font-size: 17; } \ No newline at end of file diff --git a/src/img/image.png b/src/img/image.png index 0e12fd7..789796f 100644 Binary files a/src/img/image.png and b/src/img/image.png differ