| 1 | package event.editor; |
|---|
| 2 | |
|---|
| 3 | import java.awt.event.*; |
|---|
| 4 | import javax.swing.*; |
|---|
| 5 | import java.util.*; |
|---|
| 6 | |
|---|
| 7 | /** |
|---|
| 8 | * |
|---|
| 9 | * @author nathaniellehrer |
|---|
| 10 | */ |
|---|
| 11 | public class CHPRadioPanel extends javax.swing.JPanel { |
|---|
| 12 | |
|---|
| 13 | private ActionListener removeListener; |
|---|
| 14 | |
|---|
| 15 | |
|---|
| 16 | /** Creates new form CHPRadioPanel */ |
|---|
| 17 | public CHPRadioPanel() { |
|---|
| 18 | initComponents(); |
|---|
| 19 | HashMap<JButton, String> buttonMap = new HashMap<JButton, String>(); |
|---|
| 20 | buttonMap.put(addDispatchButton, "Dispatch"); |
|---|
| 21 | buttonMap.put(addFieldButton, "Field"); |
|---|
| 22 | GenericTable.genericizeTable(jScrollPane1, buttonMap, deleteSelectedButton); |
|---|
| 23 | } |
|---|
| 24 | |
|---|
| 25 | /** This method is called from within the constructor to |
|---|
| 26 | * initialize the form. |
|---|
| 27 | * WARNING: Do NOT modify this code. The content of this method is |
|---|
| 28 | * always regenerated by the Form Editor. |
|---|
| 29 | */ |
|---|
| 30 | @SuppressWarnings("unchecked") |
|---|
| 31 | // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents |
|---|
| 32 | private void initComponents() { |
|---|
| 33 | |
|---|
| 34 | jLabel4 = new javax.swing.JLabel(); |
|---|
| 35 | audioText = new javax.swing.JTextField(); |
|---|
| 36 | jButton2 = new javax.swing.JButton(); |
|---|
| 37 | addDispatchButton = new javax.swing.JButton(); |
|---|
| 38 | deleteSelectedButton = new javax.swing.JButton(); |
|---|
| 39 | jScrollPane1 = new javax.swing.JScrollPane(); |
|---|
| 40 | addFieldButton = new javax.swing.JButton(); |
|---|
| 41 | |
|---|
| 42 | jLabel4.setText("Radio File"); |
|---|
| 43 | |
|---|
| 44 | audioText.setToolTipText("The radio audio file"); |
|---|
| 45 | |
|---|
| 46 | jButton2.setText("Browse"); |
|---|
| 47 | jButton2.setToolTipText("Browse for the radio audio file"); |
|---|
| 48 | jButton2.addMouseListener(new java.awt.event.MouseAdapter() { |
|---|
| 49 | public void mouseClicked(java.awt.event.MouseEvent evt) { |
|---|
| 50 | browse(evt); |
|---|
| 51 | } |
|---|
| 52 | }); |
|---|
| 53 | |
|---|
| 54 | addDispatchButton.setText("Add Dispatch"); |
|---|
| 55 | addDispatchButton.setToolTipText("Adds a row for dialog by the dispatch operator in the table"); |
|---|
| 56 | |
|---|
| 57 | deleteSelectedButton.setText("Delete Selected"); |
|---|
| 58 | deleteSelectedButton.setToolTipText("Deletes the selected row from the table"); |
|---|
| 59 | |
|---|
| 60 | addFieldButton.setText("Add Field"); |
|---|
| 61 | addFieldButton.setToolTipText("Adds a row for dialog by the field operator in the table"); |
|---|
| 62 | addFieldButton.addActionListener(new java.awt.event.ActionListener() { |
|---|
| 63 | public void actionPerformed(java.awt.event.ActionEvent evt) { |
|---|
| 64 | addFieldButtonActionPerformed(evt); |
|---|
| 65 | } |
|---|
| 66 | }); |
|---|
| 67 | |
|---|
| 68 | org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(this); |
|---|
| 69 | this.setLayout(layout); |
|---|
| 70 | layout.setHorizontalGroup( |
|---|
| 71 | layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) |
|---|
| 72 | .add(layout.createSequentialGroup() |
|---|
| 73 | .addContainerGap() |
|---|
| 74 | .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) |
|---|
| 75 | .add(jScrollPane1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 730, Short.MAX_VALUE) |
|---|
| 76 | .add(layout.createSequentialGroup() |
|---|
| 77 | .add(addDispatchButton, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 130, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) |
|---|
| 78 | .add(3, 3, 3) |
|---|
| 79 | .add(addFieldButton, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 130, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) |
|---|
| 80 | .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED) |
|---|
| 81 | .add(deleteSelectedButton, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 131, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) |
|---|
| 82 | .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)) |
|---|
| 83 | .add(layout.createSequentialGroup() |
|---|
| 84 | .add(jLabel4) |
|---|
| 85 | .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) |
|---|
| 86 | .add(audioText, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 511, Short.MAX_VALUE) |
|---|
| 87 | .add(18, 18, 18) |
|---|
| 88 | .add(jButton2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 130, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))) |
|---|
| 89 | .addContainerGap()) |
|---|
| 90 | ); |
|---|
| 91 | layout.setVerticalGroup( |
|---|
| 92 | layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) |
|---|
| 93 | .add(layout.createSequentialGroup() |
|---|
| 94 | .addContainerGap() |
|---|
| 95 | .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) |
|---|
| 96 | .add(audioText, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) |
|---|
| 97 | .add(jLabel4) |
|---|
| 98 | .add(jButton2)) |
|---|
| 99 | .add(18, 18, 18) |
|---|
| 100 | .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) |
|---|
| 101 | .add(addDispatchButton) |
|---|
| 102 | .add(addFieldButton) |
|---|
| 103 | .add(deleteSelectedButton)) |
|---|
| 104 | .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED) |
|---|
| 105 | .add(jScrollPane1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 341, Short.MAX_VALUE) |
|---|
| 106 | .addContainerGap()) |
|---|
| 107 | ); |
|---|
| 108 | }// </editor-fold>//GEN-END:initComponents |
|---|
| 109 | |
|---|
| 110 | private void browse(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_browse |
|---|
| 111 | JFileChooser browser = new JFileChooser(); |
|---|
| 112 | int returnVal = browser.showOpenDialog(this); |
|---|
| 113 | if(returnVal == JFileChooser.APPROVE_OPTION) { |
|---|
| 114 | audioText.setText(browser.getSelectedFile().getPath()); |
|---|
| 115 | } |
|---|
| 116 | }//GEN-LAST:event_browse |
|---|
| 117 | |
|---|
| 118 | private void addFieldButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_addFieldButtonActionPerformed |
|---|
| 119 | // TODO add your handling code here: |
|---|
| 120 | }//GEN-LAST:event_addFieldButtonActionPerformed |
|---|
| 121 | |
|---|
| 122 | // Variables declaration - do not modify//GEN-BEGIN:variables |
|---|
| 123 | private javax.swing.JButton addDispatchButton; |
|---|
| 124 | private javax.swing.JButton addFieldButton; |
|---|
| 125 | private javax.swing.JTextField audioText; |
|---|
| 126 | private javax.swing.JButton deleteSelectedButton; |
|---|
| 127 | private javax.swing.JButton jButton2; |
|---|
| 128 | private javax.swing.JLabel jLabel4; |
|---|
| 129 | private javax.swing.JScrollPane jScrollPane1; |
|---|
| 130 | // End of variables declaration//GEN-END:variables |
|---|
| 131 | |
|---|
| 132 | } |
|---|