Skip to content
Snippets Groups Projects
Commit 7105076a authored by ArktikHunter's avatar ArktikHunter
Browse files

scheduleApp now shuts down when window is closed

parent c5512956
No related branches found
No related tags found
No related merge requests found
...@@ -34,7 +34,7 @@ public class DailyView extends ScheduleView{ ...@@ -34,7 +34,7 @@ public class DailyView extends ScheduleView{
emp = String.format("| %-9s |", emp); emp = String.format("| %-9s |", emp);
Label name = new Label(emp); Label name = new Label(emp);
GridPane.setHalignment(name, HPos.CENTER); GridPane.setHalignment(name, HPos.CENTER);
contents.add(name, col, 0); //todo: display name instead contents.add(name, col, 0);
contents.add(this.formatShiftButton(shift), col, this.shiftGetRow(shift), 1, this.shiftGetLength(shift)); contents.add(this.formatShiftButton(shift), col, this.shiftGetRow(shift), 1, this.shiftGetLength(shift));
......
...@@ -20,6 +20,8 @@ public class ScheduleApp extends Application { ...@@ -20,6 +20,8 @@ public class ScheduleApp extends Application {
stage.setScene(scene); stage.setScene(scene);
stage.show(); stage.show();
stage.setOnCloseRequest(e -> javafx.application.Platform.exit());
} }
public static void main(String[] args) { public static void main(String[] args) {
......
...@@ -80,7 +80,8 @@ public class ScheduleView extends ScrollPane implements ModelSubscriber{ ...@@ -80,7 +80,8 @@ public class ScheduleView extends ScrollPane implements ModelSubscriber{
details.setPadding(new Insets(20)); details.setPadding(new Insets(20));
details.setSpacing(20); details.setSpacing(20);
Label name = new Label("Name: " + shift.getEmployeeID()); //todo: display name instead Label name = new Label("Name: " + model.getEmployeeByID(shift.getEmployeeID()));
Label position = new Label("Position: " + shift.getPosition());
Label date = new Label("Date: " + shift.getStart().format(dateFormatView)); Label date = new Label("Date: " + shift.getStart().format(dateFormatView));
Label start = new Label("Start: " + shift.getStart().format(timeFormat)); Label start = new Label("Start: " + shift.getStart().format(timeFormat));
Label end = new Label("End: " + shift.getEnd().format(timeFormat)); Label end = new Label("End: " + shift.getEnd().format(timeFormat));
...@@ -116,7 +117,7 @@ public class ScheduleView extends ScrollPane implements ModelSubscriber{ ...@@ -116,7 +117,7 @@ public class ScheduleView extends ScrollPane implements ModelSubscriber{
((Button) button).setMaxWidth(200); ((Button) button).setMaxWidth(200);
} }
details.getChildren().addAll(name, date, start, end, buttons); details.getChildren().addAll(name, position, date, start, end, buttons);
dropShift.getContent().add(details); dropShift.getContent().add(details);
dropShift.setAutoHide(true); dropShift.setAutoHide(true);
} }
......
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