-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBujoView.java
More file actions
39 lines (34 loc) · 893 Bytes
/
BujoView.java
File metadata and controls
39 lines (34 loc) · 893 Bytes
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
package cs3500.pa05.view;
import cs3500.pa05.controller.ControllerInterface;
import java.io.IOException;
import javafx.fxml.FXMLLoader;
import javafx.scene.Scene;
/**
* Represents a view in the .bujo program.
*/
public class BujoView {
private FXMLLoader loader;
/**
* Loads new event scene
*
* @param evc event controller
* @param fxml the scene to load
*/
public BujoView(ControllerInterface evc, String fxml) {
this.loader = new FXMLLoader();
this.loader.setLocation(getClass().getClassLoader().getResource(fxml));
this.loader.setController(evc);
}
/**
* Loads a scene from a new event GUI layout
*
* @return the layout
*/
public Scene load() {
try {
return this.loader.load();
} catch (IOException e) {
throw new IllegalStateException("can't load the scene");
}
}
}