- Timestamp:
- 12/19/2019 06:48:37 PM (6 years ago)
- Location:
- trunk/src/event/editor
- Files:
-
- 4 edited
-
AudioPanel.form (modified) (4 diffs)
-
AudioPanel.java (modified) (5 diffs)
-
CHPRadioPanel.form (modified) (4 diffs)
-
CHPRadioPanel.java (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/event/editor/AudioPanel.form
r92 r171 25 25 <EmptySpace max="-2" attributes="0"/> 26 26 <Group type="103" groupAlignment="0" attributes="0"> 27 <Group type="102" alignment="0" attributes="0"> 28 <Component id="audioFileText" min="-2" pref="395" max="-2" attributes="0"/> 29 <EmptySpace max="-2" attributes="0"/> 30 <Component id="browseButton" pref="93" max="32767" attributes="0"/> 31 </Group> 32 <Component id="audioLengthText" alignment="0" pref="497" max="32767" attributes="0"/> 27 <Component id="audioLengthText" pref="497" max="32767" attributes="0"/> 28 <Component id="audioFileText" max="32767" attributes="0"/> 33 29 </Group> 34 30 <EmptySpace max="-2" attributes="0"/> … … 39 35 <Group type="103" groupAlignment="0" attributes="0"> 40 36 <Group type="102" alignment="0" attributes="0"> 41 <EmptySpace min="-2" pref="4 1" max="-2" attributes="0"/>37 <EmptySpace min="-2" pref="44" max="-2" attributes="0"/> 42 38 <Group type="103" groupAlignment="3" attributes="0"> 43 39 <Component id="audioFileText" alignment="3" min="-2" max="-2" attributes="0"/> 44 40 <Component id="jLabel1" alignment="3" min="-2" max="-2" attributes="0"/> 45 <Component id="browseButton" alignment="3" min="-2" max="-2" attributes="0"/>46 41 </Group> 47 42 <EmptySpace max="-2" attributes="0"/> … … 64 59 <Properties> 65 60 <Property name="toolTipText" type="java.lang.String" value="The path to the audio file"/> 61 <Property name="enabled" type="boolean" value="false"/> 66 62 </Properties> 67 63 </Component> … … 78 74 </Properties> 79 75 </Component> 80 <Component class="javax.swing.JButton" name="browseButton">81 <Properties>82 <Property name="text" type="java.lang.String" value="Browse"/>83 <Property name="toolTipText" type="java.lang.String" value="Browse for the audio file"/>84 </Properties>85 <Events>86 <EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="browse"/>87 </Events>88 </Component>89 76 </SubComponents> 90 77 </Form> -
trunk/src/event/editor/AudioPanel.java
r140 r171 71 71 @SuppressWarnings("unchecked") 72 72 // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents 73 private void initComponents() 74 { 73 private void initComponents() { 75 74 76 75 jLabel1 = new javax.swing.JLabel(); … … 78 77 jLabel2 = new javax.swing.JLabel(); 79 78 audioLengthText = new javax.swing.JFormattedTextField(); 80 browseButton = new javax.swing.JButton();81 79 82 80 jLabel1.setText("Audio File"); 83 81 84 82 audioFileText.setToolTipText("The path to the audio file"); 83 audioFileText.setEnabled(false); 85 84 86 85 jLabel2.setText("Length"); 87 86 88 87 audioLengthText.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.NumberFormatter(java.text.NumberFormat.getIntegerInstance()))); 89 90 browseButton.setText("Browse");91 browseButton.setToolTipText("Browse for the audio file");92 browseButton.addMouseListener(new java.awt.event.MouseAdapter()93 {94 public void mouseClicked(java.awt.event.MouseEvent evt)95 {96 browse(evt);97 }98 });99 88 100 89 org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(this); … … 109 98 .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) 110 99 .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) 111 .add(layout.createSequentialGroup() 112 .add(audioFileText, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 395, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) 113 .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) 114 .add(browseButton, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 93, Short.MAX_VALUE)) 115 .add(audioLengthText, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 497, Short.MAX_VALUE)) 100 .add(audioLengthText, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 497, Short.MAX_VALUE) 101 .add(audioFileText)) 116 102 .addContainerGap()) 117 103 ); … … 119 105 layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) 120 106 .add(layout.createSequentialGroup() 121 .add(4 1, 41, 41)107 .add(44, 44, 44) 122 108 .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) 123 109 .add(audioFileText, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) 124 .add(jLabel1) 125 .add(browseButton)) 110 .add(jLabel1)) 126 111 .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) 127 112 .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) … … 132 117 }// </editor-fold>//GEN-END:initComponents 133 118 134 private void browse(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_browse135 JFileChooser browser = new JFileChooser();136 int returnVal = browser.showOpenDialog(this);137 if (returnVal == JFileChooser.APPROVE_OPTION)138 {139 audioFileText.setText(browser.getSelectedFile().getPath());140 }141 }//GEN-LAST:event_browse142 143 119 144 120 // Variables declaration - do not modify//GEN-BEGIN:variables 145 121 private javax.swing.JTextField audioFileText; 146 122 private javax.swing.JFormattedTextField audioLengthText; 147 private javax.swing.JButton browseButton;148 123 private javax.swing.JLabel jLabel1; 149 124 private javax.swing.JLabel jLabel2; -
trunk/src/event/editor/CHPRadioPanel.form
r1 r171 27 27 <EmptySpace type="unrelated" max="-2" attributes="0"/> 28 28 <Component id="deleteSelectedButton" min="-2" pref="131" max="-2" attributes="0"/> 29 <EmptySpace min="0" pref="331" max="32767" attributes="0"/> 29 30 </Group> 30 31 <Group type="102" alignment="0" attributes="1"> 31 32 <Component id="jLabel4" min="-2" max="-2" attributes="0"/> 32 33 <EmptySpace max="-2" attributes="0"/> 33 <Component id="audioText" pref="511" max="32767" attributes="0"/> 34 <EmptySpace type="separate" max="-2" attributes="0"/> 35 <Component id="jButton2" min="-2" pref="130" max="-2" attributes="0"/> 34 <Component id="audioText" max="32767" attributes="0"/> 36 35 </Group> 37 36 </Group> … … 47 46 <Component id="audioText" alignment="3" min="-2" max="-2" attributes="0"/> 48 47 <Component id="jLabel4" alignment="3" min="-2" max="-2" attributes="0"/> 49 <Component id="jButton2" alignment="3" min="-2" max="-2" attributes="0"/>50 48 </Group> 51 49 <EmptySpace type="separate" max="-2" attributes="0"/> … … 56 54 </Group> 57 55 <EmptySpace type="unrelated" max="-2" attributes="0"/> 58 <Component id="jScrollPane1" pref="34 1" max="32767" attributes="0"/>56 <Component id="jScrollPane1" pref="347" max="32767" attributes="0"/> 59 57 <EmptySpace max="-2" attributes="0"/> 60 58 </Group> … … 71 69 <Properties> 72 70 <Property name="toolTipText" type="java.lang.String" value="The radio audio file"/> 71 <Property name="enabled" type="boolean" value="false"/> 73 72 </Properties> 74 </Component>75 <Component class="javax.swing.JButton" name="jButton2">76 <Properties>77 <Property name="text" type="java.lang.String" value="Browse"/>78 <Property name="toolTipText" type="java.lang.String" value="Browse for the radio audio file"/>79 </Properties>80 <Events>81 <EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="browse"/>82 </Events>83 73 </Component> 84 74 <Component class="javax.swing.JButton" name="addDispatchButton"> -
trunk/src/event/editor/CHPRadioPanel.java
r140 r171 110 110 @SuppressWarnings("unchecked") 111 111 // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents 112 private void initComponents() 113 { 112 private void initComponents() { 114 113 115 114 jLabel4 = new javax.swing.JLabel(); 116 115 audioText = new javax.swing.JTextField(); 117 jButton2 = new javax.swing.JButton();118 116 addDispatchButton = new javax.swing.JButton(); 119 117 deleteSelectedButton = new javax.swing.JButton(); … … 124 122 125 123 audioText.setToolTipText("The radio audio file"); 126 127 jButton2.setText("Browse"); 128 jButton2.setToolTipText("Browse for the radio audio file"); 129 jButton2.addMouseListener(new java.awt.event.MouseAdapter() 130 { 131 public void mouseClicked(java.awt.event.MouseEvent evt) 132 { 133 browse(evt); 134 } 135 }); 124 audioText.setEnabled(false); 136 125 137 126 addDispatchButton.setText("Add Dispatch"); … … 143 132 addFieldButton.setText("Add Field"); 144 133 addFieldButton.setToolTipText("Adds a row for dialog by the field operator in the table"); 145 addFieldButton.addActionListener(new java.awt.event.ActionListener() 146 { 147 public void actionPerformed(java.awt.event.ActionEvent evt) 148 { 134 addFieldButton.addActionListener(new java.awt.event.ActionListener() { 135 public void actionPerformed(java.awt.event.ActionEvent evt) { 149 136 addFieldButtonActionPerformed(evt); 150 137 } … … 164 151 .add(addFieldButton, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 130, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) 165 152 .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED) 166 .add(deleteSelectedButton, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 131, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) 153 .add(deleteSelectedButton, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 131, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) 154 .add(0, 331, Short.MAX_VALUE)) 167 155 .add(layout.createSequentialGroup() 168 156 .add(jLabel4) 169 157 .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) 170 .add(audioText, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 511, Short.MAX_VALUE) 171 .add(18, 18, 18) 172 .add(jButton2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 130, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))) 158 .add(audioText))) 173 159 .addContainerGap()) 174 160 ); … … 179 165 .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) 180 166 .add(audioText, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) 181 .add(jLabel4) 182 .add(jButton2)) 167 .add(jLabel4)) 183 168 .add(18, 18, 18) 184 169 .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) … … 187 172 .add(deleteSelectedButton)) 188 173 .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED) 189 .add(jScrollPane1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 34 1, Short.MAX_VALUE)174 .add(jScrollPane1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 347, Short.MAX_VALUE) 190 175 .addContainerGap()) 191 176 ); 192 177 }// </editor-fold>//GEN-END:initComponents 193 194 private void browse(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_browse195 JFileChooser browser = new JFileChooser();196 int returnVal = browser.showOpenDialog(this);197 if (returnVal == JFileChooser.APPROVE_OPTION)198 {199 audioText.setText(browser.getSelectedFile().getPath());200 }201 }//GEN-LAST:event_browse202 178 203 179 private void addFieldButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_addFieldButtonActionPerformed … … 210 186 private javax.swing.JTextField audioText; 211 187 private javax.swing.JButton deleteSelectedButton; 212 private javax.swing.JButton jButton2;213 188 private javax.swing.JLabel jLabel4; 214 189 private javax.swing.JScrollPane jScrollPane1;
Note: See TracChangeset
for help on using the changeset viewer.
