voxforge.org
VoxForge Dev

Changeset 2356

Show
Ignore:
Timestamp:
11/17/07 16:11:00 (11 months ago)
Author:
kmaclean
Message:

SpeechSubmission App translation: converted drop downs selections to arrays

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • Trunk/SpeechSubmission/VFSpeechSubmission/java/src/speechrecorder/CapturePlayback.java

    r2353 r2356  
    100100    AudioInputStream audioInputStream; 
    101101    SamplingGraph samplingGraph; 
    102     JButton uploadB; 
    103     JButton moreInfoB;     
    104     JButton aboutB;  
     102 
    105103    JButton play1; 
    106104    JButton capt1; 
     
    123121    JButton play10; 
    124122    JButton capt10; 
    125     JCheckBox acceptLicenseCB;     
     123    JButton uploadB; 
     124    JButton moreInfoB;     
     125    JButton aboutB;  
    126126   
    127127    boolean play1_state; 
     
    179179    private File wavFile4; 
    180180    private File wavFile5;   
     181    private File wavFile6; 
     182    private File wavFile7; 
     183    private File wavFile8; 
     184    private File wavFile9; 
     185    private File wavFile10;  
    181186    private File uploadWavFile1; 
    182187    private File uploadWavFile2; 
     
    184189    private File uploadWavFile4; 
    185190    private File uploadWavFile5;      
    186     private File wavFile6; 
    187     private File wavFile7; 
    188     private File wavFile8; 
    189     private File wavFile9; 
    190     private File wavFile10;   
    191191    private File uploadWavFile6; 
    192192    private File uploadWavFile7; 
     
    217217    String prompt4; 
    218218    String prompt5;   
     219    String prompt6; 
     220    String prompt7; 
     221    String prompt8; 
     222    String prompt9; 
     223    String prompt10;   
    219224    String promptID1; 
    220225    String promptID2; 
     
    222227    String promptID4; 
    223228    String promptID5;     
    224     String prompt6; 
    225     String prompt7; 
    226     String prompt8; 
    227     String prompt9; 
    228     String prompt10;   
    229229    String promptID6; 
    230230    String promptID7; 
     
    247247    String genderPanelLabel = labels.genderPanelLabel; 
    248248    JComboBox genderChooser;        
    249     String male = labels.male;     
    250     String female = labels.female; 
    251     String[] genderSelection = {pleaseSelect,male, female}; 
     249    String[] genderSelection = labels.genderSelection; 
    252250    String gender = notApplicable; 
    253251     
    254252    String ageRangePanelLabel = labels.ageRangePanelLabel; 
    255253    JComboBox ageRangeChooser;  
    256     String youth = labels.youth;   
    257     String adult = labels.adult;  
    258     String senior = labels.senior;  
    259     String[] ageSelection = {pleaseSelect ,youth, adult, senior }; 
     254    String[] ageSelection = labels.ageSelection; 
    260255    String ageRange = notApplicable; 
    261256 
    262     String dialectPanelLabel = "Pronunciation Dialect:"; 
    263     JComboBox dialectChooser;      
    264     String dialect1 = labels.dialect1;     
    265     String dialect2 =labels.dialect2;   
    266     String dialect3 = labels.dialect3;  
    267     String dialect4 = labels.dialect4;       
    268     String dialect5 = labels.dialect5;  
    269     String dialect6 = labels.dialect6;  
    270     String dialect7 = labels.dialect7;      
    271     String dialect8 = labels.dialect8;     
    272     String dialect9 = labels.dialect9;     
    273     String dialect10 = labels.dialect10;     
    274     String otherDialect = labels.otherDialect; 
    275     String[] dialectSelection = {pleaseSelect,dialect1, dialect2, dialect3, dialect4, dialect5, dialect6, dialect7, otherDialect}; 
    276     String dialect = notApplicable; 
    277      
    278     String microphonePanelLabel = "Microphone Type:"; 
     257    String dialectPanelLabel = labels.dialectPanelLabel; 
     258    JComboBox dialectChooser; 
     259    String dialect = notApplicable;  // default selection 
     260    String[] dialectSelection = labels.dialectSelection; 
     261 
     262    String microphonePanelLabel = labels.microphonePanelLabel; 
    279263    JComboBox microphoneChooser;      
    280     String headset = labels.headset;     
    281     String USBheadset = labels.USBheadset;    
    282     String desktopBoom = labels.desktopBoom;   
    283     String USBdesktopBoom = labels.USBdesktopBoom;   
    284     String laptopBuiltin = labels.laptopBuiltin;  
    285     String webcam = labels.webcam;       
    286     String studio = labels.studio;  
    287     String otherMic = labels.otherMic;  
    288     String[] microphonetSelection = {pleaseSelect,headset,USBheadset, desktopBoom, USBdesktopBoom, laptopBuiltin, webcam, studio, otherMic}; 
     264    String[] microphoneSelection = labels.microphoneSelection; 
    289265    String microphone = notApplicable;   
    290266     
     
    485461        genderChooser.addActionListener(new ActionListener(){ 
    486462                 public void actionPerformed(ActionEvent e){ 
    487                      String choice = (String)genderChooser.getSelectedItem(); 
    488                      if(choice.equals(male)){ 
    489                          gender = (male); 
    490                      }else if(choice.equals(female)){ 
    491                          gender = (female); 
    492                      }else if(choice.equals(pleaseSelect)){ 
    493                          gender = (notApplicable); 
    494                      }else { 
    495                          gender = (notApplicable); 
    496                      } 
     463                     String gender = (String)genderChooser.getSelectedItem(); 
    497464                 } 
    498465                 }); 
     
    507474        ageRangeChooser.addActionListener(new ActionListener(){ 
    508475                 public void actionPerformed(ActionEvent e){ 
    509                      String choice = (String)ageRangeChooser.getSelectedItem(); 
    510                      if(choice.equals(youth)){ 
    511                          ageRange = (youth); 
    512                      }else if(choice.equals(adult)){ 
    513                          ageRange = (adult); 
    514                      }else if(choice.equals(senior)){ 
    515                          ageRange = (senior); 
    516                      }else if(choice.equals(pleaseSelect)){ 
    517                          ageRange = (notApplicable); 
    518                      }else { 
    519                          ageRange = (notApplicable); 
    520                      } 
     476                     String ageRange = (String)ageRangeChooser.getSelectedItem(); 
    521477                 } 
    522478                 }); 
     
    529485        dialectChooser.setSelectedIndex(0);   
    530486        dialectChooser.addActionListener(new ActionListener(){ 
    531                  public void actionPerformed(ActionEvent e){ 
    532                      String choice = (String)dialectChooser.getSelectedItem(); 
    533                      if(choice.equals(dialect1)){ 
    534                          dialect = (dialect1); 
    535                      }else if (choice.equals(dialect2)){ 
    536                          dialect = (dialect2); 
    537                      }else if(choice.equals(dialect3)){ 
    538                          dialect = (dialect3); 
    539                      }else if(choice.equals(dialect4)){ 
    540                          dialect = (dialect4); 
    541                      }else if(choice.equals(dialect5)){ 
    542                          dialect = (dialect5); 
    543                      }else if(choice.equals(dialect6)){ 
    544                          dialect = (dialect6); 
    545                      }else if(choice.equals(dialect7)){ 
    546                          dialect = (dialect7); 
    547                      }else if(choice.equals(dialect8)){ 
    548                          dialect = (dialect8); 
    549                      }else if(choice.equals(dialect9)){ 
    550                          dialect = (dialect9); 
    551                      }else if(choice.equals(dialect10)){ 
    552                          dialect = (dialect10); 
    553                      }else if(choice.equals(otherDialect)){ 
    554                          dialect = (otherDialect); 
    555                      }else if(choice.equals(pleaseSelect)){ 
    556                          dialect = (notApplicable); 
    557                      }else { 
    558                          dialect = (notApplicable); 
    559                      } 
    560                  } 
    561                  }); 
     487            public void actionPerformed(ActionEvent e){ 
     488                dialect = (String)dialectChooser.getSelectedItem(); 
     489            } 
     490            }); 
    562491        p2.add(dialectPanel); 
    563492//      ############ Microphone Type: ####################################        
     
    565494        microphonePanel.setLayout(new FlowLayout(FlowLayout.CENTER)); 
    566495        microphonePanel.add(new JLabel(microphonePanelLabel)); 
    567         microphonePanel.add(microphoneChooser = new JComboBox(microphonetSelection)); 
     496        microphonePanel.add(microphoneChooser = new JComboBox(microphoneSelection)); 
    568497        microphoneChooser.setSelectedIndex(0);   
    569498 //       microphoneChooser.setEditable(true); // user can add whatever they want ... 
    570499        microphoneChooser.addActionListener(new ActionListener(){ 
    571500                 public void actionPerformed(ActionEvent e){ 
    572                      String choice = (String)dialectChooser.getSelectedItem(); 
    573                      if(choice.equals(headset)){ 
    574                          microphone = (headset); 
    575                      }else if (choice.equals(USBheadset)){ 
    576                          microphone = (USBheadset); 
    577                      }else if (choice.equals(desktopBoom)){ 
    578                          microphone = (desktopBoom); 
    579                      }else if (choice.equals(USBdesktopBoom)){ 
    580                          microphone = (USBdesktopBoom); 
    581                      }else if(choice.equals(laptopBuiltin)){ 
    582                          microphone = (laptopBuiltin); 
    583                      }else if(choice.equals(webcam)){ 
    584                          microphone = (webcam); 
    585                      }else if(choice.equals(studio)){ 
    586                          microphone = (studio); 
    587                      }else if(choice.equals(otherMic)){ 
    588                          microphone = (otherMic); 
    589                      }else if(choice.equals(pleaseSelect)){ 
    590                          microphone = (notApplicable); 
    591                      }else { 
    592                          microphone = (notApplicable); 
    593                      } 
     501                     String microphone = (String)dialectChooser.getSelectedItem(); 
    594502                 } 
    595503                 }); 
  • Trunk/SpeechSubmission/VFSpeechSubmission/java/src/speechrecorder/LabelLocalizer.java

    r2355 r2356  
    1212     
    1313    String genderPanelLabel; 
    14     String male;     
    15     String female; 
     14    String genderSelection []; 
    1615     
    1716    String ageRangePanelLabel; 
    18     String youth;   
    19     String adult;  
    20     String senior;  
     17    String ageSelection []; 
    2118 
    2219    String dialectPanelLabel; 
    23     String dialect1;     
    24     String dialect2;   
    25     String dialect3;  
    26     String dialect4;       
    27     String dialect5;  
    28     String dialect6;  
    29     String dialect7;      
    30     String dialect8;     
    31     String dialect9;     
    32     String dialect10;     
    33     String otherDialect; 
     20    String dialectSelection []; 
    3421     
    3522    String microphonePanelLabel; 
    36     String headset;     
    37     String USBheadset;    
    38     String desktopBoom;   
    39     String USBdesktopBoom;   
    40     String laptopBuiltin;  
    41     String webcam;       
    42     String studio;  
    43     String otherMic;  
     23    String microphoneSelection []; 
    4424     
    4525    String uploadText; 
     
    7959             pleaseSelect = "Please Select"; 
    8060             notApplicable = "unknown"; 
    81              
     61             
    8262             genderPanelLabel = "Gender:"; 
    83              male = "Male";     
    84              female = "Female"; 
    85              
     63             genderSelection = new String [3]; 
     64             genderSelection[0] = pleaseSelect;    
     65             genderSelection[1] = "Male";     
     66             genderSelection[2] = "Female";  
     67     
    8668             ageRangePanelLabel = "Age Range:"; 
    87              youth = "Youth";   
    88              adult = "Adult";  
    89              senior = "Senior";  
     69             ageSelection = new String [4]; 
     70             ageSelection[0] = pleaseSelect;   
     71             ageSelection[1] = "Youth";   
     72             ageSelection[2] = "Adult";  
     73             ageSelection[3] = "Senior";  
    9074         
    9175             dialectPanelLabel = "Pronunciation Dialect:"; 
    92              dialect1 = "Australian English";     
    93              dialect2 = "American English";   
    94              dialect3 = "British English";  
    95              dialect4 = "Canadian English";       
    96              dialect5 = "European English";  
    97              dialect6 = "New Zealand English";  
    98              dialect7 = "South African English";      
    99              dialect8 = "";     
    100              dialect9 = "";     
    101              dialect10 = "";     
    102              otherDialect = "Other"; 
     76             dialectSelection = new String [9]; 
     77             dialectSelection[0] = pleaseSelect;     
     78             dialectSelection[1] = "Australian English";     
     79             dialectSelection[2] = "American English";    // other 
     80             dialectSelection[3] = "British English";  
     81             dialectSelection[4] = "Canadian English";       
     82             dialectSelection[5] = "European English";  
     83             dialectSelection[6] = "New Zealand English";  
     84             dialectSelection[7] = "South African English";      
     85             dialectSelection[8] = "Other"; 
    10386             
    10487             microphonePanelLabel = "Microphone Type:"; 
    105              headset = "Headset mic";     
    106              USBheadset = "USB Headset mic";    
    107              desktopBoom = "Desktop Boom mic";   
    108              USBdesktopBoom = "USB Desktop Boom mic";   
    109              laptopBuiltin = "Laptop Built-in mic";  
    110              webcam = "WebCam mic";       
    111              studio = "Studio mic";  
    112              otherMic = "Other";  
     88             microphoneSelection = new String [9]; 
     89             microphoneSelection[0] = pleaseSelect;   
     90             microphoneSelection[1] = "Headset mic";     
     91             microphoneSelection[2] = "USB Headset mic";    
     92             microphoneSelection[3] = "Desktop Boom mic";   
     93             microphoneSelection[4] = "USB Desktop Boom mic";   
     94             microphoneSelection[5] = "Laptop Built-in mic";  
     95             microphoneSelection[6] = "WebCam mic";       
     96             microphoneSelection[7] = "Studio mic";  
     97             microphoneSelection[8] = "Other";  
    11398             
    11499             uploadText = "<html>By clicking the \"Upload\" button, you agree to assign the Copyright to your recorded speech to <br> " 
     
    136121 
    137122        } 
     123         
    138124        private void Dutch() { 
    139125             usernamePanelLabel = "Gebruikersnaam:"; 
     
    147133             
    148134             genderPanelLabel = "geslacht:"; 
    149              male = "mannelijk";     
    150              female = "vrouwelijk"; 
     135             genderSelection = new String [3]; 
     136             genderSelection[0] = pleaseSelect;    
     137             genderSelection[1] = "mannelijk";     
     138             genderSelection[2] = "vrouwelijk"; 
    151139             
    152140             ageRangePanelLabel = "leeftijd:"; 
    153              youth = "jeugd";   
    154              adult = "volwassen";  
    155              senior = "senior";  
    156          
    157              dialectPanelLabel = "dialect:"; 
    158              dialect1 = "standaard Nederlands";     
    159              dialect2 = "";   
    160              dialect3 = "";  
    161              dialect4 = "";       
    162              dialect5 = "";  
    163              dialect6 = "";  
    164              dialect7 = "";      
    165              dialect8 = "";     
    166              dialect9 = "";     
    167              dialect10 = "";     
    168              otherDialect = "anders"; 
    169              
     141             ageSelection = new String [4]; 
     142             ageSelection[0] = pleaseSelect;   
     143             ageSelection[1] = "jeugd";   
     144             ageSelection[2] = "volwassen";  
     145             ageSelection[3] = "senior";  
     146              
     147             dialectPanelLabel = "dialect:";  
     148             dialectSelection = new String [3]; 
     149             dialectSelection[0] = pleaseSelect;     
     150             dialectSelection[1] = "standaard Nederlands";     
     151             dialectSelection[2] = "anders";    // other 
     152 
    170153             microphonePanelLabel = "type microfoon:"; 
    171              headset = "headsetmicrofoon";     
    172              USBheadset = "headsetmicrofoon (USB)";    
    173              desktopBoom = "bureaumicrofoon";   
    174              USBdesktopBoom = "bureaumicrofoon (USB)";   
    175              laptopBuiltin = "microfoon in laptop";  
    176              webcam = "webcam microfoon";       
    177              studio = "studiomicrofoon";  
    178              otherMic = "anders";  
     154             microphoneSelection = new String [9]; 
     155             microphoneSelection[0] = pleaseSelect;   
     156             microphoneSelection[1] = "headsetmicrofoon";     
     157             microphoneSelection[2] = "headsetmicrofoon (USB)";    
     158             microphoneSelection[3] = "bureaumicrofoon";   
     159             microphoneSelection[4] = "bureaumicrofoon (USB)";   
     160             microphoneSelection[5] = "microfoon in laptop";  
     161             microphoneSelection[6] = "webcam microfoon";       
     162             microphoneSelection[7] = "studiomicrofoon";  
     163             microphoneSelection[8] = "anders";  // other 
    179164             
    180165             uploadText = "<html>druk op de knop \"doneren\" om het auteursrecht in de opgenomen  <br>" +