|
12 | 12 | import javafx.scene.control.ScrollPane;
|
13 | 13 | import javafx.scene.layout.GridPane;
|
14 | 14 | import javafx.scene.paint.Color;
|
| 15 | +import javafx.scene.text.Font; |
| 16 | +import javafx.scene.text.FontPosture; |
| 17 | +import javafx.scene.text.FontWeight; |
| 18 | +import javafx.scene.text.Text; |
| 19 | +import javafx.scene.text.TextFlow; |
15 | 20 |
|
16 | 21 | public class ScheduleStage extends KarenStage {
|
17 | 22 |
|
@@ -81,18 +86,21 @@ public GridPane writeSchedule(Schedule schedule) {
|
81 | 86 | for (int i = 0; i < max; i++) {
|
82 | 87 | for (int day = 0; day < 7; day++) {
|
83 | 88 | if (i < shifts.get(day).get(hour).size()) {
|
84 |
| - Label scheduledEmployee = new Label(shifts.get(day).get(hour).get(i).toString()); |
| 89 | + Text scheduledEmployee = new Text(shifts.get(day).get(hour).get(i).toString()); |
| 90 | + scheduledEmployee.setFont(Font.font("SansSerif", FontWeight.NORMAL, 12)); |
| 91 | + |
85 | 92 | //bold shift lead
|
86 | 93 | if (_ui.getCurrentEmployee() != null && schedule.getWeek().getShift(day, hour).getLead() != null && shifts.get(day).get(hour).get(i).equals(schedule.getWeek().getShift(day, hour).getLead())) {
|
87 |
| - scheduledEmployee.setStyle("-fx-font-weight: bold"); |
| 94 | + scheduledEmployee.setFont(Font.font("SansSerif", FontWeight.BOLD, 12)); |
| 95 | + //scheduledEmployee.setFont(Font.getDefault()); |
88 | 96 | }
|
89 | 97 | // highlight your name on the schedule
|
90 | 98 | if ((_ui.getCurrentEmployee() != null)
|
91 | 99 | && (shifts.get(day).get(hour).get(i).toString().equals(_ui.getCurrentEmployee().getName()))) {
|
92 |
| - scheduledEmployee.setTextFill(Color.RED); |
| 100 | + scheduledEmployee.setFill(Color.RED); |
93 | 101 | }
|
94 | 102 | // +1 to account for day row
|
95 |
| - schedulePane.add(scheduledEmployee, day + 1, hourRow + i + 1); |
| 103 | + schedulePane.add(new TextFlow(scheduledEmployee), day + 1, hourRow + i + 1); |
96 | 104 | }
|
97 | 105 | }
|
98 | 106 | }
|
|
0 commit comments