-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFilterScreen.java
More file actions
222 lines (202 loc) · 9.09 KB
/
Copy pathFilterScreen.java
File metadata and controls
222 lines (202 loc) · 9.09 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
/*
* 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 phoenix;
import javax.swing.GroupLayout.Alignment;
import javax.swing.GroupLayout;
import javax.swing.LayoutStyle.ComponentPlacement;
import java.awt.Color;
import javax.swing.JButton;
import java.awt.Font;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import java.awt.SystemColor;
import javax.swing.DefaultComboBoxModel;
/**
*
* @author DELL
*/
public class FilterScreen extends javax.swing.JFrame {
/**
* Creates new form Screen2
*/
DisplayManager dm;
public FilterScreen() {
setResizable(false);
setTitle("AUTOMATIC TIME TABLING SYSTEM");
initComponents();
}
public FilterScreen(DisplayManager d)
{
initComponents();
dm=d;
}
/**
* 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();
jLabel2 = new javax.swing.JLabel();
jComboBox1 = new javax.swing.JComboBox<>();
submit = new javax.swing.JButton();
cancel = new javax.swing.JButton();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
jPanel1.setBackground(new Color(47, 79, 79));
jPanel1.setForeground(new Color(0, 204, 255));
jLabel2.setFont(new java.awt.Font("Times New Roman", 1, 18)); // NOI18N
jLabel2.setForeground(new Color(0, 204, 255));
jLabel2.setText("SELECT FILTER");
jComboBox1.setBackground(SystemColor.inactiveCaptionBorder);
jComboBox1.setFont(new java.awt.Font("Times New Roman", 1, 18)); // NOI18N
jComboBox1.setForeground(new Color(0, 204, 255));
jComboBox1.setModel(new DefaultComboBoxModel(new String[] {"Instructors", "Rooms", "Lab/LabSection"}));
submit.setBackground(SystemColor.inactiveCaptionBorder);
submit.setFont(new java.awt.Font("Times New Roman", 1, 18)); // NOI18N
submit.setForeground(new Color(0, 204, 255));
submit.setText("SUBMIT");
submit.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
submitActionPerformed(evt);
}
});
cancel.setBackground(SystemColor.inactiveCaptionBorder);
cancel.setFont(new java.awt.Font("Times New Roman", 1, 18)); // NOI18N
cancel.setForeground(new Color(0, 204, 255));
cancel.setText("CANCEL");
cancel.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
cancelActionPerformed(evt);
}
});
home = new JButton("HOME");
home.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
homeActionPerformed(e);
}
});
home.setFont(new Font("Times New Roman", Font.BOLD, 18));
home.setForeground(new Color(0, 204, 255));
javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
jPanel1Layout.setHorizontalGroup(
jPanel1Layout.createParallelGroup(Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(16)
.addGroup(jPanel1Layout.createParallelGroup(Alignment.LEADING)
.addComponent(home)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGroup(jPanel1Layout.createParallelGroup(Alignment.LEADING)
.addComponent(jLabel2, GroupLayout.PREFERRED_SIZE, 147, GroupLayout.PREFERRED_SIZE)
.addComponent(submit))
.addGap(18)
.addGroup(jPanel1Layout.createParallelGroup(Alignment.LEADING)
.addComponent(cancel)
.addComponent(jComboBox1, GroupLayout.PREFERRED_SIZE, 146, GroupLayout.PREFERRED_SIZE))))
.addContainerGap(420, Short.MAX_VALUE))
);
jPanel1Layout.setVerticalGroup(
jPanel1Layout.createParallelGroup(Alignment.TRAILING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(7)
.addComponent(home)
.addGap(18)
.addGroup(jPanel1Layout.createParallelGroup(Alignment.BASELINE)
.addComponent(jLabel2, GroupLayout.PREFERRED_SIZE, 33, GroupLayout.PREFERRED_SIZE)
.addComponent(jComboBox1, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
.addPreferredGap(ComponentPlacement.RELATED, 70, Short.MAX_VALUE)
.addGroup(jPanel1Layout.createParallelGroup(Alignment.BASELINE)
.addComponent(submit, GroupLayout.PREFERRED_SIZE, 32, GroupLayout.PREFERRED_SIZE)
.addComponent(cancel, GroupLayout.PREFERRED_SIZE, 32, GroupLayout.PREFERRED_SIZE))
.addGap(85))
);
jPanel1.setLayout(jPanel1Layout);
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
layout.setHorizontalGroup(
layout.createParallelGroup(Alignment.TRAILING)
.addGroup(layout.createSequentialGroup()
.addComponent(jPanel1, GroupLayout.DEFAULT_SIZE, 382, Short.MAX_VALUE)
.addGap(375))
);
layout.setVerticalGroup(
layout.createParallelGroup(Alignment.LEADING)
.addComponent(jPanel1, Alignment.TRAILING, GroupLayout.DEFAULT_SIZE, 287, Short.MAX_VALUE)
);
getContentPane().setLayout(layout);
pack();
setLocationRelativeTo(null);
}// </editor-fold>//GEN-END:initComponents
private void submitActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_submitActionPerformed
// TODO add your handling code here:
if(evt.getSource()==submit && jComboBox1.getSelectedItem()=="Lab/LabSection")
{
dm.setLabfilter(dm);
this.setVisible(false);
}
if(evt.getSource()==submit && jComboBox1.getSelectedItem()=="Instructors")
{
dm.setInstructorfilter(dm);;
this.setVisible(false);
}
if(evt.getSource()==submit && jComboBox1.getSelectedItem()=="Rooms")
{
dm.setRoomfilter(dm);
this.setVisible(false);
}
}//GEN-LAST:event_submitActionPerformed
private void cancelActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cancelActionPerformed
// TODO add your handling code here:
dm.setTimeTable(dm);
this.setVisible(false);
}//GEN-LAST:event_cancelActionPerformed
private void homeActionPerformed(ActionEvent e) {
dm.load(dm);
this.setVisible(false);
}
/**
* @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(FilterScreen.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(FilterScreen.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(FilterScreen.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(FilterScreen.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
}
//</editor-fold>
//</editor-fold>
/* Create and display the form */
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new FilterScreen().setVisible(true);
}
});
}
// Variables declaration - do not modify//GEN-BEGIN:variables
public javax.swing.JButton cancel;
private javax.swing.JComboBox<String> jComboBox1;
private javax.swing.JLabel jLabel2;
private javax.swing.JPanel jPanel1;
public javax.swing.JButton submit;
private JButton home;
// End of variables declaration//GEN-END:variables
}