package com.example.schedulerapp; import javafx.geometry.HPos; import javafx.scene.control.Label; import javafx.scene.layout.GridPane; import java.util.ArrayList; public class DailyView extends ScheduleView{ public DailyView() { System.out.println("new daily view"); } public void draw(){ //clear contents.getChildren().clear(); //add to gridpane - time axis never changes int i = 1; for (Label time : times){ contents.add(time, 0, i); i++; } int col = 1; //start on the second column // update employee axis and schedule display ArrayList<Shift> schedule = model.getDailySchedule(); for (Shift shift : schedule){ String emp = model.getEmployeeByID(shift.getEmployeeID()); if (emp.length() > 9){ emp = emp.substring(0,9).concat("."); } emp = String.format("| %-9s |", emp); Label name = new Label(emp); GridPane.setHalignment(name, HPos.CENTER); contents.add(name, col, 0); contents.add(this.formatShiftButton(shift), col, this.shiftGetRow(shift), 1, this.shiftGetLength(shift)); col++; } } }