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

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

Add original prototype to branch

Line 
1package event.editor;
2
3import java.awt.event.*;
4import java.util.*;
5
6/**
7 *
8 * @author nathaniellehrer
9 */
10public class CMSEvaluationPanel extends javax.swing.JPanel implements RemoveablePanel {
11
12    private HashMap<String, Class> properties;
13    private ActionListener removeListener;
14
15    /** Creates new form CMSEvaluation */
16    public CMSEvaluationPanel() {
17        initComponents();
18
19        GenericTable.genericizeNumberedTable(jScrollPane1, addButton, deleteButton);
20    }
21   
22    public void setRemoveListener(ActionListener listener)
23    {
24        removeListener = listener;
25    }
26
27    /** This method is called from within the constructor to
28     * initialize the form.
29     * WARNING: Do NOT modify this code. The content of this method is
30     * always regenerated by the Form Editor.
31     */
32    @SuppressWarnings("unchecked")
33    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
34    private void initComponents() {
35
36        removeButton = new javax.swing.JButton();
37        jLabel3 = new javax.swing.JLabel();
38        jTextField1 = new javax.swing.JTextField();
39        jLabel2 = new javax.swing.JLabel();
40        jComboBox1 = new javax.swing.JComboBox();
41        jFormattedTextField1 = new javax.swing.JFormattedTextField();
42        jLabel1 = new javax.swing.JLabel();
43        deleteButton = new javax.swing.JButton();
44        jScrollPane1 = new javax.swing.JScrollPane();
45        addButton = new javax.swing.JButton();
46
47        removeButton.setText("Remove");
48        removeButton.setToolTipText("Removes this property");
49        removeButton.addMouseListener(new java.awt.event.MouseAdapter() {
50            public void mouseClicked(java.awt.event.MouseEvent evt) {
51                removeButtonremoveThisProperty(evt);
52            }
53        });
54
55        jLabel3.setText("Location");
56
57        jTextField1.setToolTipText("Example: SB 55 @ WARNER AVE");
58
59        jLabel2.setText("Type");
60
61        jComboBox1.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Update", "New", "Remove" }));
62
63        jFormattedTextField1.setToolTipText("Example: 72");
64
65        jLabel1.setText("CMS ID");
66
67        deleteButton.setText("Delete Selected Message");
68        deleteButton.setToolTipText("Deletes the selected message from the table");
69
70        jScrollPane1.setHorizontalScrollBar(null);
71
72        addButton.setText("Add Message");
73        addButton.setToolTipText("Adds a message to the table");
74
75        org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(this);
76        this.setLayout(layout);
77        layout.setHorizontalGroup(
78            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
79            .add(layout.createSequentialGroup()
80                .addContainerGap()
81                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
82                    .add(layout.createSequentialGroup()
83                        .add(jScrollPane1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 584, Short.MAX_VALUE)
84                        .addContainerGap())
85                    .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup()
86                        .add(removeButton)
87                        .addContainerGap())
88                    .add(layout.createSequentialGroup()
89                        .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
90                            .add(jLabel1)
91                            .add(jLabel3)
92                            .add(jLabel2))
93                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
94                        .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
95                            .add(jComboBox1, 0, 520, Short.MAX_VALUE)
96                            .add(jTextField1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 520, Short.MAX_VALUE)
97                            .add(jFormattedTextField1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 520, Short.MAX_VALUE))
98                        .addContainerGap())
99                    .add(layout.createSequentialGroup()
100                        .add(6, 6, 6)
101                        .add(addButton)
102                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
103                        .add(deleteButton, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 178, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
104                        .add(293, 293, 293))))
105        );
106        layout.setVerticalGroup(
107            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
108            .add(layout.createSequentialGroup()
109                .add(17, 17, 17)
110                .add(removeButton)
111                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
112                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
113                    .add(jLabel1)
114                    .add(jFormattedTextField1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
115                .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
116                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
117                    .add(jComboBox1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
118                    .add(jLabel2))
119                .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
120                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
121                    .add(jLabel3)
122                    .add(jTextField1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
123                .add(31, 31, 31)
124                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
125                    .add(deleteButton)
126                    .add(addButton))
127                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
128                .add(jScrollPane1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 191, Short.MAX_VALUE)
129                .addContainerGap())
130        );
131    }// </editor-fold>//GEN-END:initComponents
132
133    private void removeButtonremoveThisProperty(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_removeButtonremoveThisProperty
134        if (removeListener != null) {
135            removeListener.actionPerformed(new ActionEvent(this, 0, ""));
136        }
137}//GEN-LAST:event_removeButtonremoveThisProperty
138
139
140    // Variables declaration - do not modify//GEN-BEGIN:variables
141    private javax.swing.JButton addButton;
142    private javax.swing.JButton deleteButton;
143    private javax.swing.JComboBox jComboBox1;
144    private javax.swing.JFormattedTextField jFormattedTextField1;
145    private javax.swing.JLabel jLabel1;
146    private javax.swing.JLabel jLabel2;
147    private javax.swing.JLabel jLabel3;
148    private javax.swing.JScrollPane jScrollPane1;
149    private javax.swing.JTextField jTextField1;
150    private javax.swing.JButton removeButton;
151    // End of variables declaration//GEN-END:variables
152
153}
Note: See TracBrowser for help on using the repository browser.