Changeset 3813
- Timestamp:
- Sep 2, 2010, 4:57:19 PM (13 years ago)
- Location:
- trunk/client/servlet/src/org/proteios
- Files:
-
- 11 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/client/servlet/src/org/proteios/action/hit/CombineHits.java
r3267 r3813 46 46 import org.proteios.core.query.Hql; 47 47 import org.proteios.core.query.Restrictions; 48 import org.proteios.gui.form. FormFactory;48 import org.proteios.gui.form.*; 49 49 import se.lu.thep.waf.ActionException; 50 50 import se.lu.thep.waf.constraints.InvalidParameterValue; … … 61 61 extends ProteiosAction<CombineHits> 62 62 { 63 public static final VString VCOMBINE_HITS_SCORE_TYPE = new VString("CombineHitsScoreType", 0, 64 255, false); 65 public static final VString VCOMBINE_HITS_SCORE_TYPE_SETTING = new VString("CombineHitsScoreTypeSetting", 0, 66 32, false); 67 public static final VBoolean VKEEPRANDOM = new VBoolean("isKeepRandom", false); 63 public static final VString VCOMBINE_HITS_SCORE_TYPE = CombineHitScoreTypeField.VPARAM; 64 public static final VString VCOMBINE_HITS_SCORE_TYPE_SETTING = CombineHitScoreTypeSettingField.VPARAM; 65 public static final VBoolean VKEEPRANDOM = KeepRandomCheckbox.VPARAM; 68 66 69 67 /* -
trunk/client/servlet/src/org/proteios/action/hit/CombineHitsStep1.java
r3318 r3813 39 39 import org.proteios.gui.TitledWindow; 40 40 import org.proteios.gui.Toolbar; 41 import org.proteios.gui.form. Form;41 import org.proteios.gui.form.*; 42 42 import org.proteios.gui.layout.RowLayout; 43 43 import org.proteios.gui.ColumnContainer; … … 80 80 dc = newDbControl(); 81 81 project = isProjectActive(dc); 82 form = getFormFactory().getCombineHitsForm(project);82 form = new CombineHitsForm(dc, project); 83 83 title = new Title("CombinedHitsReport"); 84 84 instructionArea = new TitledWindow(); -
trunk/client/servlet/src/org/proteios/gui/form/FormFactory.java
r3812 r3813 232 232 public static final VString VREQUIRED_FILENAME = new VString("fileName", 1, 233 233 255, true); 234 public static final VString VFWDACTION = new VString("forwardActionId", 1, 235 255, false); 234 public static final VString VFWDACTION = ForwardField.VPARAM; 236 235 public static final VString VFWD2ACTION = new VString("forward2ActionId", 237 236 1, 255, false); … … 287 286 public static final VFloat VUSEDQUANTITYINMICROLITERS = new VFloat( 288 287 "UsedQuantityInMicroLiters", true); 289 public static final VFloat VFDR = new VFloat("falseDiscoveryRate", true);288 public static final VFloat VFDR = FDRField.VPARAM; 290 289 public static final VBoolean VPEPTIDECOMPARE = new VBoolean( 291 290 "isPeptideCompare", false); … … 849 848 fs.add(typeF); 850 849 // Forward action field 851 TextField<String> fwdactionF = new ForwardField();850 TextField<String> fwdactionF = new ForwardField(); 852 851 fs.add(fwdactionF); 853 852 // Select field … … 882 881 } 883 882 return form; 884 }885 886 887 /**888 * @return Hidden <code>TextField<String></code> using the valid889 * parameter {@link #VFWDACTION}.890 */891 private TextField<String> newForwardField()892 {893 TextField<String> field = new TextField<String>(VFWDACTION)894 .setHidden(true);895 return field;896 883 } 897 884 … … 2405 2392 { 2406 2393 // 2407 TextField<String> forwardF = new ForwardField();2394 TextField<String> forwardF = new ForwardField(); 2408 2395 forwardF.setValue(actionFactory 2409 2396 .getId(CreateProteinAssemblyJob.class)); 2410 2397 properties.add(forwardF); 2411 2398 // 2412 properties.add( selectExternalGelId(dc, project));2399 properties.add(new ExternalGelIdSelect(dc, project)); 2413 2400 properties.add(selectLocalSampleId(dc, project)); 2414 2401 TextField<String> nameF = new TextField<String>(VFILENAME); … … 2421 2408 2422 2409 // Cleaning up from here 2423 public Form getCombineHitsForm(Project project)2424 {2425 DbControl dc = project.getDbControl();2426 Form form = new Form("combineHitsForm");2427 if (dc != null && dc.isConnected())2428 {2429 //2430 Fieldset properties = new Fieldset();2431 properties.getLegendTitle().setTitle("SettingsForReport");2432 form.addFieldset(properties);2433 //2434 TextField<String> forwardF = newForwardField();2435 forwardF.setValue(actionFactory.getId(CombineHits.class));2436 properties.add(forwardF);2437 //2438 properties.add(selectExternalGelId(dc, project));2439 properties.add(selectLocalSampleIdWithAllOption(dc, project));2440 TextField<Float> fdrF = new TextField<Float>(VFDR);2441 fdrF.setValue(new Float(0.01));2442 fdrF.setLabel("AllowedFDR");2443 properties.add(fdrF);2444 Checkbox<VBoolean> isProteinCB = new Checkbox<VBoolean>(2445 VPEPTIDECOMPARE);2446 isProteinCB.setLabel("ComparePeptides");2447 isProteinCB.setValue("true");2448 properties.add(isProteinCB);2449 TextField<String> randomString = new TextField<String>(2450 VRANDOMSTRING);2451 randomString.setValue("IPR");2452 randomString.setLabel("RandomHitsPrefix");2453 properties.add(randomString);2454 Checkbox<VBoolean> keepRandomCB = new Checkbox<VBoolean>(2455 CombineHits.VKEEPRANDOM);2456 keepRandomCB.setLabel("KeepRandom");2457 keepRandomCB.setValue("true");2458 properties.add(keepRandomCB);2459 //2460 // Score Type field set2461 Fieldset scoreTypeFS = new Fieldset();2462 scoreTypeFS.getLegendTitle().setTitle("ScoreTypeSettings");2463 form.addFieldset(scoreTypeFS);2464 //2465 // Get score types from Hit query2466 List<String> scoreTypeList = Hit.getUniqueScoreTypes(project, dc);2467 log.debug("scoreTypeList = " + scoreTypeList);2468 List<String> scoreTypeUsedList = new ArrayList<String>();2469 //2470 // Add score type settings select boxes2471 if (scoreTypeList != null && scoreTypeList.size() > 0)2472 {2473 for (String scoreType : scoreTypeList)2474 {2475 // Beware of null strings in list2476 if (scoreType == null)2477 {2478 continue;2479 }2480 // Skip "Proteios Protein" score types, as these hits are2481 // already combined2482 if (scoreType.equals("Proteios Protein"))2483 {2484 continue;2485 }2486 // Cut off score type string after space2487 log.debug("(1) scoreType = \"" + scoreType + "\"");2488 int spaceIndex = scoreType.indexOf(" ");2489 if (spaceIndex > 0)2490 {2491 scoreType = scoreType.substring(0, spaceIndex);2492 }2493 log.debug("(2) scoreType = \"" + scoreType + "\"");2494 // Check that score type not already used2495 if (scoreTypeUsedList.contains(scoreType))2496 {2497 continue;2498 }2499 else2500 {2501 // Add score type to used score type list2502 scoreTypeUsedList.add(scoreType);2503 }2504 // Hidden text field for storing score type2505 TextField<String> scoreTypeF = newHiddenStringField(CombineHits.VCOMBINE_HITS_SCORE_TYPE);2506 scoreTypeF.setValue(scoreType);2507 scoreTypeFS.add(scoreTypeF);2508 // Combined Hits Score Type select box2509 VString validStringParam = CombineHits.VCOMBINE_HITS_SCORE_TYPE_SETTING;2510 List<Option> optionList = new ArrayList<Option>();2511 optionList.add(new Option("", "Not used"));2512 optionList.add(new Option("evalue", "E-value"));2513 optionList.add(new Option("score", "Score"));2514 // Default is 'E-value', except for Mascot, where 'Score' is2515 // used2516 String selected = new String("evalue");2517 if (scoreType.equals("Mascot"))2518 {2519 selected = new String("score");2520 }2521 Select<VString> scoreTypeSelectBox = newStringSelectBox2(2522 validStringParam, optionList, selected);2523 scoreTypeSelectBox.setLabel(scoreType);2524 scoreTypeFS.add(scoreTypeSelectBox);2525 }2526 }2527 //2528 // Output field set2529 Fieldset outputFS = new Fieldset();2530 outputFS.getLegendTitle().setTitle("Output");2531 form.addFieldset(outputFS);2532 //2533 TextField<String> nameF = new TextField<String>(VFILENAME);2534 nameF.setValue("CombinedHitsReport.tsv");2535 nameF.setLabel("OutputFileName");2536 outputFS.add(nameF);2537 }2538 return form;2539 }2540 2541 2410 2542 2411 public Form getImportHitsForm(Project project) … … 2551 2420 form.addFieldset(properties); 2552 2421 // 2553 TextField<String> forwardF = new ForwardField();2422 TextField<String> forwardF = new ForwardField(); 2554 2423 forwardF.setValue(actionFactory.getId(ImportHits.class)); 2555 2424 properties.add(forwardF); … … 2608 2477 * selection action called by ImportHitsWizardStep1a. 2609 2478 */ 2610 TextField<String> forwardF = new ForwardField();2479 TextField<String> forwardF = new ForwardField(); 2611 2480 forwardF 2612 2481 .setValue(actionFactory.getId(ImportHitsWizardStep1b.class)); … … 2657 2526 * selection action called by ImportHitsWizardStep1a. 2658 2527 */ 2659 TextField<String> forwardF = new ForwardField();2528 TextField<String> forwardF = new ForwardField(); 2660 2529 forwardF 2661 2530 .setValue(actionFactory.getId(ImportHitsWizardStep2b.class)); … … 2715 2584 * selection action called by ImportHitsWizardStep1a. 2716 2585 */ 2717 TextField<String> forwardF = new ForwardField();2586 TextField<String> forwardF = new ForwardField(); 2718 2587 forwardF 2719 2588 .setValue(actionFactory.getId(ImportHitsWizardStep3b.class)); … … 2762 2631 * selection action called by ImportHitsNonGelWizardStep1a. 2763 2632 */ 2764 TextField<String> forwardF = new ForwardField();2633 TextField<String> forwardF = new ForwardField(); 2765 2634 forwardF.setValue(actionFactory 2766 2635 .getId(ImportHitsNonGelWizardStep1b.class)); … … 2836 2705 * selection action called by ImportHitsNonGelWizardStep2a. 2837 2706 */ 2838 TextField<String> forwardF = new ForwardField();2707 TextField<String> forwardF = new ForwardField(); 2839 2708 forwardF.setValue(actionFactory 2840 2709 .getId(ImportHitsNonGelWizardStep2b.class)); … … 2877 2746 noPlateId.setContent("No plate id available"); 2878 2747 select.addOption(noPlateId); 2879 }2880 return select;2881 }2882 2883 2884 private Select<VString> selectExternalGelId(DbControl dc, Project project)2885 {2886 Select<VString> select = new Select<VString>(VREQUIRED_GELEXTERNALID);2887 select.setLabel("GelExternalId");2888 if (dc != null && dc.isConnected())2889 {2890 List<String> gelIdList = Hit.getUniqueGelIds(project, dc);2891 /*2892 * Add select options for unique gel ids2893 */2894 for (int i = 0; i < gelIdList.size(); i++)2895 {2896 // Get plate id2897 String gelId = gelIdList.get(i);2898 if (gelId != null)2899 {2900 // Add option for plate id2901 Option o = new Option("" + gelId);2902 o.setContent(gelId);2903 select.addOption(o);2904 }2905 }2906 }2907 /*2908 * Add dummy option with message if no real options available.2909 */2910 if (select.getOptions().size() == 0)2911 {2912 Option noGelId = new Option("0");2913 noGelId.setContent("No gel external ID available");2914 select.addOption(noGelId);2915 2748 } 2916 2749 return select; … … 3531 3364 // Hits comparison forward field (hidden) 3532 3365 // 3533 TextField<String> forwardF = new ForwardField();3366 TextField<String> forwardF = new ForwardField(); 3534 3367 forwardF.setValue(actionFactory 3535 3368 .getId(CreateHitsComparisonReportJob.class)); … … 3571 3404 if (dc != null && dc.isConnected()) 3572 3405 { 3573 prideFilterSettingsFS.add( selectExternalGelId(dc, project));3406 prideFilterSettingsFS.add(new ExternalGelIdSelect(dc, project)); 3574 3407 } 3575 3408 // … … 3585 3418 prideFilterSettingsFS.add(fdrF); 3586 3419 // 3587 TextField<String> forwardF = new ForwardField();3420 TextField<String> forwardF = new ForwardField(); 3588 3421 forwardF.setValue(actionFactory.getId(CreatePrideExportJob.class)); 3589 3422 prideFilterSettingsFS.add(forwardF); … … 4064 3897 fs.add(searchTypeSelectBox); 4065 3898 // Hidden text field for forward action id after file selection 4066 TextField<String> forwardF = new ForwardField();3899 TextField<String> forwardF = new ForwardField(); 4067 3900 forwardF.setValue(actionFactory 4068 3901 .getId(NewMascotParameterSetStorage.class)); … … 5181 5014 fs.add(searchSpectrumTypeSelectBox); 5182 5015 // Hidden text field for forward action id after file selection 5183 TextField<String> forwardF = new ForwardField();5016 TextField<String> forwardF = new ForwardField(); 5184 5017 forwardF.setValue(actionFactory 5185 5018 .getId(NewOMSSAParameterSetStorage.class)); … … 6183 6016 } 6184 6017 // Hidden text field for forward action id after file selection 6185 TextField<String> forwardF = new ForwardField();6018 TextField<String> forwardF = new ForwardField(); 6186 6019 forwardF.setValue(actionFactory 6187 6020 .getId(NewXTandemParameterSetStorage.class)); … … 8995 8828 * Add forward actionId field as first field, for external use. 8996 8829 */ 8997 TextField<String> fwdactionF = new ForwardField();8830 TextField<String> fwdactionF = new ForwardField(); 8998 8831 mainFS.add(fwdactionF); 8999 8832 /* … … 10036 9869 * selection action called by MoveFile1. 10037 9870 */ 10038 TextField<String> forwardF = new ForwardField();9871 TextField<String> forwardF = new ForwardField(); 10039 9872 forwardF.setValue(actionFactory.getId(MoveFile2.class)); 10040 9873 fs.add(forwardF);
Note: See TracChangeset
for help on using the changeset viewer.