-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathToolsPanel.java
executable file
·60 lines (59 loc) · 2.02 KB
/
ToolsPanel.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
/* */ import java.awt.Dimension;
/* */ import javax.swing.JLabel;
/* */ import javax.swing.JPanel;
/* */
/* */ public class ToolsPanel extends JPanel
/* */ {
/* */ JLabel infoLabel;
/* */ int scoreInfo;
/* */ int timeInfo;
/* */ String actionInfo;
/* */
/* */ public ToolsPanel()
/* */ {
/* 13 */ String str = "<html>\nTime steps: 000<br>\nScore: 000<br>\nJust did: NOOP<br>\n";
/* */
/* 17 */ this.infoLabel = new JLabel(str);
/* 18 */ add(this.infoLabel);
/* 19 */ this.scoreInfo = 0;
/* 20 */ this.timeInfo = 0;
/* 21 */ this.actionInfo = "NOOP";
/* */ }
/* */
/* */ public Dimension getMinimumSize() {
/* 25 */ return new Dimension(150, 100);
/* */ }
/* */ public Dimension getMaximumSize() {
/* 28 */ return new Dimension(150, 100);
/* */ }
/* */ public Dimension getPreferredSize() {
/* 31 */ return new Dimension(150, 100);
/* */ }
/* */
/* */ public void update() {
/* 35 */ String str = "<html>\nTime steps: " + this.timeInfo + "<br>\n" + "Score: " + this.scoreInfo + "<br>\n" + "Just did: " + this.actionInfo + "<br>\n";
/* */
/* 39 */ this.infoLabel.setText(str);
/* */ }
/* */ public void reset() {
/* 42 */ this.timeInfo = 0;
/* 43 */ this.scoreInfo = 0;
/* 44 */ this.actionInfo = "NOOP";
/* 45 */ String str = "<html>\nTime steps: " + this.timeInfo + "<br>\n" + "Score: " + this.scoreInfo + "<br>\n" + "Just did: " + this.actionInfo + "<br>\n";
/* */
/* 49 */ this.infoLabel.setText(str);
/* */ }
/* */ public void updateScore(int paramInt) {
/* 52 */ this.scoreInfo = paramInt;
/* */ }
/* */ public void updateTimeSteps(int paramInt) {
/* 55 */ this.timeInfo = paramInt;
/* */ }
/* */ public void updateAction(String paramString) {
/* 58 */ this.actionInfo = paramString;
/* */ }
/* */ }
/* Location: /Users/jesse/tmp/antsys/antsys/AntSys.jar
* Qualified Name: ToolsPanel
* JD-Core Version: 0.6.2
*/