-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathIntoGameView.java~
More file actions
99 lines (81 loc) · 2.93 KB
/
IntoGameView.java~
File metadata and controls
99 lines (81 loc) · 2.93 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
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
90
91
92
93
94
95
96
97
98
99
import javax.swing.*;
import java.awt.*;
public class IntoGameView extends TeacherDashboardPanel1
{
private FrameModel frameModel;
private JFrame window;
private int requiredAccuracy;
private int requiredSpeed;
private int level;
private boolean backAllowed;
private JLabel levelText = new JLabel();
private JLabel accuracyText = new JLabel();
private JLabel wpmText = new JLabel();
private JLabel backspace = new JLabel();
private CustomButton next = new CustomButton("Next",300,80,50f);
private BoxLayout layout = new BoxLayout(this,BoxLayout.Y_AXIS);
public IntoGameView(FrameModel model, JFrame frame,int curLevel, int accuracy, int wpm, boolean backspaceAllowed)
{
this.frameModel = model;
this.window=frame;
this.requiredAccuracy=accuracy;
this.requiredSpeed=wpm;
this.backAllowed=backspaceAllowed;
this.level=curLevel;
this.layoutView();
this.registerControllers();
}
public void layoutView()
{
this.setLayout(layout);
this.levelText.setText("Level "+ this.level);
this.levelText.setFont(UIMethods.deriveFont("leaguespartan-bold.ttf",50f));
this.levelText.setBorder(BorderFactory.createEmptyBorder(10,0,0,0));
this.accuracyText.setText("Required Accuracy: " + this.requiredAccuracy);
this.accuracyText.setFont(UIMethods.deriveFont("Barlow-Light.ttf",40f));
this.wpmText.setText("Required Speed: " + this.requiredSpeed+ " WPM");
this.wpmText.setFont(UIMethods.deriveFont("Barlow-Light.ttf",40f));
this.backspace.setFont(UIMethods.deriveFont("Barlow-Light.ttf",40f));
if(backAllowed)
{
this.backspace.setText("Backspace Allowed: Yes");
}
else
{
this.backspace.setText("Backspace Allowed: No");
}
JPanel topPanel = new JPanel();
topPanel.add(levelText);
topPanel.setOpaque(false);
JPanel secondRow = new JPanel();
secondRow.add(accuracyText);
secondRow.setOpaque(false);
JPanel thirdRow = new JPanel();
thirdRow.add(wpmText);
thirdRow.setOpaque(false);
JPanel fourthRow = new JPanel();
fourthRow.add(backspace);
fourthRow.setOpaque(false);
JPanel fifthRow = new JPanel();
fifthRow.add(next);
fifthRow.setOpaque(false);
JPanel emptyPanel = new JPanel();
emptyPanel.setPreferredSize(new Dimension(1366,50));
emptyPanel.setOpaque(false);
this.add(topPanel);
this.add(secondRow);
this.add(thirdRow);
this.add(fourthRow);
this.add(fifthRow);
this.add(emptyPanel);
this.setPreferredSize(new Dimension(1366,768));
window.setTitle("Learning Mode");
window.setContentPane(this);
window.setSize(1366,768);
window.setVisible(true);
}
public void registerControllers()
{
FrameSwitchController levelController = new FrameSwitchController(next,frameModel,"level");
}
}