-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMainGUI.java
More file actions
402 lines (377 loc) · 22.2 KB
/
MainGUI.java
File metadata and controls
402 lines (377 loc) · 22.2 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
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
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
/*
* 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.
*/
package PAT;
/*
Class MainGUI
Allows an interface for the user to access all the screens that they are allowed to use
*/
public class MainGUI extends javax.swing.JFrame {
String userType = ""; //The type of the current user
String userWelcome = ""; //The welcome message displaye on the top of the screen
private boolean helpEnabled = false; //The state of the help boxes
/*
Constructor Method
Used to create an instance of the MainGUI class
@parameters: String user type, String user welcome message
@return: none
*/
public MainGUI(String _userType, String _userWelcome) {
userType = _userType;
userWelcome = _userWelcome;
initComponents();
setRestrictions(userType); //enable only the buttons the user is allowed to use
setHelp(false); //turn help boxes off
//display welcome message
lblWelcomeMsg.setText("Welcome " + _userWelcome);
}
/**
* 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() {
jPanel1 = new javax.swing.JPanel();
lblMenu = new javax.swing.JLabel();
lblWelcomeMsg = new javax.swing.JLabel();
btnMainHelp = new javax.swing.JButton();
btnLogOut = new javax.swing.JButton();
btnAthleteGUI = new javax.swing.JButton();
btnStockGUI = new javax.swing.JButton();
btnMealGUI = new javax.swing.JButton();
btnAdminGUI = new javax.swing.JButton();
jScrollPane1 = new javax.swing.JScrollPane();
txtAreaAdminHelp = new javax.swing.JTextArea();
jScrollPane2 = new javax.swing.JScrollPane();
txtAreaAthHelp = new javax.swing.JTextArea();
jScrollPane3 = new javax.swing.JScrollPane();
txtAreaStockHelp = new javax.swing.JTextArea();
jScrollPane4 = new javax.swing.JScrollPane();
txtAreaMealHelp = new javax.swing.JTextArea();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
lblMenu.setBackground(new java.awt.Color(255, 255, 255));
lblMenu.setFont(new java.awt.Font("Tahoma", 1, 24)); // NOI18N
lblMenu.setText(" MENU");
lblMenu.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0), 3));
lblWelcomeMsg.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N
lblWelcomeMsg.setText("Welcome");
btnMainHelp.setFont(new java.awt.Font("Tahoma", 1, 16)); // NOI18N
btnMainHelp.setText("HELP");
btnMainHelp.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0), 2));
btnMainHelp.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnMainHelpActionPerformed(evt);
}
});
btnLogOut.setFont(new java.awt.Font("Tahoma", 1, 16)); // NOI18N
btnLogOut.setText("LOGOUT");
btnLogOut.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0), 2));
btnLogOut.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnLogOutActionPerformed(evt);
}
});
btnAthleteGUI.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N
btnAthleteGUI.setText("Athletes");
btnAthleteGUI.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(102, 102, 102), 1, true));
btnAthleteGUI.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnAthleteGUIActionPerformed(evt);
}
});
btnStockGUI.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N
btnStockGUI.setText("Stock");
btnStockGUI.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(102, 102, 102), 1, true));
btnStockGUI.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnStockGUIActionPerformed(evt);
}
});
btnMealGUI.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N
btnMealGUI.setText("Meal");
btnMealGUI.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(102, 102, 102), 1, true));
btnMealGUI.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnMealGUIActionPerformed(evt);
}
});
btnAdminGUI.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N
btnAdminGUI.setText("Admin");
btnAdminGUI.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(102, 102, 102), 1, true));
btnAdminGUI.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnAdminGUIActionPerformed(evt);
}
});
jScrollPane1.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
jScrollPane1.setVerticalScrollBarPolicy(javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER);
txtAreaAdminHelp.setEditable(false);
txtAreaAdminHelp.setColumns(20);
txtAreaAdminHelp.setRows(5);
txtAreaAdminHelp.setText("Admin screen is used\nto access info on\nusers and edit users\nand their info.");
txtAreaAdminHelp.setAutoscrolls(false);
txtAreaAdminHelp.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 1));
jScrollPane1.setViewportView(txtAreaAdminHelp);
jScrollPane2.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
jScrollPane2.setVerticalScrollBarPolicy(javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER);
txtAreaAthHelp.setEditable(false);
txtAreaAthHelp.setColumns(20);
txtAreaAthHelp.setRows(5);
txtAreaAthHelp.setText("Athlete screen is\nused to access info\non players and edit\nathletes and their\ninfo.");
txtAreaAthHelp.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 1));
jScrollPane2.setViewportView(txtAreaAthHelp);
txtAreaAthHelp.getAccessibleContext().setAccessibleName("");
txtAreaAthHelp.getAccessibleContext().setAccessibleDescription("");
jScrollPane3.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
jScrollPane3.setVerticalScrollBarPolicy(javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER);
txtAreaStockHelp.setEditable(false);
txtAreaStockHelp.setColumns(20);
txtAreaStockHelp.setRows(5);
txtAreaStockHelp.setText("Stock screen is used\nto manage stock \nlevels and also \nplace and receive\norders.");
txtAreaStockHelp.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 1));
jScrollPane3.setViewportView(txtAreaStockHelp);
jScrollPane4.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
jScrollPane4.setVerticalScrollBarPolicy(javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER);
txtAreaMealHelp.setEditable(false);
txtAreaMealHelp.setColumns(20);
txtAreaMealHelp.setRows(5);
txtAreaMealHelp.setText("Meal screen is used\nwhen preparing a \nmeal to record stock\ndrop and the amount\nneeded for hostel");
txtAreaMealHelp.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 1));
jScrollPane4.setViewportView(txtAreaMealHelp);
javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
jPanel1.setLayout(jPanel1Layout);
jPanel1Layout.setHorizontalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
.addComponent(btnLogOut, javax.swing.GroupLayout.PREFERRED_SIZE, 86, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addComponent(lblMenu, javax.swing.GroupLayout.PREFERRED_SIZE, 400, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(btnMainHelp, javax.swing.GroupLayout.PREFERRED_SIZE, 83, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(0, 0, Short.MAX_VALUE)
.addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
.addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jScrollPane4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addContainerGap())
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
.addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(btnAthleteGUI, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(btnStockGUI, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(btnMealGUI, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(btnAdminGUI, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(255, 255, 255))))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(lblWelcomeMsg, javax.swing.GroupLayout.PREFERRED_SIZE, 203, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(173, 173, 173))
);
jPanel1Layout.setVerticalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(24, 24, 24)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(btnLogOut, javax.swing.GroupLayout.PREFERRED_SIZE, 44, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(btnMainHelp, javax.swing.GroupLayout.PREFERRED_SIZE, 44, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addGroup(jPanel1Layout.createSequentialGroup()
.addContainerGap()
.addComponent(lblMenu, javax.swing.GroupLayout.PREFERRED_SIZE, 71, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(lblWelcomeMsg, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
.addGap(44, 44, 44)
.addComponent(btnAthleteGUI, javax.swing.GroupLayout.PREFERRED_SIZE, 45, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(25, 25, 25)))
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(86, 86, 86)
.addComponent(jScrollPane4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(38, 38, 38)
.addComponent(btnStockGUI, javax.swing.GroupLayout.PREFERRED_SIZE, 45, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(btnMealGUI, javax.swing.GroupLayout.PREFERRED_SIZE, 45, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(btnAdminGUI, javax.swing.GroupLayout.PREFERRED_SIZE, 45, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(jPanel1Layout.createSequentialGroup()
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(81, 81, 81)
.addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 85, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addGap(40, 40, 40))
);
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addContainerGap())
);
pack();
}// </editor-fold>//GEN-END:initComponents
/*
Method Athlete button
Opens the Athlete GUI
*/
private void btnAthleteGUIActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnAthleteGUIActionPerformed
dispose();
AthleteGUI ath = new AthleteGUI(userType, userWelcome);
ath.setVisible(true);
}//GEN-LAST:event_btnAthleteGUIActionPerformed
/*
Method of the Stock Button
Opens the Stock GUI
*/
private void btnStockGUIActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnStockGUIActionPerformed
dispose();
StockGUI sto = new StockGUI(userType, userWelcome);
sto.setVisible(true);
}//GEN-LAST:event_btnStockGUIActionPerformed
/*
Method of the Meal button
Opens the Meal GUI
*/
private void btnMealGUIActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnMealGUIActionPerformed
dispose();
MealGUI mel = new MealGUI(userType, userWelcome);
mel.setVisible(true);
}//GEN-LAST:event_btnMealGUIActionPerformed
/*
Method of the admin button
Opens the Admin GUI
*/
private void btnAdminGUIActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnAdminGUIActionPerformed
dispose();
AdminGUI adm = new AdminGUI(userType, userWelcome);
adm.setVisible(true);
}//GEN-LAST:event_btnAdminGUIActionPerformed
/*
Method of the Logout button
Returns to the login screen
*/
private void btnLogOutActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnLogOutActionPerformed
dispose();
LoginGUI log = new LoginGUI();
log.setVisible(true);
}//GEN-LAST:event_btnLogOutActionPerformed
/*
Method of the help button
Enables or disables the help boxes
*/
private void btnMainHelpActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnMainHelpActionPerformed
if(helpEnabled == false){
setHelp(true);
helpEnabled = true;
}else{
setHelp(false);
helpEnabled = false;
}
}//GEN-LAST:event_btnMainHelpActionPerformed
/**
* @param args the command line arguments
*/
public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
* For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
*/
try {
for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
}
}
} catch (ClassNotFoundException ex) {
java.util.logging.Logger.getLogger(MainGUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(MainGUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(MainGUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(MainGUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
}
//</editor-fold>
/* Create and display the form */
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new MainGUI("", "").setVisible(true);
}
});
}
/*
Method setHelp
Sets the visibillity of the help boxes
@parameters: Boolean the state of the help boxes
@return: none
*/
private void setHelp(boolean enabled){
txtAreaAthHelp.setVisible(enabled);
txtAreaMealHelp.setVisible(enabled);
txtAreaStockHelp.setVisible(enabled);
txtAreaAdminHelp.setVisible(enabled);
}
/*
Method setRestrictions
Determines what GUIs the user can acces based on their user type
@parameters: string user type
@return: none
*/
private void setRestrictions(String type){
//If user is apart of the kitchen staff
if(type.equals("Kitchen")){
btnAthleteGUI.setEnabled(false);
btnAdminGUI.setEnabled(false);
//if the user is apart of the coaching staff
}else if (type.equals("Coaching")){
btnStockGUI.setEnabled(false);
btnMealGUI.setEnabled(false);
btnAdminGUI.setEnabled(false);
}
}
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton btnAdminGUI;
private javax.swing.JButton btnAthleteGUI;
private javax.swing.JButton btnLogOut;
private javax.swing.JButton btnMainHelp;
private javax.swing.JButton btnMealGUI;
private javax.swing.JButton btnStockGUI;
private javax.swing.JPanel jPanel1;
private javax.swing.JScrollPane jScrollPane1;
private javax.swing.JScrollPane jScrollPane2;
private javax.swing.JScrollPane jScrollPane3;
private javax.swing.JScrollPane jScrollPane4;
private javax.swing.JLabel lblMenu;
private javax.swing.JLabel lblWelcomeMsg;
private javax.swing.JTextArea txtAreaAdminHelp;
private javax.swing.JTextArea txtAreaAthHelp;
private javax.swing.JTextArea txtAreaMealHelp;
private javax.swing.JTextArea txtAreaStockHelp;
// End of variables declaration//GEN-END:variables
}