Changeset 3558
- Timestamp:
- Jul 16, 2007, 9:44:02 AM (16 years ago)
- Location:
- trunk
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/core/net/sf/basedb/core/Formula.java
r3556 r3558 487 487 is typically used to create a root bioassay set from raw data. 488 488 */ 489 INTENSITY_EXPRESSION(1, "Intensity expression", false )489 INTENSITY_EXPRESSION(1, "Intensity expression", false, false) 490 490 { 491 491 /** … … 519 519 bioassay set into a child bioassay set. 520 520 */ 521 INTENSITY_TRANSFORMATION(2, "Intensity transformation", false )521 INTENSITY_TRANSFORMATION(2, "Intensity transformation", false, false) 522 522 { 523 523 /** … … 561 561 The formula can also be used to calculate extra values for a bioassay set. 562 562 */ 563 COLUMN_EXPRESSION(3, "Column expression", true )563 COLUMN_EXPRESSION(3, "Column expression", true, true) 564 564 { 565 565 /** … … 584 584 to create a filtered bioassay set. 585 585 */ 586 COLUMN_RESTRICTION(4, "Column restriction", false )586 COLUMN_RESTRICTION(4, "Column restriction", false, false) 587 587 { 588 588 /** … … 631 631 private final String displayValue; 632 632 private final boolean canUseColoring; 633 634 private Type(int value, String displayValue, boolean canUseColoring) 633 private final boolean supportsAverage; 634 635 private Type(int value, String displayValue, boolean canUseColoring, boolean supportsAverage) 635 636 { 636 637 this.value = value; 637 638 this.displayValue = displayValue; 638 639 this.canUseColoring = canUseColoring; 640 this.supportsAverage = supportsAverage; 639 641 } 640 642 … … 661 663 { 662 664 return canUseColoring; 665 } 666 667 /** 668 If a formula of this type can be used in an average expression or not. 669 This is only possible for formulas which create one value. 670 @since 2.4 671 */ 672 public boolean supportsAverage() 673 { 674 return supportsAverage; 663 675 } 664 676 -
trunk/www/admin/extravaluetypes/edit_extravaluetype.jsp
r2978 r3558 34 34 import="net.sf.basedb.core.Permission" 35 35 import="net.sf.basedb.core.ExtraValueType" 36 import="net.sf.basedb.core.Formula" 36 37 import="net.sf.basedb.core.Coloring" 37 38 import="net.sf.basedb.core.PermissionDeniedException" … … 55 56 ExtraValueType extraValueType = null; 56 57 Coloring coloring = null; 58 Formula.AverageMethod currentAverageMethod = null; 57 59 58 60 if (itemId == 0) … … 60 62 title = "Create extra value type"; 61 63 cc.removeObject("item"); 64 currentAverageMethod = Formula.AverageMethod.fromValue(Values.getInt(cc.getPropertyValue("averageMethod"), 65 Formula.AverageMethod.ARITHMETIC_MEAN.getValue())); 62 66 coloring = new Coloring(); 63 67 coloring.setUsingColors(Values.getBoolean(cc.getPropertyValue("coloring.usingColors"))); … … 70 74 { 71 75 extraValueType = ExtraValueType.getById(dc, itemId); 76 currentAverageMethod = extraValueType.getAverageMethod(); 72 77 coloring = extraValueType.getColoring(); 73 78 cc.setObject("item", extraValueType); … … 199 204 200 205 <h3 class="docked"><%=title%> <base:help tabcontrol="settings" /></h3> 201 <t:tabcontrol id="settings" contentstyle="<%="height: "+(int)(scale*2 00)+"px;"%>"206 <t:tabcontrol id="settings" contentstyle="<%="height: "+(int)(scale*240)+"px;"%>" 202 207 position="bottom" remember="<%=extraValueType != null%>"> 203 208 <t:tab id="info" title="Extra value type" validate="validateExtraValueType()" … … 242 247 } 243 248 %> 249 </td> 250 </tr> 251 <tr> 252 <td class="prompt">Avg. method</td> 253 <td> 254 <select name="averageMethod" class="required"> 255 <% 256 for (Formula.AverageMethod method : Formula.AverageMethod.values()) 257 { 258 String selected = method == currentAverageMethod ? "selected" : ""; 259 %> 260 <option value="<%=method.name()%>" <%=selected%>><%=HTML.encodeTags(method.toString())%> 261 <% 262 } 263 %> 264 </select> 244 265 </td> 245 266 </tr> -
trunk/www/admin/extravaluetypes/index.jsp
r2978 r3558 32 32 import="net.sf.basedb.core.Include" 33 33 import="net.sf.basedb.core.ExtraValueType" 34 import="net.sf.basedb.core.Formula" 34 35 import="net.sf.basedb.core.Coloring" 35 36 import="net.sf.basedb.core.ItemQuery" … … 143 144 extraValueType.setDescription(Values.getStringOrNull(request.getParameter("description"))); 144 145 extraValueType.setExternalId(externalId); 146 extraValueType.setAverageMethod(Formula.AverageMethod.valueOf(request.getParameter("averageMethod"))); 145 147 Coloring coloring = extraValueType.getColoring(); 146 148 coloring.setUsingColors(Values.getBoolean(request.getParameter("use_colors"))); -
trunk/www/admin/extravaluetypes/list_extravaluetypes.jsp
r3190 r3558 31 31 import="net.sf.basedb.core.Item" 32 32 import="net.sf.basedb.core.ExtraValueType" 33 import="net.sf.basedb.core.Formula" 33 34 import="net.sf.basedb.core.ItemQuery" 34 35 import="net.sf.basedb.core.Include" … … 58 59 59 60 private static final Enumeration<String, String> valueTypes = new Enumeration<String, String>(); 61 private static final Enumeration<String, String> avgMethods = new Enumeration<String, String>(); 60 62 static 61 63 { … … 63 65 valueTypes.add(Integer.toString(Type.FLOAT.getValue()), Type.FLOAT.toString()); 64 66 valueTypes.add(Integer.toString(Type.STRING.getValue()), Type.STRING.toString()); 67 for (Formula.AverageMethod m : Formula.AverageMethod.values()) 68 { 69 avgMethods.add(Integer.toString(m.getValue()), HTML.encodeTags(m.toString())); 70 } 65 71 } 66 72 … … 213 219 title="Value type" 214 220 enumeration="<%=valueTypes%>" 221 sortable="true" 222 filterable="true" 223 exportable="true" 224 /> 225 <tbl:columndef 226 id="averageMethod" 227 property="averageMethod" 228 datatype="int" 229 enumeration="<%=avgMethods%>" 230 title="Avg. method" 215 231 sortable="true" 216 232 filterable="true" … … 414 430 <tbl:cell column="externalId"><%=HTML.encodeTags(item.getExternalId())%></tbl:cell> 415 431 <tbl:cell column="valueType"><%=item.getValueType()%></tbl:cell> 432 <tbl:cell column="averageMethod"><%=item.getAverageMethod().toString()%></tbl:cell> 416 433 <tbl:cell column="useColors"><%=item.getColoring().isUsingColors() ? "yes" : "no"%></tbl:cell> 417 434 <tbl:cell column="logarithmic"><%=item.getColoring().isLogarithmic() ? "yes" : "no"%></tbl:cell> -
trunk/www/admin/extravaluetypes/view_extravaluetype.jsp
r2978 r3558 182 182 </tr> 183 183 <tr> 184 <td class="prompt">Avg. method</td> 185 <td><%=extraValueType.getAverageMethod().toString()%></td> 186 </tr> 187 <tr> 184 188 <td class="prompt">Use coloring</td> 185 189 <td> -
trunk/www/include/scripts/main.js
r3518 r3558 366 366 this.controllers['TRANSFORMATION'] = { url:'views/experiments/transformations/index.jsp', width:500, height:300 }; 367 367 this.controllers['JOB'] = { url:'views/jobs/index.jsp', width:600, height:440, popup:true, edit:false }; 368 this.controllers['FORMULA'] = { url:'views/formulas/index.jsp', width:7 00, height:460 };368 this.controllers['FORMULA'] = { url:'views/formulas/index.jsp', width:740, height:500 }; 369 369 this.controllers['HYBRIDIZATION'] = { url:'views/hybridizations/index.jsp', width:800, height:500 }; 370 370 this.controllers['RAWBIOASSAY'] = { url:'views/rawbioassays/index.jsp', width:800, height:500 }; … … 421 421 this.controllers['USER'] = { url:'admin/users/index.jsp', width:600, height:440 }; 422 422 this.controllers['ANYTOANY'] = { url:'common/anytoany/index.jsp', width:500, height:340, popup:true }; 423 this.controllers['EXTRAVALUETYPE'] = { url:'admin/extravaluetypes/index.jsp', width:500, height:3 40 };423 this.controllers['EXTRAVALUETYPE'] = { url:'admin/extravaluetypes/index.jsp', width:500, height:360 }; 424 424 this.controllers['EXTRAVALUE'] = { url:'views/experiments/extravalues/index.jsp', width:500, height:340, edit:false }; 425 425 } -
trunk/www/views/formulas/edit_formula.jsp
r2978 r3558 60 60 Formula.Type currentType = null; 61 61 Formula.Parser currentParser = null; 62 Formula.AverageMethod currentAverageMethod = null; 62 63 RawDataType currentRawDataType = null; 63 64 RawDataType defaultRawDataType = null; … … 82 83 currentParser = Formula.Parser.fromValue(Values.getInt(cc.getPropertyValue("parser"), 83 84 Formula.Parser.JEP.getValue())); 85 currentAverageMethod = Formula.AverageMethod.fromValue(Values.getInt(cc.getPropertyValue("averageMethod"), 86 Formula.AverageMethod.ARITHMETIC_MEAN.getValue())); 84 87 currentRawDataType = RawDataTypes.getRawDataType(cc.getPropertyValue("rawDataType")); 85 88 if (currentRawDataType == null) … … 100 103 formula = Formula.getById(dc, itemId); 101 104 currentParser = formula.getParser(); 105 currentAverageMethod = formula.getAverageMethod(); 102 106 currentType = formula.getFormulaType(); 103 107 currentRawDataType = formula.getRawDataType(); … … 301 305 302 306 var useColors = new Array(); 307 var supportsAverage = new Array(); 303 308 <% 304 309 for (Formula.Type ft : Formula.Type.values()) … … 306 311 %> 307 312 useColors['<%=ft.name()%>'] = <%=ft.canUseColoring()%>; 313 supportsAverage['<%=ft.name()%>'] = <%=ft.supportsAverage()%>; 308 314 <% 309 315 } … … 339 345 frm.use_colors.disabled = !use; 340 346 useColorsOnClick(); 347 var supportsAvg = supportsAverage[formulaType]; 348 frm.averageMethod.disabled = !supportsAvg; 349 if (!supportsAvg) frm.averageMethod.selectedIndex = 0; 341 350 } 342 351 </script> … … 348 357 349 358 <h3 class="docked"><%=title%> <base:help tabcontrol="settings" /></h3> 350 <t:tabcontrol id="settings" contentstyle="<%="height: "+(int)(scale*3 40)+"px;"%>"359 <t:tabcontrol id="settings" contentstyle="<%="height: "+(int)(scale*380)+"px;"%>" 351 360 position="bottom" remember="<%=formula != null%>"> 352 361 <t:tab id="info" title="Formula" validate="validateFormula()" helpid="formula.edit"> … … 454 463 </td> 455 464 </tr> 465 <tr> 466 <td class="prompt">Avg. method</td> 467 <td> 468 <select name="averageMethod" class="required"> 469 <% 470 for (Formula.AverageMethod method : Formula.AverageMethod.values()) 471 { 472 String selected = method == currentAverageMethod ? "selected" : ""; 473 %> 474 <option value="<%=method.name()%>" <%=selected%>><%=HTML.encodeTags(method.toString())%> 475 <% 476 } 477 %> 478 </select> 479 </td> 480 </tr> 456 481 457 482 <tr> -
trunk/www/views/formulas/index.jsp
r2978 r3558 147 147 formula.setDescription(Values.getStringOrNull(request.getParameter("description"))); 148 148 formula.setParser(Formula.Parser.valueOf(request.getParameter("parser"))); 149 formula.setAverageMethod(Formula.AverageMethod.valueOf(request.getParameter("averageMethod"))); 149 150 Formula.Type formulaType = Formula.Type.valueOf(request.getParameter("type")); 150 151 formula.setFormulaType(formulaType); -
trunk/www/views/formulas/list_formulas.jsp
r3552 r3558 59 59 private static final Enumeration<String, String> types = new Enumeration<String, String>(); 60 60 private static final Enumeration<String, String> parsers = new Enumeration<String, String>(); 61 private static final Enumeration<String, String> avgMethods = new Enumeration<String, String>(); 61 62 private static final Enumeration<String, String> rawEnumeration = new Enumeration<String, String>(); 62 63 static … … 69 70 { 70 71 parsers.add(Integer.toString(p.getValue()), HTML.encodeTags(p.toString())); 72 } 73 for (Formula.AverageMethod m : Formula.AverageMethod.values()) 74 { 75 avgMethods.add(Integer.toString(m.getValue()), HTML.encodeTags(m.toString())); 71 76 } 72 77 for (RawDataType rdt : RawDataTypes.getRawDataTypes()) … … 245 250 enumeration="<%=parsers%>" 246 251 title="Parser" 252 sortable="true" 253 filterable="true" 254 exportable="true" 255 /> 256 <tbl:columndef 257 id="averageMethod" 258 property="averageMethod" 259 datatype="int" 260 enumeration="<%=avgMethods%>" 261 title="Avg. method" 247 262 sortable="true" 248 263 filterable="true" … … 511 526 <tbl:cell column="type"><%=item.getFormulaType().toString()%></tbl:cell> 512 527 <tbl:cell column="parser"><%=item.getParser().toString()%></tbl:cell> 528 <tbl:cell column="averageMethod"><%=item.getAverageMethod().toString()%></tbl:cell> 513 529 <tbl:cell column="rawDataType"><%=rawDataType == null ? "<i>- none -</i>" : HTML.encodeTags(rawDataType.getName())%></tbl:cell> 514 530 <tbl:cell column="channels"><%=item.getChannels()%></tbl:cell> -
trunk/www/views/formulas/view_formula.jsp
r3547 r3558 242 242 %> 243 243 </td> 244 </tr> 245 <tr> 246 <td class="prompt">Avg. method</td> 247 <td><%=formula.getAverageMethod().toString()%></td> 244 248 </tr> 245 249 <tr>
Note: See TracChangeset
for help on using the changeset viewer.