-
Notifications
You must be signed in to change notification settings - Fork 0
/
gui.java
152 lines (134 loc) · 6.62 KB
/
gui.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
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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
/**
*
* @author zenbhang
*/
public class gui extends javax.swing.JFrame {
public MmrSim m;
public Settings s;
/**
* Creates new form gui
*/
public gui() {
m=new MmrSim();
s=new Settings(m);
//start of the save workaround
s.setVisible(false);
s.dispose();
//end of save workaround
initComponents();
}
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
jScrollPane2 = new javax.swing.JScrollPane();
txtOutput = new javax.swing.JTextPane();
btnStart = new javax.swing.JButton();
btn_Settings = new javax.swing.JButton();
btn_ViewPlayers = new javax.swing.JButton();
lblMMRSim = new javax.swing.JLabel();
jLabel1 = new javax.swing.JLabel();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
txtOutput.setEditable(false);
jScrollPane2.setViewportView(txtOutput);
btnStart.setFont(new java.awt.Font("Arial", 0, 36)); // NOI18N
btnStart.setText("Start");
btnStart.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnStartActionPerformed(evt);
}
});
btn_Settings.setText("Settings");
btn_Settings.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btn_SettingsActionPerformed(evt);
}
});
btn_ViewPlayers.setText("View Players");
btn_ViewPlayers.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btn_ViewPlayersActionPerformed(evt);
}
});
lblMMRSim.setFont(new java.awt.Font("Arial", 1, 48)); // NOI18N
lblMMRSim.setText("MMRSIM");
jLabel1.setText("Made by Benjamin Zhang (Zenbhang)");
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(64, 64, 64)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(jLabel1)
.addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 712, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addGroup(layout.createSequentialGroup()
.addGap(310, 310, 310)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(btnStart, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(layout.createSequentialGroup()
.addComponent(btn_Settings, javax.swing.GroupLayout.PREFERRED_SIZE, 94, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(btn_ViewPlayers)))))
.addContainerGap(61, Short.MAX_VALUE))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
.addGap(0, 0, Short.MAX_VALUE)
.addComponent(lblMMRSim)
.addGap(311, 311, 311))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(38, 38, 38)
.addComponent(lblMMRSim)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jLabel1)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 311, Short.MAX_VALUE)
.addGap(26, 26, 26)
.addComponent(btnStart, javax.swing.GroupLayout.PREFERRED_SIZE, 47, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(btn_ViewPlayers)
.addComponent(btn_Settings))
.addGap(34, 34, 34))
);
pack();
}// </editor-fold>//GEN-END:initComponents
private void btnStartActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnStartActionPerformed
//Start button, starts the Simulator
}//GEN-LAST:event_btnStartActionPerformed
private void btn_SettingsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btn_SettingsActionPerformed
//Settings button, opens the settings dialog
s=new Settings(m);
s.setVisible(true);
}//GEN-LAST:event_btn_SettingsActionPerformed
private void btn_ViewPlayersActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btn_ViewPlayersActionPerformed
//View Players button, opens the player viewer.
ViewPlayers v = new ViewPlayers();
v.setVisible(true);
}//GEN-LAST:event_btn_ViewPlayersActionPerformed
/**
* @param args the command line arguments
*/
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton btnStart;
private javax.swing.JButton btn_Settings;
private javax.swing.JButton btn_ViewPlayers;
private javax.swing.JLabel jLabel1;
private javax.swing.JScrollPane jScrollPane2;
private javax.swing.JLabel lblMMRSim;
private javax.swing.JTextPane txtOutput;
// End of variables declaration//GEN-END:variables
}