-
Notifications
You must be signed in to change notification settings - Fork 0
/
EditSceneController.java
89 lines (73 loc) · 2.35 KB
/
EditSceneController.java
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package finalproject;
import java.io.IOException;
import java.net.URL;
import java.util.ResourceBundle;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.fxml.FXMLLoader;
import javafx.fxml.Initializable;
import javafx.scene.Node;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.stage.Stage;
/**
* FXML Controller class
*
* @author Kevin
*/
public class EditSceneController implements Initializable {
//Variables
private Team selectedTeam;
@FXML
private Label teamNametxt;
@FXML
private Label coachtxt;
@FXML
private Label citytxt;
@FXML
private Label playerstxt;
@FXML
private Label agetxt;
@FXML
private Label winstxt;
@FXML
private Label lossestxt;
@FXML
private Button doneBttn;
/**
* Initializes the controller class.
* @param team
*/
// Passing information from the other controller to display teams' information
public void initData(Team team) {
selectedTeam = team;
teamNametxt.setText(selectedTeam.getTeamName());
coachtxt.setText(selectedTeam.getCoach());
citytxt.setText(selectedTeam.getCity());
playerstxt.setText(selectedTeam.getPlayers());
agetxt.setText(selectedTeam.getAge());
winstxt.setText(selectedTeam.getWins());
lossestxt.setText(selectedTeam.getLosses());
}
@Override
public void initialize(URL url, ResourceBundle rb) {
// TODO
}
// Brings users back to main window
@FXML
private void doneBttnHandle(ActionEvent event) throws IOException {
FXMLLoader loader = new FXMLLoader();
loader.setLocation(getClass().getResource("FXMLDocument.fxml"));
Parent fullInfoParent = loader.load();
Scene fullInfoScene = new Scene(fullInfoParent);
Stage window = (Stage)((Node)event.getSource()).getScene().getWindow();
window.setScene(fullInfoScene);
}
}