Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
package com.example.schedulerapp;
import javafx.geometry.Insets;
import javafx.scene.Node;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.layout.HBox;
import javafx.scene.layout.VBox;
import javafx.stage.Popup;
public class EmployeeDetailsPopUp extends Popup {
public EmployeeDetailsPopUp(Employee e){
this.setHeight(300);
this.setWidth(300);
VBox details = new VBox();
details.setStyle("-fx-background-color: papayawhip; -fx-border-color: black");
details.setPadding(new Insets(20));
details.setSpacing(20);
Label name = new Label(e.getFullName());
Label id = new Label("ID: " + e.getEmployeeID());
String positions = "";
if (e.isManager()) positions += "Manager, ";
for (String s : e.getPositions()){
positions += s + ", ";
}
if (positions.length() == 0) {
positions = "none";
}
else{
positions = positions.substring(0, positions.length()-2);
}
Label position = new Label(positions);
Label wage = new Label("Wage: " + e.getWage());
Label contact = new Label(e.getPhoneNumber() + "\t" + e.getEmail());
HBox buttons = new HBox();
Button schedule = new Button("Schedule");
//schedule.setOnAction();
Button availability = new Button("Availability");
//availability.setOnAction();
Button edit = new Button("Edit Details");
//edit.setOnAction();
buttons.getChildren().addAll(schedule, availability, edit);
buttons.setSpacing(20);
for (Node button : buttons.getChildren()){
((Button) button).setMaxWidth(200);
}
details.getChildren().addAll(name, id, position, wage, contact, buttons);
this.getContent().add(details);
this.setAutoHide(true);
}
}