-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathViewEditDragAndDropQuestionTab.java
64 lines (52 loc) · 1.8 KB
/
ViewEditDragAndDropQuestionTab.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
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.util.ArrayList;
import javax.swing.BoxLayout;
import javax.swing.JButton;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
public class ViewEditDragAndDropQuestionTab extends JPanel {
private ViewEditDragDropSperateQuestionPanel dragDropSeperatePanel;
private Controller controller;
private ArrayList<DragDropMemory> allDragDropQuestion;
private JPanel p;
private JScrollPane scroolPane;
public ViewEditDragAndDropQuestionTab(Controller controller) {
this.controller = controller;
p = new JPanel();
BoxLayout layout = new BoxLayout(p, BoxLayout.Y_AXIS);
p.setLayout(layout);
scroolPane = new JScrollPane(p);
scroolPane
.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
scroolPane.setVisible(true);
scroolPane.setPreferredSize(new Dimension(770, 500));
JPanel bottom = new JPanel();
bottom.setLayout(new BorderLayout());
JButton button = new JButton("Back");
button.setActionCommand("BackToAddEditPanel");
button.addActionListener(controller);
bottom.add(button, BorderLayout.WEST);
add(scroolPane);
add(bottom);
}
public int getNumberOfDeletedQuestion() {
return dragDropSeperatePanel.getNumberOfDeletedQuestion();
}
public ArrayList<DragDropMemory> getAllFillBlankQuestion() {
return allDragDropQuestion;
}
public void setAllDragDropQuestion(
ArrayList<DragDropMemory> allFillBlankQuestion) {
p.removeAll();
this.allDragDropQuestion = allFillBlankQuestion;
for (int i = 0; i < allFillBlankQuestion.size(); i++) {
DragDropMemory b = (DragDropMemory) allFillBlankQuestion
.get(i);
System.out.println(b.getTitle());
dragDropSeperatePanel = new ViewEditDragDropSperateQuestionPanel(controller,
b.getTitle(), i);
p.add(dragDropSeperatePanel);
}
}
}