Skip to content
Snippets Groups Projects
Commit a4d0794a authored by eyan_'s avatar eyan_
Browse files

employee views

parent 172a4378
No related branches found
No related tags found
No related merge requests found
Showing
with 159 additions and 3 deletions
......@@ -227,7 +227,60 @@ public class Controller {
else{
managerScheduleClicked(event);
}
}
public void employeeDailyClicked(){
System.out.println("employee daily clicked");
root.setCenter(dailyView);
root.setLeft(sidePanel);
root.setBottom(bottomPanel);
}
public void employeeWeeklyClicked(){
System.out.println("employee weekly clicked");
root.setCenter(weeklyView);
root.setLeft(sidePanel);
root.setBottom(bottomPanel);
}
public void employeePickupClicked() throws IOException {
System.out.println("employee pickup clicked");
FXMLLoader pickupLoader = new FXMLLoader(getClass().getResource("employeePickup.fxml"));
pickupLoader.setController(this);
root.setCenter(pickupLoader.load());
root.setBottom(null);
}
public void employeeScheduleClicked(){
System.out.println("employee schedule clicked");
employeeWeeklyClicked();
}
public void employeeAvailabilityClicked() throws IOException {
System.out.println("employee availability clicked");
FXMLLoader availabilityLoader = new FXMLLoader(getClass().getResource("employeeAvailability.fxml"));
availabilityLoader.setController(this);
FXMLLoader availabilityFooterLoader = new FXMLLoader(getClass().getResource("employeeAvailabilityFooter.fxml"));
availabilityFooterLoader.setController(this);
root.setCenter(availabilityLoader.load());
root.setLeft(null);
root.setBottom(availabilityFooterLoader.load());
}
public void employeePaystubClicked() throws IOException {
System.out.println("employee paystub clicked");
FXMLLoader paystubLoader = new FXMLLoader(getClass().getResource("employeePaystub.fxml"));
paystubLoader.setController(this);
root.setCenter(paystubLoader.load());
root.setLeft(null);
root.setBottom(bottomPanel);
}
public void employeeNextButtonClicked(){
System.out.println("employee next clicked");
}
public void employeePrevButtonClicked(){
System.out.println("employee prev clicked");
}
public void employeeJumpButtonClicked(){
System.out.println("employee jump clicked");
}
// Login Page
......@@ -270,13 +323,29 @@ public class Controller {
}
public void employeeLoginClicked(MouseEvent mouseEvent) throws IOException {
FXMLLoader employeeLoader = new FXMLLoader(this.getClass().getResource("mainView.fxml"));
employeeLoader.setController(this);
Parent root = employeeLoader.load();
model = new Model("localhost", 8989);
model.setIsManager(true);
model.setThisEmployee(Integer.parseInt(loginField.getText())); //todo:need guard to allow only #
FXMLLoader headerLoader = new FXMLLoader(this.getClass().getResource("employeeHeader.fxml"));
headerLoader.setController(this);
header = headerLoader.load();
FXMLLoader sideLoader = new FXMLLoader(this.getClass().getResource("employeeSchedSidePanel.fxml"));
sideLoader.setController(this);
sidePanel = sideLoader.load();
FXMLLoader bottomLoader = new FXMLLoader(this.getClass().getResource("employeeSchedBottomPanel.fxml"));
bottomLoader.setController(this);
bottomPanel = bottomLoader.load();
root = new BorderPane();
root.setTop(header);
root.setLeft(sidePanel);
root.setBottom(bottomPanel);
dailyView = new DailyView();
dailyView.setModel(model);
weeklyView = new WeeklyView();
weeklyView.setModel(model);
root.setCenter(weeklyView);
Stage stage = (Stage)((Node)mouseEvent.getSource()).getScene().getWindow();
Scene scene = new Scene(root, 800, 600);
......
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.scene.control.Label?>
<Label text="availability test" xmlns="http://javafx.com/javafx/17" xmlns:fx="http://javafx.com/fxml/1" />
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.scene.control.Button?>
<?import javafx.scene.layout.HBox?>
<HBox maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" minHeight="0.0" minWidth="0.0" xmlns="http://javafx.com/javafx/17" xmlns:fx="http://javafx.com/fxml/1">
<children>
<Button maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" minHeight="0.0" minWidth="0.0" mnemonicParsing="false" text="Change Availability" HBox.hgrow="ALWAYS" />
<Button maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" minHeight="0.0" minWidth="0.0" mnemonicParsing="false" text="Request Time Off" HBox.hgrow="ALWAYS" />
</children>
</HBox>
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.scene.control.Button?>
<?import javafx.scene.layout.HBox?>
<?import javafx.scene.layout.VBox?>
<VBox xmlns="http://javafx.com/javafx/17" xmlns:fx="http://javafx.com/fxml/1">
<children>
<HBox alignment="CENTER_RIGHT" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" minHeight="0.0" minWidth="0.0">
<children>
<Button mnemonicParsing="false" text="Logout" />
</children>
</HBox>
<HBox fillHeight="false" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" minHeight="0.0" minWidth="0.0">
<children>
<Button maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" minHeight="0.0" minWidth="0.0" mnemonicParsing="false" onMouseClicked="#employeeScheduleClicked" text="Schedule" HBox.hgrow="ALWAYS" />
<Button maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" minHeight="0.0" minWidth="0.0" mnemonicParsing="false" onMouseClicked="#employeeAvailabilityClicked" text="Availability" HBox.hgrow="ALWAYS" />
<Button maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" minHeight="0.0" minWidth="0.0" mnemonicParsing="false" onMouseClicked="#employeePaystubClicked" text="Paystub" HBox.hgrow="ALWAYS" />
</children>
</HBox>
</children>
</VBox>
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.scene.control.Label?>
<Label text="Paystub test" xmlns="http://javafx.com/javafx/17" xmlns:fx="http://javafx.com/fxml/1" />
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.scene.control.Label?>
<Label text="pickup test" xmlns="http://javafx.com/javafx/17" xmlns:fx="http://javafx.com/fxml/1" />
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.scene.control.Button?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.layout.HBox?>
<HBox prefHeight="25.0" prefWidth="800.0" xmlns="http://javafx.com/javafx/17" xmlns:fx="http://javafx.com/fxml/1">
<children>
<Button mnemonicParsing="false" onMouseClicked="#prevButtonClicked" prefHeight="25.0" prefWidth="200.0" text="Previous" />
<Label fx:id="currentDateText" prefHeight="25.0" prefWidth="200.0" text="Current: " />
<Button mnemonicParsing="false" onMouseClicked="#jumpButtonClicked" prefHeight="25.0" prefWidth="200.0" text="Jump" />
<Button mnemonicParsing="false" onMouseClicked="#nextButtonClicked" prefHeight="25.0" prefWidth="200.0" text="Next" />
</children>
</HBox>
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.scene.control.Button?>
<?import javafx.scene.layout.VBox?>
<VBox maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" minHeight="0.0" minWidth="0.0" xmlns="http://javafx.com/javafx/17" xmlns:fx="http://javafx.com/fxml/1">
<children>
<Button maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" minHeight="0.0" minWidth="0.0" mnemonicParsing="false" onMouseClicked="#employeeDailyClicked" text="Daily" VBox.vgrow="ALWAYS" />
<Button maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" minHeight="0.0" minWidth="0.0" mnemonicParsing="false" onMouseClicked="#employeeWeeklyClicked" text="Weekly" VBox.vgrow="ALWAYS" />
<Button maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" minHeight="0.0" minWidth="0.0" mnemonicParsing="false" onMouseClicked="#employeePickupClicked" text="Pickup" VBox.vgrow="ALWAYS" />
</children>
</VBox>
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.scene.control.Label?>
<Label text="timeoff test" xmlns="http://javafx.com/javafx/17" xmlns:fx="http://javafx.com/fxml/1" />
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment