Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion Static GUI/CSE201_v1/src/address/Admin.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
*/
public class Admin extends newUser{

public ArrayList<RequestRoomFromAdmin> requestFromStudents;

public Admin(String username, String fullname, String email, String password, String repassword, String type) {
super(username, fullname, email, password, repassword, type);
Expand Down
29 changes: 23 additions & 6 deletions Static GUI/CSE201_v1/src/address/AllRooms.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,44 @@
package address;

import java.util.ArrayList;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;

/**
*
* @author Madhav
*/

public class AllRooms {
private ArrayList<Room> roomList;
private ArrayList<RoomTime> busyRooms;
public static ArrayList<Room> roomList;
public static ArrayList<RoomTime> busyRooms;
// private ArrayList<RoomTime> availableRooms;

public AllRooms() {
roomList = new ArrayList<>();
roomList = new ArrayList<Room>();
Room C01 = new Room("C01", 100);roomList.add(C01);
Room C02 = new Room("C02", 20);roomList.add(C02);
Room C03 = new Room("C03", 20);roomList.add(C03);
Room C04 = new Room("C04", 20);roomList.add(C04);
Room C11 = new Room("C11", 100);roomList.add(C11);
Room C12 = new Room("C12", 20);roomList.add(C12);
Room C13 = new Room("C23", 20);roomList.add(C13);
Room C14 = new Room("C24", 20);roomList.add(C14);
Room C21 = new Room("C21", 100);roomList.add(C21);
Room C22 = new Room("C22", 20);roomList.add(C22);
Room C23 = new Room("C23", 20);roomList.add(C23);
Room C24 = new Room("C24", 20);roomList.add(C24);

busyRooms = new ArrayList<>();
// availableRooms = new ArrayList<>();
}

//getAvailableRooms at given time
public ArrayList<Room> getAvailableRooms(Time time){
ArrayList<Room> returnAvailableRooms = new ArrayList<>();
public static ObservableList<Room> getAvailableRooms(Time time){
ObservableList<Room> returnAvailableRooms = FXCollections.observableArrayList();

for (Room roomIterator : roomList) {
// System.out.println(roomIterator.roomNumber);
if(roomIterator.isAvailableAtGivenTime(time)){
returnAvailableRooms.add(roomIterator);
}
Expand Down
3 changes: 1 addition & 2 deletions Static GUI/CSE201_v1/src/address/Course.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@
* @author Madhav
*/
public class Course {
public String name,room,time, acronym, instructor, mandatoryElective, credits, code, monday, tuesday, wednesday, thurdsday, friday, tut, lab, preConditions, postConditions;
//room to be addded
public String name,room,time, acronym, instructor, mandatoryElective, credits, code, monday, tuesday, wednesday, thurdsday, friday, tut, lab, preConditions, postConditions;//room to be addded
// private DetailsOfCourse CourseDetails;
// private ArrayList<String> postConditions;
// private ArrayList<String> preRequisites;
Expand Down
7 changes: 4 additions & 3 deletions Static GUI/CSE201_v1/src/address/Room.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@
* @author Madhav
*/
public class Room {
private String roomNumber;
private int capacity;
private ArrayList<Time> roomBusyTime;
public String roomNumber;
public int capacity;
public ArrayList<Time> roomBusyTime;
//Room Availability will change from Time to Time

public Room(String roomNumber, int capacity){
this.roomNumber = roomNumber;
this.capacity = capacity;
Expand Down
4 changes: 2 additions & 2 deletions Static GUI/CSE201_v1/src/address/RoomTime.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
* @author Madhav
*/
public class RoomTime {
private Room room;
private Time time;
public Room room;
public Time time;

public RoomTime(Room room, Time time) {
this.room = room;
Expand Down
5 changes: 1 addition & 4 deletions Static GUI/CSE201_v1/src/address/Student.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,7 @@
*/
public class Student extends newUser{
// private String password;
private AllCourses allCourses;
private ArrayList<Course> currentCourses;
private ArrayList<RequestRoomFromAdmin> currentRequestOfRoomBooking;
private ArrayList<Course> listThatMatchGivenKeyword;

// public Student( Credential userCredential, ArrayList<String> currentCourses, TimeTable timetable) {
// super( userCredential, currentCourses, timetable);
// currentCourses = new ArrayList<>();
Expand Down
32 changes: 19 additions & 13 deletions Static GUI/CSE201_v1/src/address/Time.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
* @author Madhav
*/
public class Time {
private String startTime;
private String endTime;
private String startTime; //HH-MM
private String endTime;

public Time(String start, String end) {
startTime = start;
Expand All @@ -27,21 +27,27 @@ public String getEndTime(){

public boolean checkClash(Time check){
int startHourFirst = Integer.parseInt(this.startTime.substring(0,2));
int startMinuteFirst = Integer.parseInt(this.startTime.substring(2,4));
int startTimeFirst = startHourFirst + startMinuteFirst;

System.out.println(startHourFirst);
// System.out.println(this.startTime.substring(2));
int startMinuteFirst = Integer.parseInt(this.startTime.substring(3));
System.out.println(startMinuteFirst);
int startTimeFirst = startHourFirst*100 + startMinuteFirst;
System.out.println(startTimeFirst);
int endHourFirst = Integer.parseInt(this.endTime.substring(0,2));
int endMinuteFirst = Integer.parseInt(this.endTime.substring(2,4));
int endTimeFirst = endHourFirst + endMinuteFirst;
int endMinuteFirst = Integer.parseInt(this.endTime.substring(3));
int endTimeFirst = endHourFirst*100 + endMinuteFirst;
System.out.println(endTimeFirst);

int startHourSecond = Integer.parseInt(check.startTime.substring(0,2));
int startMinuteSecond = Integer.parseInt(check.startTime.substring(2,4));
int startTimeSecond = startHourSecond + startMinuteSecond;

int startMinuteSecond = Integer.parseInt(check.startTime.substring(3));
int startTimeSecond = startHourSecond*100 + startMinuteSecond;
System.out.println(startTimeSecond);

int endHourSecond = Integer.parseInt(check.endTime.substring(0,2));
int endMinuteSecond = Integer.parseInt(check.endTime.substring(2,4));
int endTimeSecond = endHourSecond + endMinuteSecond;

int endMinuteSecond = Integer.parseInt(check.endTime.substring(3));
int endTimeSecond = endHourSecond*100 + endMinuteSecond;
System.out.println(endTimeSecond);

if((startTimeSecond > startTimeFirst) && (startTimeSecond < endTimeFirst))
return true;
if((endTimeSecond> startTimeFirst) && (endTimeSecond < endTimeFirst))
Expand Down
15 changes: 15 additions & 0 deletions Static GUI/CSE201_v1/src/address/newUser.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,29 @@
*/
public class newUser implements Serializable{
public String username, fullname, password, repassword, email, type;
public static AllCourses allCourses;
public static ArrayList<Course> currentCourses;
public static ArrayList<RequestRoomFromAdmin> currentRequestOfRoomBooking;
public static ArrayList<Course> listThatMatchGivenKeyword;
public static ArrayList<RequestRoomFromAdmin> requestFromStudents;
public static AllRooms allRooms;


public newUser(String username, String fullname, String email, String password, String repassword, String type) {
System.out.println("NEW USER CREATED");
this.username = username;
this.fullname = fullname;
this.password = password;
this.repassword = repassword;
this.email = email;
this.type = type;
allCourses = new AllCourses();
currentCourses = new ArrayList<>();
currentRequestOfRoomBooking = new ArrayList<>();
listThatMatchGivenKeyword = new ArrayList<>();
requestFromStudents = new ArrayList<>();
allRooms = new AllRooms();

}

@Override
Expand Down
76 changes: 0 additions & 76 deletions Static GUI/CSE201_v1/src/address/view/AdminLogin.fxml
Original file line number Diff line number Diff line change
Expand Up @@ -88,82 +88,6 @@
</HBox>
</children>
</VBox>
<VBox prefHeight="232.0" prefWidth="940.0">
<children>
<HBox prefHeight="36.0" prefWidth="433.0">
<children>
<Text strokeType="OUTSIDE" strokeWidth="0.0" text="Change User Details" wrappingWidth="434.13670349121094">
<HBox.margin>
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0" />
</HBox.margin>
<font>
<Font size="18.0" />
</font>
</Text>
</children>
</HBox>
<HBox prefHeight="37.0" prefWidth="433.0">
<children>
<Text strokeType="OUTSIDE" strokeWidth="0.0" text="Name" wrappingWidth="199.4700469970703">
<font>
<Font size="16.0" />
</font>
<HBox.margin>
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0" />
</HBox.margin>
</Text>
<HBox prefHeight="65.0" prefWidth="960.0">
<children>
<TextField prefHeight="97.0" prefWidth="462.0" promptText="First Name">
<HBox.margin>
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0" />
</HBox.margin>
</TextField>
<TextField prefHeight="33.0" prefWidth="508.0" promptText="Last Name">
<HBox.margin>
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0" />
</HBox.margin>
</TextField>
</children>
</HBox>
</children>
</HBox>
<HBox prefHeight="37.0" prefWidth="433.0">
<children>
<Text strokeType="OUTSIDE" strokeWidth="0.0" text="Password" wrappingWidth="199.4700469970703">
<font>
<Font size="16.0" />
</font>
<HBox.margin>
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0" />
</HBox.margin>
</Text>
</children>
</HBox>
<HBox prefHeight="65.0" prefWidth="960.0">
<children>
<TextField prefHeight="34.0" prefWidth="440.0" promptText="Old Password">
<HBox.margin>
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0" />
</HBox.margin>
</TextField>
<TextField prefHeight="33.0" prefWidth="508.0" promptText="New Password">
<HBox.margin>
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0" />
</HBox.margin>
</TextField>
<TextField prefHeight="34.0" prefWidth="440.0" promptText="Re-enter Password">
<HBox.margin>
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0" />
</HBox.margin>
</TextField>
</children>
</HBox>
</children>
<VBox.margin>
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0" />
</VBox.margin>
</VBox>
<VBox prefHeight="61.0" prefWidth="960.0">
<children>
<Button mnemonicParsing="false" onAction="#exitToLoginPage" prefHeight="49.0" prefWidth="168.0" text="Logout">
Expand Down
76 changes: 0 additions & 76 deletions Static GUI/CSE201_v1/src/address/view/FacultyLogin.fxml
Original file line number Diff line number Diff line change
Expand Up @@ -88,82 +88,6 @@
</HBox>
</children>
</VBox>
<VBox prefHeight="232.0" prefWidth="940.0">
<children>
<HBox prefHeight="36.0" prefWidth="433.0">
<children>
<Text strokeType="OUTSIDE" strokeWidth="0.0" text="Change User Details" wrappingWidth="434.13670349121094">
<HBox.margin>
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0" />
</HBox.margin>
<font>
<Font size="18.0" />
</font>
</Text>
</children>
</HBox>
<HBox prefHeight="37.0" prefWidth="433.0">
<children>
<Text strokeType="OUTSIDE" strokeWidth="0.0" text="Name" wrappingWidth="199.4700469970703">
<font>
<Font size="16.0" />
</font>
<HBox.margin>
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0" />
</HBox.margin>
</Text>
<HBox prefHeight="65.0" prefWidth="960.0">
<children>
<TextField prefHeight="97.0" prefWidth="462.0" promptText="First Name">
<HBox.margin>
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0" />
</HBox.margin>
</TextField>
<TextField prefHeight="33.0" prefWidth="508.0" promptText="Last Name">
<HBox.margin>
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0" />
</HBox.margin>
</TextField>
</children>
</HBox>
</children>
</HBox>
<HBox prefHeight="37.0" prefWidth="433.0">
<children>
<Text strokeType="OUTSIDE" strokeWidth="0.0" text="Password" wrappingWidth="199.4700469970703">
<font>
<Font size="16.0" />
</font>
<HBox.margin>
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0" />
</HBox.margin>
</Text>
</children>
</HBox>
<HBox prefHeight="65.0" prefWidth="960.0">
<children>
<TextField prefHeight="34.0" prefWidth="440.0" promptText="Old Password">
<HBox.margin>
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0" />
</HBox.margin>
</TextField>
<TextField prefHeight="33.0" prefWidth="508.0" promptText="New Password">
<HBox.margin>
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0" />
</HBox.margin>
</TextField>
<TextField prefHeight="34.0" prefWidth="440.0" promptText="Re-enter Password">
<HBox.margin>
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0" />
</HBox.margin>
</TextField>
</children>
</HBox>
</children>
<VBox.margin>
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0" />
</VBox.margin>
</VBox>
<VBox prefHeight="61.0" prefWidth="960.0">
<children>
<Button mnemonicParsing="false" onAction="#exitToLoginPage" prefHeight="49.0" prefWidth="168.0" text="Logout">
Expand Down
Loading