forked from nus-cs2103-AY1920S1/addressbook-level3
/
ListPanel.java
54 lines (41 loc) · 1.43 KB
/
ListPanel.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
package seedu.address.ui.panel.list;
import java.util.HashMap;
import java.util.List;
import javafx.fxml.FXML;
import javafx.scene.layout.GridPane;
import javafx.scene.layout.Region;
import javafx.scene.layout.StackPane;
import seedu.address.model.events.EventSource;
import seedu.address.model.tasks.TaskSource;
import seedu.address.ui.UiPart;
//@@author Kyzure
/**
* An Ui that stores the logged feedback from the program to the user.
*/
public class ListPanel extends UiPart<Region> {
private static final String FXML = "ListPanel.fxml";
private EventListPanel eventListPanel;
private TaskListPanel taskListPanel;
@FXML
private GridPane listPanelGrid;
@FXML
private StackPane eventListPlaceholder;
@FXML
private StackPane taskListPlaceholder;
/**
* Constructor for ListPanel
*/
public ListPanel() {
super(FXML);
eventListPanel = new EventListPanel();
taskListPanel = new TaskListPanel();
eventListPlaceholder.getChildren().add(eventListPanel.getRoot());
taskListPlaceholder.getChildren().add(taskListPanel.getRoot());
}
public void onEventListChange(List<EventSource> events, HashMap<EventSource, Integer> eventHash) {
eventListPanel.onEventListChange(events, eventHash);
}
public void onTaskListChange(List<TaskSource> tasks, HashMap<TaskSource, Integer> taskHash) {
taskListPanel.onTaskListChange(tasks, taskHash);
}
}