-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathScheduleController.java
More file actions
49 lines (39 loc) · 1.37 KB
/
Copy pathScheduleController.java
File metadata and controls
49 lines (39 loc) · 1.37 KB
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
import java.util.ArrayList;
import javafx.fxml.FXML;
import javafx.scene.layout.VBox;
import javafx.scene.control.Label;
import javafx.scene.text.Font;
public class ScheduleController {
@FXML
private Label tourneyNameLabel;
@FXML
private VBox LeaderboardVBox;
public void initialize()
{
LeaderboardVBox.setSpacing(10);
try {
ScheduleObject schedule = ChessMasterController.getDB().getSchedule();
ArrayList<TeamObject> allMatches = new ArrayList<>();
for(int i = 1; i <= schedule.getTotalWeeks(); i++)
{
allMatches = schedule.getWeek(i).getAllMatches();
Label weekLabel = new Label();
weekLabel.setText(String.format("Week %d", i));
weekLabel.setFont(new Font("Georgia", 24));
weekLabel.setUnderline(true);
LeaderboardVBox.getChildren().add(weekLabel);
for(int j = 0; j < allMatches.size() - 1; j++)
{
Label matchLabel = new Label();
matchLabel.setText(String.format("%s vs %s", allMatches.get(j).getName(), allMatches.get(j+1).getName()));
matchLabel.setFont(new Font("Georgia", 20));
LeaderboardVBox.getChildren().add(matchLabel);
j++;
}
}
}
catch(Exception e) {
e.printStackTrace();
}
}
}