source: tmcsimulator-scriptbuilder/branches/ScriptBuilder4/src/event/editor/ParamicsPanel.java @ 6

Revision 6, 13.9 KB checked in by jdalbey, 9 years ago (diff)

Add original prototype to branch

Line 
1package event.editor;
2
3import java.awt.event.*;
4
5/**
6 *
7 * @author nathaniellehrer
8 */
9public class ParamicsPanel extends javax.swing.JPanel implements RemoveablePanel {
10
11    private ActionListener removeListener;
12
13    /** Creates new form ParamicsPanel */
14    public ParamicsPanel() {
15        initComponents();
16    }
17
18    public void setRemoveListener(ActionListener listener)
19    {
20        removeListener = listener;
21    }
22
23    /** This method is called from within the constructor to
24     * initialize the form.
25     * WARNING: Do NOT modify this code. The content of this method is
26     * always regenerated by the Form Editor.
27     */
28    @SuppressWarnings("unchecked")
29    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
30    private void initComponents() {
31
32        removeButton = new javax.swing.JButton();
33        jLabel1 = new javax.swing.JLabel();
34        jLabel2 = new javax.swing.JLabel();
35        jComboBox1 = new javax.swing.JComboBox();
36        jComboBox2 = new javax.swing.JComboBox();
37        jLabel3 = new javax.swing.JLabel();
38        jLabel4 = new javax.swing.JLabel();
39        jCheckBox1 = new javax.swing.JCheckBox();
40        jCheckBox2 = new javax.swing.JCheckBox();
41        jCheckBox3 = new javax.swing.JCheckBox();
42        jCheckBox4 = new javax.swing.JCheckBox();
43        jCheckBox5 = new javax.swing.JCheckBox();
44        jCheckBox6 = new javax.swing.JCheckBox();
45        jCheckBox7 = new javax.swing.JCheckBox();
46        jCheckBox8 = new javax.swing.JCheckBox();
47        jCheckBox9 = new javax.swing.JCheckBox();
48        jCheckBox10 = new javax.swing.JCheckBox();
49        jComboBox3 = new javax.swing.JComboBox();
50
51        removeButton.setText("Remove");
52        removeButton.addMouseListener(new java.awt.event.MouseAdapter() {
53            public void mouseClicked(java.awt.event.MouseEvent evt) {
54                removeThisProperty(evt);
55            }
56        });
57
58        jLabel1.setText("Location");
59
60        jLabel2.setText("Status");
61
62        jComboBox1.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "New", "Changed", "Cleared" }));
63
64        jComboBox2.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Lane Breakdown", "Lane Obstruction" }));
65
66        jLabel3.setText("Incident Type");
67
68        jLabel4.setText("Lanes affected:");
69
70        jCheckBox1.setText("Lane 1");
71        jCheckBox1.addActionListener(new java.awt.event.ActionListener() {
72            public void actionPerformed(java.awt.event.ActionEvent evt) {
73                jCheckBox1ActionPerformed(evt);
74            }
75        });
76
77        jCheckBox2.setText("Lane 2");
78        jCheckBox2.addActionListener(new java.awt.event.ActionListener() {
79            public void actionPerformed(java.awt.event.ActionEvent evt) {
80                jCheckBox2ActionPerformed(evt);
81            }
82        });
83
84        jCheckBox3.setText("Lane 3");
85        jCheckBox3.addActionListener(new java.awt.event.ActionListener() {
86            public void actionPerformed(java.awt.event.ActionEvent evt) {
87                jCheckBox3ActionPerformed(evt);
88            }
89        });
90
91        jCheckBox4.setText("Lane 4");
92        jCheckBox4.addActionListener(new java.awt.event.ActionListener() {
93            public void actionPerformed(java.awt.event.ActionEvent evt) {
94                jCheckBox4ActionPerformed(evt);
95            }
96        });
97
98        jCheckBox5.setText("Lane 5");
99        jCheckBox5.addActionListener(new java.awt.event.ActionListener() {
100            public void actionPerformed(java.awt.event.ActionEvent evt) {
101                jCheckBox5ActionPerformed(evt);
102            }
103        });
104
105        jCheckBox6.setText("Lane 8");
106        jCheckBox6.addActionListener(new java.awt.event.ActionListener() {
107            public void actionPerformed(java.awt.event.ActionEvent evt) {
108                jCheckBox6ActionPerformed(evt);
109            }
110        });
111
112        jCheckBox7.setText("Lane 6");
113        jCheckBox7.addActionListener(new java.awt.event.ActionListener() {
114            public void actionPerformed(java.awt.event.ActionEvent evt) {
115                jCheckBox7ActionPerformed(evt);
116            }
117        });
118
119        jCheckBox8.setText("Lane 7");
120        jCheckBox8.addActionListener(new java.awt.event.ActionListener() {
121            public void actionPerformed(java.awt.event.ActionEvent evt) {
122                jCheckBox8ActionPerformed(evt);
123            }
124        });
125
126        jCheckBox9.setText("Lane 10");
127        jCheckBox9.addActionListener(new java.awt.event.ActionListener() {
128            public void actionPerformed(java.awt.event.ActionEvent evt) {
129                jCheckBox9ActionPerformed(evt);
130            }
131        });
132
133        jCheckBox10.setText("Lane 9");
134        jCheckBox10.addActionListener(new java.awt.event.ActionListener() {
135            public void actionPerformed(java.awt.event.ActionEvent evt) {
136                jCheckBox10ActionPerformed(evt);
137            }
138        });
139
140        jComboBox3.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "187_S_55_ML", "187_N_405_HV" }));
141
142        org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(this);
143        this.setLayout(layout);
144        layout.setHorizontalGroup(
145            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
146            .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup()
147                .addContainerGap()
148                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
149                    .add(org.jdesktop.layout.GroupLayout.LEADING, jLabel3)
150                    .add(org.jdesktop.layout.GroupLayout.LEADING, layout.createSequentialGroup()
151                        .add(jLabel4)
152                        .add(18, 18, 18)
153                        .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
154                            .add(jCheckBox2)
155                            .add(jCheckBox1))
156                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
157                        .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
158                            .add(jCheckBox3)
159                            .add(jCheckBox4))
160                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
161                        .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
162                            .add(jCheckBox7)
163                            .add(jCheckBox5))
164                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
165                        .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
166                            .add(jCheckBox8)
167                            .add(jCheckBox6))
168                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
169                        .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
170                            .add(jCheckBox10)
171                            .add(jCheckBox9)))
172                    .add(removeButton)
173                    .add(org.jdesktop.layout.GroupLayout.LEADING, layout.createSequentialGroup()
174                        .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
175                            .add(jLabel1)
176                            .add(jLabel2))
177                        .add(36, 36, 36)
178                        .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
179                            .add(org.jdesktop.layout.GroupLayout.TRAILING, jComboBox2, 0, 597, Short.MAX_VALUE)
180                            .add(jComboBox1, 0, 597, Short.MAX_VALUE)
181                            .add(jComboBox3, 0, 597, Short.MAX_VALUE))))
182                .addContainerGap())
183        );
184        layout.setVerticalGroup(
185            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
186            .add(layout.createSequentialGroup()
187                .addContainerGap()
188                .add(removeButton)
189                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
190                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
191                    .add(jLabel1)
192                    .add(jComboBox3, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
193                .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
194                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
195                    .add(jComboBox1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
196                    .add(jLabel2))
197                .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
198                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
199                    .add(jLabel3)
200                    .add(jComboBox2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
201                .add(18, 18, 18)
202                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
203                    .add(layout.createSequentialGroup()
204                        .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
205                            .add(jLabel4)
206                            .add(jCheckBox1))
207                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
208                        .add(jCheckBox2))
209                    .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
210                        .add(layout.createSequentialGroup()
211                            .add(jCheckBox5)
212                            .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
213                            .add(jCheckBox7))
214                        .add(layout.createSequentialGroup()
215                            .add(jCheckBox3)
216                            .add(2, 2, 2)
217                            .add(jCheckBox4))
218                        .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
219                            .add(layout.createSequentialGroup()
220                                .add(jCheckBox10)
221                                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
222                                .add(jCheckBox9))
223                            .add(layout.createSequentialGroup()
224                                .add(jCheckBox8)
225                                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
226                                .add(jCheckBox6)))))
227                .addContainerGap(116, Short.MAX_VALUE))
228        );
229    }// </editor-fold>//GEN-END:initComponents
230
231    private void removeThisProperty(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_removeThisProperty
232        if (removeListener != null)
233        {
234            removeListener.actionPerformed(new ActionEvent(this, 0, ""));
235        }   
236    }//GEN-LAST:event_removeThisProperty
237
238    private void jCheckBox1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jCheckBox1ActionPerformed
239        // TODO add your handling code here:
240    }//GEN-LAST:event_jCheckBox1ActionPerformed
241
242    private void jCheckBox2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jCheckBox2ActionPerformed
243        // TODO add your handling code here:
244    }//GEN-LAST:event_jCheckBox2ActionPerformed
245
246    private void jCheckBox3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jCheckBox3ActionPerformed
247        // TODO add your handling code here:
248    }//GEN-LAST:event_jCheckBox3ActionPerformed
249
250    private void jCheckBox4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jCheckBox4ActionPerformed
251        // TODO add your handling code here:
252    }//GEN-LAST:event_jCheckBox4ActionPerformed
253
254    private void jCheckBox5ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jCheckBox5ActionPerformed
255        // TODO add your handling code here:
256    }//GEN-LAST:event_jCheckBox5ActionPerformed
257
258    private void jCheckBox6ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jCheckBox6ActionPerformed
259        // TODO add your handling code here:
260    }//GEN-LAST:event_jCheckBox6ActionPerformed
261
262    private void jCheckBox7ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jCheckBox7ActionPerformed
263        // TODO add your handling code here:
264    }//GEN-LAST:event_jCheckBox7ActionPerformed
265
266    private void jCheckBox8ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jCheckBox8ActionPerformed
267        // TODO add your handling code here:
268    }//GEN-LAST:event_jCheckBox8ActionPerformed
269
270    private void jCheckBox9ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jCheckBox9ActionPerformed
271        // TODO add your handling code here:
272    }//GEN-LAST:event_jCheckBox9ActionPerformed
273
274    private void jCheckBox10ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jCheckBox10ActionPerformed
275        // TODO add your handling code here:
276    }//GEN-LAST:event_jCheckBox10ActionPerformed
277
278
279    // Variables declaration - do not modify//GEN-BEGIN:variables
280    private javax.swing.JCheckBox jCheckBox1;
281    private javax.swing.JCheckBox jCheckBox10;
282    private javax.swing.JCheckBox jCheckBox2;
283    private javax.swing.JCheckBox jCheckBox3;
284    private javax.swing.JCheckBox jCheckBox4;
285    private javax.swing.JCheckBox jCheckBox5;
286    private javax.swing.JCheckBox jCheckBox6;
287    private javax.swing.JCheckBox jCheckBox7;
288    private javax.swing.JCheckBox jCheckBox8;
289    private javax.swing.JCheckBox jCheckBox9;
290    private javax.swing.JComboBox jComboBox1;
291    private javax.swing.JComboBox jComboBox2;
292    private javax.swing.JComboBox jComboBox3;
293    private javax.swing.JLabel jLabel1;
294    private javax.swing.JLabel jLabel2;
295    private javax.swing.JLabel jLabel3;
296    private javax.swing.JLabel jLabel4;
297    private javax.swing.JButton removeButton;
298    // End of variables declaration//GEN-END:variables
299
300}
Note: See TracBrowser for help on using the repository browser.