Newer
Older
package com.example.schedulerapp;
import javafx.geometry.HPos;
import javafx.scene.control.Label;
import javafx.scene.layout.GridPane;
import java.util.ArrayList;
public DailyView() {
System.out.println("new daily view");
}
ArktikHunter
committed
contents.getChildren().clear();
//add to gridpane - time axis never changes
int i = 1;
for (Label time : times){
ArktikHunter
committed
contents.add(time, 0, i);
i++;
}
int col = 1; //start on the second column
ArktikHunter
committed
ArrayList<Shift> schedule = model.getDailySchedule();
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);
contents.add(name, col, 0);
ArktikHunter
committed
contents.add(this.formatShiftButton(shift), col, this.shiftGetRow(shift), 1, this.shiftGetLength(shift));
ArktikHunter
committed
}