Warning: Can't use blame annotator:
svn blame failed on branches/ScriptBuilder4/src/event/editor/WitnessPanel.java: ("Can't find a temporary directory: Internal error", 20014)

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

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

Add original prototype to branch

RevLine 
1package event.editor;
2
3import java.awt.event.*;
4
5/**
6 *
7 * @author nathaniellehrer
8 */
9public class WitnessPanel extends javax.swing.JPanel implements RemoveablePanel {
10
11    private ActionListener removeListener;
12
13    /** Creates new form WitnessPanel */
14    public WitnessPanel() {
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        jTextField1 = new javax.swing.JTextField();
35        jLabel2 = new javax.swing.JLabel();
36        jTextField2 = new javax.swing.JTextField();
37        jLabel3 = new javax.swing.JLabel();
38        jTextField3 = new javax.swing.JTextField();
39        jLabel4 = new javax.swing.JLabel();
40        jFormattedTextField1 = new javax.swing.JFormattedTextField();
41
42        removeButton.setText("Remove");
43        removeButton.addMouseListener(new java.awt.event.MouseAdapter() {
44            public void mouseClicked(java.awt.event.MouseEvent evt) {
45                removeThisProperty(evt);
46            }
47        });
48
49        jLabel1.setText("First Name");
50
51        jLabel2.setText("Last Name");
52
53        jLabel3.setText("Street Address");
54
55        jLabel4.setText("Phone Number");
56
57        jFormattedTextField1.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.NumberFormatter(new java.text.DecimalFormat("(###)###-####"))));
58
59        org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(this);
60        this.setLayout(layout);
61        layout.setHorizontalGroup(
62            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
63            .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup()
64                .addContainerGap()
65                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
66                    .add(removeButton)
67                    .add(org.jdesktop.layout.GroupLayout.LEADING, layout.createSequentialGroup()
68                        .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
69                            .add(jLabel3)
70                            .add(jLabel1)
71                            .add(jLabel2))
72                        .add(15, 15, 15)
73                        .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
74                            .add(org.jdesktop.layout.GroupLayout.TRAILING, jTextField2, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 547, Short.MAX_VALUE)
75                            .add(jTextField3, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 547, Short.MAX_VALUE)
76                            .add(org.jdesktop.layout.GroupLayout.TRAILING, jTextField1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 547, Short.MAX_VALUE)))
77                    .add(org.jdesktop.layout.GroupLayout.LEADING, layout.createSequentialGroup()
78                        .add(jLabel4)
79                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
80                        .add(jFormattedTextField1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 547, Short.MAX_VALUE)))
81                .addContainerGap())
82        );
83        layout.setVerticalGroup(
84            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
85            .add(layout.createSequentialGroup()
86                .addContainerGap()
87                .add(removeButton)
88                .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
89                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
90                    .add(jTextField1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
91                    .add(jLabel1))
92                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
93                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
94                    .add(jTextField2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
95                    .add(jLabel2))
96                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
97                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
98                    .add(jTextField3, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
99                    .add(jLabel3))
100                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
101                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
102                    .add(jLabel4)
103                    .add(jFormattedTextField1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
104                .addContainerGap(168, Short.MAX_VALUE))
105        );
106    }// </editor-fold>//GEN-END:initComponents
107
108    private void removeThisProperty(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_removeThisProperty
109        if (removeListener != null)
110        {
111            removeListener.actionPerformed(new ActionEvent(this, 0, ""));
112        }
113    }//GEN-LAST:event_removeThisProperty
114
115
116    // Variables declaration - do not modify//GEN-BEGIN:variables
117    private javax.swing.JFormattedTextField jFormattedTextField1;
118    private javax.swing.JLabel jLabel1;
119    private javax.swing.JLabel jLabel2;
120    private javax.swing.JLabel jLabel3;
121    private javax.swing.JLabel jLabel4;
122    private javax.swing.JTextField jTextField1;
123    private javax.swing.JTextField jTextField2;
124    private javax.swing.JTextField jTextField3;
125    private javax.swing.JButton removeButton;
126    // End of variables declaration//GEN-END:variables
127
128}
Note: See TracBrowser for help on using the repository browser.