Changeset 3853
- Timestamp:
- Sep 15, 2010, 3:06:31 PM (13 years ago)
- Location:
- trunk/client/servlet/src/org/proteios
- Files:
-
- 1 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/client/servlet/src/org/proteios/action/hit/HitsComparisonReport.java
r3849 r3853 43 43 import org.proteios.gui.TitledWindow; 44 44 import org.proteios.gui.Toolbar; 45 import org.proteios.gui.form. Form;45 import org.proteios.gui.form.*; 46 46 import org.proteios.gui.layout.RowLayout; 47 47 import org.proteios.gui.ColumnContainer; … … 66 66 extends ProteiosAction<HitsComparisonReport> 67 67 { 68 public static final VString VNONREQUIRED_FILENAME = new VString("fileName",0, 255, false); 68 69 public static final VInteger VHITSELECTION1PROJECTID = new VInteger("hitSelection1ProjectId", 1, true); 69 70 public static final VInteger VHITSELECTION2PROJECTID = new VInteger("hitSelection2ProjectId", 1, true); … … 126 127 // 127 128 // Get form 128 Form form = getFormFactory().getHitsComparisonReportForm( 129 project, project1, project2, filenamePrefixDefault); 129 Form form = new HitComparisonForm(project, project1, project2, filenamePrefixDefault); 130 130 String pageTitle = new String("HitsComparisonReport"); 131 131 Title title = new Title(pageTitle); -
trunk/client/servlet/src/org/proteios/gui/form/FormFactory.java
r3852 r3853 1911 1911 VString validStringParam = VNONREQUIRED_SAMPLE_STATE; 1912 1912 List<Option> optionList = new ArrayList<Option>(); 1913 optionList.add(new Option("emulsion", "emulsion") );1913 optionList.add(new Option("emulsion", "emulsion").setSelected(true)); 1914 1914 optionList.add(new Option("gas", "gas")); 1915 1915 optionList.add(new Option("liquid", "liquid")); … … 1918 1918 optionList.add(new Option("suspension", "suspension")); 1919 1919 String selected = new String("emulsion"); 1920 Select<VString> stateSelectBox = new StringSelectBox2(validStringParam,1921 optionList,selected);1920 Select<VString> stateSelectBox = new Select<VString>(validStringParam, optionList); 1921 stateSelectBox.selectOption(selected); 1922 1922 stateSelectBox.setLabel("SampleState"); 1923 1923 sampleInputFS.add(stateSelectBox); … … 2149 2149 2150 2150 2151 private Select<VString> selectMultiSelectionExternalGelId(DbControl dc,2152 Project project, VString vStringParam)2153 {2154 Select<VString> select = new Select<VString>(vStringParam);2155 select.setMultiple(true);2156 select.setLabel("GelExternalId");2157 if (dc != null && dc.isConnected())2158 {2159 List<String> gelIdList = Hit.getUniqueGelIds(project, dc);2160 /*2161 * Add select options for unique gel ids2162 */2163 for (int i = 0; i < gelIdList.size(); i++)2164 {2165 // Get plate id2166 String gelId = gelIdList.get(i);2167 if (gelId != null)2168 {2169 // Add option for plate id2170 Option o = new Option("" + gelId);2171 o.setContent(gelId);2172 select.addOption(o);2173 }2174 }2175 }2176 /*2177 * Add dummy option with message if no real options available.2178 */2179 if (select.getOptions().size() == 0)2180 {2181 Option noGelId = new Option("0");2182 noGelId.setContent("No gel external ID available");2183 select.addOption(noGelId);2184 select.setDisabled(true);2185 }2186 return select;2187 }2188 2189 2151 2190 2152 public Select<VString> selectLocalSampleIdWithAllOption(DbControl dc, … … 2202 2164 } 2203 2165 2204 2205 public Select<VString> selectMultiSelectionLocalSampleId(DbControl dc,2206 Project project, VString vStringParam)2207 {2208 Select<VString> select = new Select<VString>(vStringParam);2209 select.setMultiple(true);2210 select.setLabel("LocalSampleId");2211 if (dc != null && dc.isConnected())2212 {2213 List<String> localSampleIdList = Hit.getUniqueLocalSampleIds(2214 project, dc);2215 // Check if valid local sample id values exist2216 boolean validValuesExist = false;2217 if (localSampleIdList != null)2218 {2219 for (int i = 0; i < localSampleIdList.size(); i++)2220 {2221 log2222 .debug("localSampleIdList.get(" + i + ") = " + localSampleIdList2223 .get(i));2224 // Get local sample id2225 String localSampleId = localSampleIdList.get(i);2226 if (localSampleId != null)2227 {2228 validValuesExist = true;2229 continue;2230 }2231 }2232 }2233 /*2234 * Add dummy option with empty string as value2235 */2236 Option dummyLocalSampleId = new Option("");2237 if (!validValuesExist)2238 {2239 dummyLocalSampleId.setContent("No local sample ID available");2240 select.addOption(dummyLocalSampleId);2241 }2242 /*2243 * Add select options for unique local sample ids2244 */2245 for (int i = 0; i < localSampleIdList.size(); i++)2246 {2247 // Get local sample id2248 String localSampleId = localSampleIdList.get(i);2249 if (localSampleId != null)2250 {2251 // Add option for local sample id2252 Option o = new Option("" + localSampleId);2253 o.setContent(localSampleId);2254 select.addOption(o);2255 }2256 }2257 /*2258 * Disable select box if no valid options2259 */2260 if (!validValuesExist)2261 {2262 select.setDisabled(true);2263 }2264 }2265 return select;2266 }2267 2268 2269 public Select<VString> selectMultiSelectionFractionId(DbControl dc,2270 Project project, VString vStringParam)2271 {2272 Select<VString> select = new Select<VString>(vStringParam);2273 select.setMultiple(true);2274 select.setLabel("FractionId");2275 if (dc != null && dc.isConnected())2276 {2277 List<String> fractionIdList = Hit.getUniqueFractionIds(project, dc);2278 // Check if valid fraction id values exist2279 boolean validValuesExist = false;2280 if (fractionIdList != null)2281 {2282 for (int i = 0; i < fractionIdList.size(); i++)2283 {2284 // Get fraction id2285 String fractionId = fractionIdList.get(i);2286 if (fractionId != null)2287 {2288 validValuesExist = true;2289 continue;2290 }2291 }2292 }2293 /*2294 * Add dummy option with empty string as value2295 */2296 Option dummyFractionId = new Option("");2297 if (!validValuesExist)2298 {2299 dummyFractionId.setContent("No fraction ID available");2300 select.addOption(dummyFractionId);2301 }2302 /*2303 * Add select options for unique fraction ids2304 */2305 for (int i = 0; i < fractionIdList.size(); i++)2306 {2307 // Get fraction id2308 String fractionId = fractionIdList.get(i);2309 if (fractionId != null)2310 {2311 // Add option for fraction id2312 Option o = new Option("" + fractionId);2313 o.setContent(fractionId);2314 select.addOption(o);2315 }2316 }2317 /*2318 * Disable select box if no valid options2319 */2320 if (!validValuesExist)2321 {2322 select.setDisabled(true);2323 }2324 }2325 return select;2326 }2327 2166 2328 2167 … … 2355 2194 // Cleaning up from here 2356 2195 2357 public Form getHitsComparisonReportForm(Project project, Project project1,2358 Project project2, String filenamePrefixDefault)2359 {2360 DbControl dc = project.getDbControl();2361 Form form = new Form("comparisonOfHitsReportForm");2362 //2363 // Settings for project 1 hits2364 //2365 Fieldset project1FilterSettingsFS = new Fieldset();2366 project1FilterSettingsFS.setTitle(2367 "HitsComparisonReportFilterSettings1");2368 form.addFieldset(project1FilterSettingsFS);2369 //2370 TextField<Integer> project1IdF = new TextField<Integer>(HitsComparisonReport.VHITSELECTION1PROJECTID);2371 project1FilterSettingsFS.add(project1IdF);2372 project1IdF.setDisabled(true);2373 project1IdF.setLabel("HitsComparisonReportProject1Id");2374 project1IdF.setValue(project1.getId());2375 //2376 TextField<String> project1NameF = new DummyField();2377 project1FilterSettingsFS.add(project1NameF);2378 project1NameF.setDisabled(true);2379 project1NameF.setLabel("HitsComparisonReportProject1Name");2380 project1NameF.setValue(project1.getName());2381 //2382 int maxNumVisible = 5;2383 if (dc != null && dc.isConnected())2384 {2385 Select<VString> select = selectMultiSelectionExternalGelId(dc,2386 project1, HitsComparisonReport.VHITSELECTION1GELEXTERNALID);2387 select.setMaxSize(maxNumVisible);2388 project1FilterSettingsFS.add(select);2389 2390 select = selectMultiSelectionLocalSampleId(dc,2391 project1, HitsComparisonReport.VHITSELECTION1LOCALSAMPLEID);2392 select.setMaxSize(maxNumVisible);2393 project1FilterSettingsFS.add(select);2394 2395 select = selectMultiSelectionFractionId(dc,2396 project1, HitsComparisonReport.VHITSELECTION1FRACTIONID);2397 select.setLabel("FractionIdOptional");2398 select.setMaxSize(maxNumVisible);2399 project1FilterSettingsFS.add(select);2400 }2401 //2402 TextField<Float> project1FdrF = new TextField<Float>(HitsComparisonReport.VHITSELECTION1CUTOFF);2403 project1FdrF.setValue(new Float(0.01));2404 project1FdrF.setLabel("HitsComparisonReportProject1CombinedFDRUpperCutoff");2405 project1FilterSettingsFS.add(project1FdrF);2406 //2407 // Settings for project 2 hits2408 //2409 Fieldset project2FilterSettingsFS = new Fieldset();2410 project2FilterSettingsFS.setTitle(2411 "HitsComparisonReportFilterSettings2");2412 form.addFieldset(project2FilterSettingsFS);2413 //2414 TextField<Integer> project2IdF = new TextField<Integer>(HitsComparisonReport.VHITSELECTION2PROJECTID);2415 project2FilterSettingsFS.add(project2IdF);2416 project2IdF.setDisabled(true);2417 project2IdF.setLabel("HitsComparisonReportProject2Id");2418 project2IdF.setValue(project2.getId());2419 //2420 TextField<String> project2NameF = new DummyField();2421 project2FilterSettingsFS.add(project2NameF);2422 project2NameF.setDisabled(true);2423 project2NameF.setLabel("HitsComparisonReportProject2Name");2424 project2NameF.setValue(project2.getName());2425 //2426 if (dc != null && dc.isConnected())2427 {2428 Select<VString> select = selectMultiSelectionExternalGelId(dc,2429 project2, HitsComparisonReport.VHITSELECTION2GELEXTERNALID);2430 select.setMaxSize(maxNumVisible);2431 project2FilterSettingsFS.add(select);2432 2433 select = selectMultiSelectionLocalSampleId(dc,2434 project2, HitsComparisonReport.VHITSELECTION2LOCALSAMPLEID);2435 select.setMaxSize(maxNumVisible);2436 project2FilterSettingsFS.add(select);2437 2438 select = selectMultiSelectionFractionId(dc,2439 project2, HitsComparisonReport.VHITSELECTION2FRACTIONID);2440 select.setLabel("FractionIdOptional");2441 select.setMaxSize(maxNumVisible);2442 project2FilterSettingsFS.add(select);2443 }2444 //2445 TextField<Float> project2FdrF = new TextField<Float>(2446 HitsComparisonReport.VHITSELECTION2CUTOFF);2447 project2FdrF.setValue(new Float(0.01));2448 project2FdrF2449 .setLabel("HitsComparisonReportProject2CombinedFDRUpperCutoff");2450 project2FilterSettingsFS.add(project2FdrF);2451 //2452 // Hits comparison type (peptide/protein)2453 //2454 Fieldset hitComparisonTypeFS = new Fieldset();2455 hitComparisonTypeFS.setTitle(2456 "HitsComparisonReportComparisonType");2457 form.addFieldset(hitComparisonTypeFS);2458 //2459 VString validStringParam = HitsComparisonReport.VHITSCOMPARISONTYPE;2460 List<Option> optionList = new ArrayList<Option>();2461 optionList.add(new Option("peptide", "Peptide"));2462 optionList.add(new Option("protein", "Protein"));2463 String selected = "peptide";2464 Select<VString> comparisonTypeSelectBox = newStringSelectBox2(2465 validStringParam, optionList, selected);2466 comparisonTypeSelectBox2467 .setLabel("HitsComparisonReportComparisonTypeSelect");2468 hitComparisonTypeFS.add(comparisonTypeSelectBox);2469 //2470 // Hits comparison protein settings2471 //2472 Fieldset hitComparisonProteinSettingsFS = new Fieldset();2473 hitComparisonProteinSettingsFS.setTitle(2474 "HitsComparisonReportProteinSettings");2475 form.addFieldset(hitComparisonProteinSettingsFS);2476 //2477 Checkbox<VBoolean> ignoreCombinedFDRUpperCutoffCB = new Checkbox<VBoolean>(2478 HitsComparisonReport.VIGNORECOMBINEDFDRUPPERCUTOFF);2479 ignoreCombinedFDRUpperCutoffCB2480 .setLabel("HitsComparisonIgnoreCombinedFDRUpperCutoff");2481 ignoreCombinedFDRUpperCutoffCB.setValue("true");2482 ignoreCombinedFDRUpperCutoffCB.isChecked(true);2483 hitComparisonProteinSettingsFS.add(ignoreCombinedFDRUpperCutoffCB);2484 //2485 // Get score types from Hit query2486 List<String> scoreTypeList1 = Hit.getUniqueScoreTypes(project1, dc);2487 List<String> scoreTypeList2 = Hit.getUniqueScoreTypes(project2, dc);2488 // Combine score type lists2489 List<String> scoreTypeList = new ArrayList<String>(0);2490 if (scoreTypeList1 != null && scoreTypeList1.size() > 0)2491 {2492 for (String scoreType1 : scoreTypeList1)2493 {2494 // Beware of null strings in list2495 if (scoreType1 == null)2496 {2497 continue;2498 }2499 scoreTypeList.add(scoreType1);2500 }2501 }2502 if (scoreTypeList2 != null && scoreTypeList2.size() > 0)2503 {2504 for (String scoreType2 : scoreTypeList2)2505 {2506 // Beware of null strings in list2507 if (scoreType2 == null)2508 {2509 continue;2510 }2511 if (!scoreTypeList.contains(scoreType2))2512 {2513 scoreTypeList.add(scoreType2);2514 }2515 }2516 }2517 // Add score type settings select boxes2518 validStringParam = HitsComparisonReport.VHITSCOMPARISONSCORETYPE;2519 optionList = new ArrayList<Option>();2520 if (scoreTypeList != null && scoreTypeList.size() > 0)2521 {2522 for (String scoreType : scoreTypeList)2523 {2524 // Beware of null strings in list2525 if (scoreType == null)2526 {2527 continue;2528 }2529 optionList.add(new Option(scoreType, scoreType));2530 }2531 }2532 selected = "Proteios Protein";2533 Select<VString> comparisonScoreTypeSelectBox = newStringSelectBox2(2534 validStringParam, optionList, selected);2535 comparisonScoreTypeSelectBox2536 .setLabel("HitsComparisonReportScoreTypeSelect");2537 hitComparisonProteinSettingsFS.add(comparisonScoreTypeSelectBox);2538 //2539 Checkbox<VBoolean> onlyUseLeadingProteinsCB = new Checkbox<VBoolean>(2540 HitsComparisonReport.VONLYUSELEADINGPROTEINS);2541 onlyUseLeadingProteinsCB2542 .setLabel("HitsComparisonOnlyUseLeadingProteins");2543 onlyUseLeadingProteinsCB.setValue("true");2544 onlyUseLeadingProteinsCB.isChecked(true);2545 hitComparisonProteinSettingsFS.add(onlyUseLeadingProteinsCB);2546 //2547 // Hits comparison forward field (hidden)2548 //2549 TextField<String> forwardF = new ForwardField();2550 forwardF.setValue(actionFactory2551 .getId(CreateHitsComparisonReportJob.class));2552 hitComparisonTypeFS.add(forwardF);2553 //2554 // Hits comparison output2555 //2556 Fieldset comparisonOfHitsOutputFS = new Fieldset();2557 comparisonOfHitsOutputFS.setTitle(2558 "HitsComparisonReportOutput");2559 form.addFieldset(comparisonOfHitsOutputFS);2560 //2561 TextField<String> nameF = new TextField<String>(VNONREQUIRED_FILENAME);2562 nameF.setValue(filenamePrefixDefault);2563 nameF.setLabel("OutputFileNamePrefix");2564 comparisonOfHitsOutputFS.add(nameF);2565 //2566 Checkbox<VBoolean> appendExtraPrefixCB = new Checkbox<VBoolean>(2567 CreateHitsComparisonReportJob.VEXTRAPREFIX);2568 appendExtraPrefixCB.setLabel("HitsComparisonExtraPrefix");2569 appendExtraPrefixCB.setValue("true");2570 appendExtraPrefixCB.isChecked(false);2571 comparisonOfHitsOutputFS.add(appendExtraPrefixCB);2572 //2573 return form;2574 }2575 2576 2577 2196 public Form getPrideExportForm(Project project, String filenamePrefixDefault) 2578 2197 { … … 2758 2377 } 2759 2378 2760 2761 /**2762 * Returns a select box for selecting a string value.2763 *2764 * @param validParam VString Valid VString parameter coupled to select box.2765 * @param optionList List<Option> Option list of options.2766 * @param selected String Value of selected option.2767 * @return Select<VString> A select box for selecting a string value.2768 */2769 private Select<VString> newStringSelectBox2(VString validParam,2770 List<Option> optionList, String selected)2771 {2772 Select<VString> select = new Select<VString>(validParam);2773 select.setLabel(validParam.getName());2774 // Add options in list order2775 if (optionList != null)2776 {2777 for (int i = 0; i < optionList.size(); i++)2778 {2779 if (optionList.get(i) != null)2780 {2781 select.addOption(optionList.get(i));2782 }2783 }2784 }2785 // Set selected option2786 if (selected != null)2787 {2788 if (select.getOptions() != null)2789 {2790 for (int i = 0; i < select.getOptions().size(); i++)2791 {2792 if (select.getOptions().get(i).getValue().equals(selected))2793 {2794 select.getOptions().get(i).setSelected(true);2795 }2796 }2797 }2798 }2799 return select;2800 }2801 2379 2802 2380 … … 3023 2601 } 3024 2602 } 3025 Select<VString> searchTypeSelectBox = new StringSelectBox2(3026 validStringParam, optionList,selected);2603 Select<VString> searchTypeSelectBox = new Select<VString>(validStringParam, optionList); 2604 searchTypeSelectBox.selectOption(selected); 3027 2605 searchTypeSelectBox.setLabel("MascotSearchTypeSelect"); 3028 2606 if (mascotParameterSetStorage != null) … … 3468 3046 } 3469 3047 selected = mascotParameterSet.getDb(); 3470 Select<VString> sequenceLibrarySelectBox = new StringSelectBox2(3471 validStringParam, optionList,selected);3048 Select<VString> sequenceLibrarySelectBox = new Select<VString>(validStringParam, optionList); 3049 sequenceLibrarySelectBox.selectOption(selected); 3472 3050 sequenceLibrarySelectBox.setLabel("MascotSequenceLibrarySelect"); 3473 3051 generalFS.add(sequenceLibrarySelectBox); … … 3487 3065 } 3488 3066 selected = mascotParameterSet.getSpecies(); 3489 Select<VString> speciesSelectBox = newStringSelectBox2(validStringParam, optionList, selected); 3067 Select<VString> speciesSelectBox = new Select<VString>(validStringParam, optionList); 3068 speciesSelectBox.selectOption(selected); 3490 3069 speciesSelectBox.setLabel("MascotSpecies"); 3491 3070 generalFS.add(speciesSelectBox); … … 3505 3084 } 3506 3085 selected = mascotParameterSet.getEnzyme(); 3507 Select<VString> enzymeSelectBox = newStringSelectBox2(validStringParam, optionList, selected); 3086 Select<VString> enzymeSelectBox = new Select<VString>(validStringParam, optionList); 3087 enzymeSelectBox.selectOption(selected); 3508 3088 enzymeSelectBox.setLabel("MascotEnzymeSelect"); 3509 3089 generalFS.add(enzymeSelectBox); … … 3523 3103 } 3524 3104 selected = mascotParameterSet.getMissedCleavages(); 3525 Select<VString> missedCleavagesSelectBox = newStringSelectBox2(validStringParam, optionList, selected); 3105 Select<VString> missedCleavagesSelectBox = new Select<VString>(validStringParam, optionList); 3106 missedCleavagesSelectBox.selectOption(selected); 3526 3107 missedCleavagesSelectBox.setLabel("MascotMissedCleavagesSelect"); 3527 3108 generalFS.add(missedCleavagesSelectBox); … … 3582 3163 } 3583 3164 selected = mascotParameterSet.getQuantitation(); 3584 Select<VString> quantitationSelectBox = newStringSelectBox2(validStringParam, optionList, selected); 3165 Select<VString> quantitationSelectBox = new Select<VString>(validStringParam, optionList); 3166 quantitationSelectBox.selectOption(selected); 3585 3167 quantitationSelectBox.setLabel("MascotQuantitationSelect"); 3586 3168 generalFS.add(quantitationSelectBox); … … 3612 3194 } 3613 3195 selected = mascotParameterSet.getPepTolUnit(); 3614 Select<VString> peptideTolUnitSelectBox = newStringSelectBox2(validStringParam, optionList, selected); 3196 Select<VString> peptideTolUnitSelectBox = new Select<VString>(validStringParam, optionList); 3197 peptideTolUnitSelectBox.selectOption(selected); 3615 3198 peptideTolUnitSelectBox.setLabel("MascotPeptideToleranceUnitSelect"); 3616 3199 generalFS.add(peptideTolUnitSelectBox); … … 3632 3215 } 3633 3216 selected = mascotParameterSet.getPeptideIsotopeError(); 3634 Select<VString> peptideIsotopeErrorSelectBox = newStringSelectBox2( 3635 validStringParam, optionList, selected); 3217 Select<VString> peptideIsotopeErrorSelectBox = new Select<VString>( 3218 validStringParam, optionList); 3219 peptideIsotopeErrorSelectBox.selectOption( selected); 3636 3220 peptideIsotopeErrorSelectBox 3637 3221 .setLabel("MascotPeptideIsotopeErrorSelect"); … … 3657 3241 } 3658 3242 selected = mascotParameterSet.getMsMsTolUnit(); 3659 Select<VString> msMsTolUnitSelectBox = newStringSelectBox2( 3660 validStringParam, optionList, selected); 3243 Select<VString> msMsTolUnitSelectBox = new Select<VString>( 3244 validStringParam, optionList); 3245 msMsTolUnitSelectBox.selectOption( selected); 3661 3246 msMsTolUnitSelectBox.setLabel("MascotMsMsToleranceUnitSelect"); 3662 3247 generalFS.add(msMsTolUnitSelectBox); … … 3676 3261 } 3677 3262 selected = mascotParameterSet.getPeptideCharge(); 3678 Select<VString> peptideChargeSelectBox = newStringSelectBox2( 3679 validStringParam, optionList, selected); 3263 Select<VString> peptideChargeSelectBox = new Select<VString>( 3264 validStringParam, optionList); 3265 peptideChargeSelectBox.selectOption( selected); 3680 3266 peptideChargeSelectBox.setLabel("MascotPeptideChargeSelect"); 3681 3267 generalFS.add(peptideChargeSelectBox); … … 3692 3278 } 3693 3279 selected = mascotParameterSet.getMassIonType(); 3694 Select<VString> massIonTypeSelectBox = newStringSelectBox2( 3695 validStringParam, optionList, selected); 3280 Select<VString> massIonTypeSelectBox = new Select<VString>( 3281 validStringParam, optionList); 3282 massIonTypeSelectBox.selectOption( selected); 3696 3283 massIonTypeSelectBox.setLabel("MascotMassIonTypeSelect"); 3697 3284 generalFS.add(massIonTypeSelectBox); … … 3706 3293 } 3707 3294 selected = mascotParameterSet.getMassType(); 3708 Select<VString> massTypeSelectBox = newStringSelectBox2( 3709 validStringParam, optionList, selected); 3295 Select<VString> massTypeSelectBox = new Select<VString>( 3296 validStringParam, optionList); 3297 massTypeSelectBox.selectOption( selected); 3710 3298 massTypeSelectBox.setLabel("MascotMassTypeSelect"); 3711 3299 generalFS.add(massTypeSelectBox); … … 3725 3313 } 3726 3314 selected = mascotParameterSet.getDataFormat(); 3727 Select<VString> dataFormatSelectBox = newStringSelectBox2( 3728 validStringParam, optionList, selected); 3315 Select<VString> dataFormatSelectBox = new Select<VString>( 3316 validStringParam, optionList); 3317 dataFormatSelectBox.selectOption( selected); 3729 3318 dataFormatSelectBox.setLabel("MascotDataFormatSelect"); 3730 3319 generalFS.add(dataFormatSelectBox); … … 3760 3349 } 3761 3350 selected = mascotParameterSet.getInstrument(); 3762 Select<VString> instrumentSelectBox = newStringSelectBox2(validStringParam, optionList, selected); 3351 Select<VString> instrumentSelectBox = new Select<VString>(validStringParam, optionList); 3352 instrumentSelectBox.selectOption( selected); 3763 3353 instrumentSelectBox.setLabel("MascotInstrumentSelect"); 3764 3354 generalFS.add(instrumentSelectBox); … … 3804 3394 } 3805 3395 selected = mascotParameterSet.getReportTop(); 3806 Select<VString> reportTopSelectBox = newStringSelectBox2(validStringParam, optionList, selected); 3396 Select<VString> reportTopSelectBox = new Select<VString>(validStringParam, optionList); 3397 reportTopSelectBox.selectOption( selected); 3807 3398 reportTopSelectBox.setLabel("MascotReportTopSelect"); 3808 3399 generalFS.add(reportTopSelectBox); … … 3887 3478 .add(new Option("etd", "ETD (electron transfer dissociation)")); 3888 3479 String selected = new String("iontrap"); 3889 Select<VString> searchSpectrumTypeSelectBox = newStringSelectBox2( 3890 validStringParam, optionList, selected); 3480 Select<VString> searchSpectrumTypeSelectBox = new Select<VString>( 3481 validStringParam, optionList); 3482 searchSpectrumTypeSelectBox.selectOption( selected); 3891 3483 searchSpectrumTypeSelectBox.setLabel("OMSSASearchSpectrumTypeSelect"); 3892 3484 if (omssaParameterSetStorage != null) … … 4309 3901 } 4310 3902 selected = omssaParameterSet.getEnzyme(); 4311 Select<VString> enzymeSelectBox = newStringSelectBox2(validStringParam, 4312 optionList, selected); 3903 Select<VString> enzymeSelectBox = new Select<VString>(validStringParam, 3904 optionList); 3905 enzymeSelectBox.selectOption( selected); 4313 3906 enzymeSelectBox.setLabel("OMSSAEnzymeSelect"); 4314 3907 generalFS.add(enzymeSelectBox); … … 4329 3922 } 4330 3923 selected = omssaParameterSet.getDb(); 4331 Select<VString> sequenceLibrarySelectBox = newStringSelectBox2( 4332 validStringParam, optionList, selected); 3924 Select<VString> sequenceLibrarySelectBox = new Select<VString>( 3925 validStringParam, optionList); 3926 sequenceLibrarySelectBox.selectOption( selected); 4333 3927 sequenceLibrarySelectBox.setLabel("OMSSASequenceLibrarySelect"); 4334 3928 generalFS.add(sequenceLibrarySelectBox); … … 4439 4033 } 4440 4034 selected = omssaParameterSet.getPrecursorSearchType(); 4441 Select<VString> precursorMassSearchTypeSelectBox = newStringSelectBox2( 4442 validStringParam, optionList, selected); 4035 Select<VString> precursorMassSearchTypeSelectBox = new Select<VString>( 4036 validStringParam, optionList); 4037 precursorMassSearchTypeSelectBox.selectOption( selected); 4443 4038 precursorMassSearchTypeSelectBox.setLabel("OMSSAPrecursorMassSearchTypeSelect"); 4444 4039 generalFS.add(precursorMassSearchTypeSelectBox); … … 4451 4046 } 4452 4047 selected = omssaParameterSet.getProductSearchType(); 4453 Select<VString> productMassSearchTypeSelectBox = newStringSelectBox2( 4454 validStringParam, optionList, selected); 4048 Select<VString> productMassSearchTypeSelectBox = new Select<VString>( 4049 validStringParam, optionList); 4050 productMassSearchTypeSelectBox.selectOption( selected); 4455 4051 productMassSearchTypeSelectBox 4456 4052 .setLabel("OMSSAProductMassSearchTypeSelect"); … … 4489 4085 } 4490 4086 selected = omssaParameterSet.getIonsToSearch1(); 4491 Select<VString> ionsToSearch1SelectBox = newStringSelectBox2(validStringParam, optionList, selected); 4087 Select<VString> ionsToSearch1SelectBox = new Select<VString>(validStringParam, optionList); 4088 ionsToSearch1SelectBox.selectOption( selected); 4492 4089 ionsToSearch1SelectBox.setLabel("OMSSAIonsToSearch1Select"); 4493 4090 generalFS.add(ionsToSearch1SelectBox); … … 4500 4097 } 4501 4098 selected = omssaParameterSet.getIonsToSearch2(); 4502 Select<VString> ionsToSearch2SelectBox = newStringSelectBox2(validStringParam, optionList, selected); 4099 Select<VString> ionsToSearch2SelectBox = new Select<VString>(validStringParam, optionList); 4100 ionsToSearch2SelectBox.selectOption( selected); 4503 4101 ionsToSearch2SelectBox.setLabel("OMSSAIonsToSearch2Select"); 4504 4102 generalFS.add(ionsToSearch2SelectBox); … … 4517 4115 } 4518 4116 selected = omssaParameterSet.getZDep(); 4519 Select<VString> zDepSelectBox = newStringSelectBox2(validStringParam, optionList, selected); 4117 Select<VString> zDepSelectBox = new Select<VString>(validStringParam, optionList); 4118 zDepSelectBox.selectOption( selected); 4520 4119 zDepSelectBox.setLabel("OMSSAZDepSelect"); 4521 4120 extraFS.add(zDepSelectBox); … … 4630 4229 optionList.add(new Option("false", "false")); 4631 4230 selected = omssaParameterSet.getNMethionineAttribute(); 4632 Select<VString> nMethionineSelectBox = newStringSelectBox2(validStringParam, optionList, selected); 4231 Select<VString> nMethionineSelectBox = new Select<VString>(validStringParam, optionList); 4232 nMethionineSelectBox.selectOption( selected); 4633 4233 nMethionineSelectBox.setLabel("OMSSANMethionineSelect"); 4634 4234 extraFS.add(nMethionineSelectBox); … … 5520 5120 } 5521 5121 selected = xTandemParameterSet.getListPathDefaultParameters(); 5522 Select<VString> listPathDefaultParametersSelectBox = newStringSelectBox2(validStringParam, optionList, selected); 5122 Select<VString> listPathDefaultParametersSelectBox = new Select<VString>(validStringParam, optionList); 5123 listPathDefaultParametersSelectBox.selectOption( selected); 5523 5124 listPathDefaultParametersSelectBox.setLabel("XTandemListPathDefaultParameters"); 5524 5125 listPathDefaultParametersSelectBox.setMultiple(false); … … 5680 5281 } 5681 5282 selected = xTandemParameterSet.getResidueModificationMass(); 5682 Select<VString> residueModificationMassSelectBox = newStringSelectBox2( 5683 validStringParam, optionList, selected); 5283 Select<VString> residueModificationMassSelectBox = new Select<VString>( 5284 validStringParam, optionList); 5285 residueModificationMassSelectBox.selectOption( selected); 5684 5286 residueModificationMassSelectBox 5685 5287 .setLabel("XTandemResidueModificationMassSelect"); … … 5828 5430 } 5829 5431 selected = xTandemParameterSet.getProteinTaxon(); 5830 // Select<VString> taxon = newStringSelectBox2(validStringParam,5831 // optionList, selected);5832 5432 selectedList = listStringToStringList(selected, ",\\ "); 5833 5433 Select<VString> taxon = newStringMultipleSelectBox(validStringParam, … … 5903 5503 } 5904 5504 selected = xTandemParameterSet.getProteinCleavageSite(); 5905 Select<VString> proteinCleavageSiteSelectBox = newStringSelectBox2( 5906 validStringParam, optionList, selected); 5505 Select<VString> proteinCleavageSiteSelectBox = new Select<VString>( 5506 validStringParam, optionList); 5507 proteinCleavageSiteSelectBox.selectOption( selected); 5907 5508 proteinCleavageSiteSelectBox 5908 5509 .setLabel("XTandemProteinCleavageSiteSelect"); … … 6206 5807 optionList.add(new Option("k-score", "k-score")); 6207 5808 selected = xTandemParameterSet.getScoringAlgorithm(); 6208 Select<VString> algorithmSelectBox = newStringSelectBox2( 6209 validStringParam, optionList, selected); 5809 Select<VString> algorithmSelectBox = new Select<VString>( 5810 validStringParam, optionList); 5811 algorithmSelectBox.selectOption( selected); 6210 5812 scoringFS.add(algorithmSelectBox); 6211 5813 /* … … 6392 5994 } 6393 5995 selected = pikeSourceDatabase; 6394 Select<VString> sourceDatabaseSelectBox = newStringSelectBox2( 6395 validStringParam, optionList, selected); 5996 Select<VString> sourceDatabaseSelectBox = new Select<VString>( 5997 validStringParam, optionList); 5998 sourceDatabaseSelectBox.selectOption( selected); 6396 5999 sourceDatabaseSelectBox.setLabel("PIKESourceDatabaseSelect"); 6397 6000 inputFS.add(sourceDatabaseSelectBox); … … 6432 6035 optionList.add(new Option("0", "no")); 6433 6036 selected = pikeGeneOntologyCheck; 6434 Select<VString> geneOntologyCheckSelectBox = newStringSelectBox2( 6435 validStringParam, optionList, selected); 6037 Select<VString> geneOntologyCheckSelectBox = new Select<VString>( 6038 validStringParam, optionList); 6039 geneOntologyCheckSelectBox.selectOption( selected); 6436 6040 geneOntologyCheckSelectBox.setLabel("PIKEGeneOntologyCheckSelect"); 6437 6041 inputFS.add(geneOntologyCheckSelectBox); … … 6455 6059 } 6456 6060 selected = pikeInputFileType; 6457 Select<VString> inputFileTypeSelectBox = newStringSelectBox2( 6458 validStringParam, optionList, selected); 6061 Select<VString> inputFileTypeSelectBox = new Select<VString>( 6062 validStringParam, optionList); 6063 inputFileTypeSelectBox.selectOption( selected); 6459 6064 inputFileTypeSelectBox.setLabel("PIKEInputFileTypeSelect"); 6460 6065 inputFS.add(inputFileTypeSelectBox); -
trunk/client/servlet/src/org/proteios/gui/form/Option.java
r3404 r3853 106 106 107 107 108 public voidsetSelected(boolean selected)108 public Option setSelected(boolean selected) 109 109 { 110 110 this.selected = selected; 111 return this; 111 112 } 112 113 } -
trunk/client/servlet/src/org/proteios/gui/form/Select.java
r3850 r3853 55 55 } 56 56 57 public Select(D param, List<Option> options) 58 { 59 this(param); 60 setLabel(param.getName()); 61 this.options = options; 62 } 57 63 58 64 public String getName() … … 60 66 return name; 61 67 } 62 63 68 64 69 public void setName(String name) … … 128 133 } 129 134 135 /** 136 Sets all options matching the given value to selected 137 */ 138 public void selectOption(String value) 139 { 140 // Set selected option 141 if (value != null) 142 { 143 if (getOptions() != null) 144 { 145 for( Option opt : getOptions()) 146 { 147 if (opt.getValue().equals(value)) 148 { 149 opt.setSelected(true); 150 } 151 } 152 } 153 } 154 } 155 130 156 }
Note: See TracChangeset
for help on using the changeset viewer.