-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
created the index.html/styles.css and the docs dir
- Loading branch information
1 parent
88acf6f
commit e527ab6
Showing
9 changed files
with
327 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
package Controllers; | ||
|
||
import java.util.ArrayList; | ||
|
||
import DAOs.FacultyDAO; | ||
import DAOs.ScheduleDAO; | ||
import Models.Schedule; | ||
import javafx.event.ActionEvent; | ||
import javafx.fxml.FXML; | ||
import javafx.scene.control.Alert; | ||
import javafx.scene.control.Alert.AlertType; | ||
import javafx.scene.control.Button; | ||
import javafx.scene.control.TableColumn; | ||
import javafx.scene.control.TableView; | ||
import javafx.scene.control.TextField; | ||
import javafx.scene.control.cell.PropertyValueFactory; | ||
import javafx.scene.input.MouseEvent; | ||
import javafx.scene.text.Text; | ||
|
||
public class ViewFacultyCoursesController { | ||
|
||
@FXML | ||
private TableColumn<Schedule, Long> CRNColumn; | ||
|
||
@FXML | ||
private TableColumn<Schedule, String> CourseIDColumn; | ||
|
||
@FXML | ||
private TableColumn<Schedule, String> TermColumn; | ||
|
||
@FXML | ||
private TableColumn<Schedule, String> courseNameColumn; | ||
|
||
@FXML | ||
private Button searchButton; | ||
|
||
@FXML | ||
private TableView<Schedule> tableView; | ||
|
||
@FXML | ||
private Text textFacultyCourses; | ||
|
||
@FXML | ||
private Text textInstructorName; | ||
|
||
@FXML | ||
private TextField tfFacultyID; | ||
|
||
@FXML | ||
void ClearIfDefaultText(MouseEvent event) { | ||
if (tfFacultyID.getText().equals("Enter faculty ID")) { | ||
tfFacultyID.setText(""); | ||
} | ||
} | ||
|
||
@FXML | ||
void search(ActionEvent event) { | ||
if (!tfFacultyID.getText().equals("Enter faculty ID") && !tfFacultyID.getText().equals("") && tfFacultyID.getText().length() == 9) { | ||
ArrayList<Schedule> courses = ScheduleDAO.getCoursesByFaculty(tfFacultyID.getText()); | ||
tableView.getItems().clear(); | ||
tableView.getItems().addAll(courses); | ||
textFacultyCourses.setText("Faculty Courses for: "); | ||
textInstructorName.setText(FacultyDAO.getFacultyName(tfFacultyID.getText())); | ||
CRNColumn.setCellValueFactory(new PropertyValueFactory<Schedule, Long>("CRN")); | ||
CourseIDColumn.setCellValueFactory(new PropertyValueFactory<Schedule, String>("courseID")); | ||
courseNameColumn.setCellValueFactory(new PropertyValueFactory<Schedule, String>("courseName")); | ||
TermColumn.setCellValueFactory(new PropertyValueFactory<Schedule, String>("term")); | ||
} | ||
else { | ||
Alert alert = new Alert(AlertType.ERROR); | ||
alert.setTitle("Error"); | ||
alert.setHeaderText("Error"); | ||
alert.setContentText("Please enter a valid faculty ID"); | ||
alert.showAndWait(); | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
|
||
<?import javafx.geometry.Insets?> | ||
<?import javafx.scene.control.Button?> | ||
<?import javafx.scene.control.TableColumn?> | ||
<?import javafx.scene.control.TableView?> | ||
<?import javafx.scene.control.TextField?> | ||
<?import javafx.scene.layout.BorderPane?> | ||
<?import javafx.scene.layout.HBox?> | ||
<?import javafx.scene.text.Text?> | ||
|
||
<BorderPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="400.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/21" xmlns:fx="http://javafx.com/fxml/1" fx:controller="Controllers.ViewFacultyCoursesController"> | ||
<center> | ||
<TableView fx:id="tableView" prefHeight="296.0" prefWidth="600.0" BorderPane.alignment="CENTER"> | ||
<columns> | ||
<TableColumn fx:id="CRNColumn" prefWidth="75.0" text="CRN" /> | ||
<TableColumn fx:id="CourseIDColumn" prefWidth="75.0" text="Course ID" /> | ||
<TableColumn fx:id="courseNameColumn" prefWidth="75.0" text="Course Name" /> | ||
<TableColumn fx:id="TermColumn" prefWidth="75.0" text="Term" /> | ||
</columns> | ||
</TableView> | ||
</center> | ||
<bottom> | ||
<HBox alignment="CENTER" prefHeight="26.0" prefWidth="600.0" style="-fx-background-color: grey;" BorderPane.alignment="CENTER"> | ||
<children> | ||
<Text fill="WHITE" strokeType="OUTSIDE" strokeWidth="0.0" text="Enter Faculty ID"> | ||
<HBox.margin> | ||
<Insets left="10.0" right="10.0" /> | ||
</HBox.margin> | ||
</Text> | ||
<TextField fx:id="tfFacultyID" alignment="CENTER" onMouseClicked="#ClearIfDefaultText" promptText="Faculty ID:" style="-fx-background-color: grey; -fx-text-fill: white;"> | ||
<HBox.margin> | ||
<Insets left="10.0" right="10.0" /> | ||
</HBox.margin> | ||
</TextField> | ||
<Button fx:id="searchButton" mnemonicParsing="false" onAction="#search" text="Search" textFill="WHITE"> | ||
<HBox.margin> | ||
<Insets left="10.0" right="10.0" /> | ||
</HBox.margin> | ||
</Button> | ||
</children> | ||
<BorderPane.margin> | ||
<Insets /> | ||
</BorderPane.margin> | ||
</HBox> | ||
</bottom> | ||
<top> | ||
<HBox alignment="CENTER" prefHeight="32.0" prefWidth="600.0" style="-fx-background-color: grey;" BorderPane.alignment="CENTER"> | ||
<children> | ||
<Text fx:id="textFacultyCourses" fill="WHITE" strokeType="OUTSIDE" strokeWidth="0.0" text="Faculty Courses " /> | ||
<Text fx:id="textInstructorName" fill="WHITE" strokeType="OUTSIDE" strokeWidth="0.0" text=""> | ||
<HBox.margin> | ||
<Insets left="5.0" /> | ||
</HBox.margin> | ||
</Text> | ||
</children> | ||
</HBox> | ||
</top> | ||
</BorderPane> |
Oops, something went wrong.