source: trunk/www/views/experiments/plotter/index.jsp @ 3015

Last change on this file since 3015 was 3015, checked in by Nicklas Nordborg, 16 years ago

Fixes #405: Highlight function in plot tool

  • Property svn:eol-style set to native
  • Property svn:keywords set to Date Id
File size: 23.1 KB
Line 
1<%-- $Id: index.jsp 3015 2006-12-11 11:35:36Z nicklas $
2  ------------------------------------------------------------------
3  BioArray Software Environment (BASE) - http:// base.thep.lu.se/
4
5  This file is part of BASE - BioArray Software Environment.
6  Available at http://base.thep.lu.se/
7
8  BASE is free software; you can redistribute it and/or
9  modify it under the terms of the GNU General Public License
10  as published by the Free Software Foundation; either version 2
11  of the License, or (at your option) any later version.
12
13  BASE is distributed in the hope that it will be useful,
14  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16  GNU General Public License for more details.
17
18  You should have received a copy of the GNU General Public License
19  along with this program; if not, write to the Free Software
20  Foundation, Inc., 59 Temple Place - Suite 330,
21  Boston, MA  02111-1307, USA.
22  ------------------------------------------------------------------
23
24  @author Nicklas
25  @version 2.0
26--%>
27<%@ page session="false"
28  import="net.sf.basedb.core.SessionControl"
29  import="net.sf.basedb.core.DbControl"
30  import="net.sf.basedb.core.Experiment"
31  import="net.sf.basedb.core.BioAssaySet"
32  import="net.sf.basedb.core.BioAssay"
33  import="net.sf.basedb.core.RawDataType"
34  import="net.sf.basedb.core.RawDataProperty"
35  import="net.sf.basedb.core.Formula"
36  import="net.sf.basedb.core.AnnotationType"
37  import="net.sf.basedb.core.ItemQuery"
38  import="net.sf.basedb.core.ItemResultList"
39  import="net.sf.basedb.core.Include"
40  import="net.sf.basedb.core.Permission"
41  import="net.sf.basedb.core.Item"
42  import="net.sf.basedb.core.query.Orders"
43  import="net.sf.basedb.core.query.Hql"
44  import="net.sf.basedb.core.query.Restrictions"
45  import="net.sf.basedb.core.query.Restriction"
46  import="net.sf.basedb.core.query.Expressions"
47  import="net.sf.basedb.clients.web.Base"
48  import="net.sf.basedb.clients.web.DynamicUtil"
49  import="net.sf.basedb.clients.web.util.HTML"
50  import="net.sf.basedb.util.Values"
51  import="net.sf.basedb.clients.web.WebException"
52  import="net.sf.basedb.clients.web.taglib.table.TableColumn"
53  import="java.util.List"
54  import="java.util.LinkedList"
55%>
56<%@ taglib prefix="base" uri="/WEB-INF/base.tld" %>
57<%@ taglib prefix="t" uri="/WEB-INF/tab.tld" %>
58<%!
59private static void addFormulaOption(StringBuilder options, String formula, String title, String description)
60{
61  options.append("<option value=\"").append(HTML.encodeTags(formula)).append("\"");
62  options.append(" title=\"").append(HTML.encodeTags(description)).append("\"");
63  options.append(">").append(HTML.encodeTags(title)).append("\n");
64}
65
66%>
67<%
68final SessionControl sc = Base.getExistingSessionControl(pageContext, true);
69final float scale = Base.getScale(sc);
70final String ID = sc.getId();
71final DbControl dc = sc.newDbControl();
72try
73{
74  int bioAssaySetId = Values.getInt(request.getParameter("bioassayset_id"));
75  int bioAssayId = Values.getInt(request.getParameter("bioassay_id"));
76  BioAssay ba = bioAssayId == 0 ? null : BioAssay.getById(dc, bioAssayId);
77  BioAssaySet bas = ba == null ? BioAssaySet.getById(dc, bioAssaySetId) : ba.getBioAssaySet();
78  RawDataType rdt = bas.getRawDataType();
79  Experiment experiment = bas.getExperiment();
80  int maxRawMappings = bas.getMaxRawMappingsForSpot();
81 
82  List<TableColumn> formulas = new LinkedList<TableColumn>();
83  DynamicUtil.addSpotColumns(formulas, dc, rdt.getChannels());
84  DynamicUtil.addFormulaColumns(formulas, dc, rdt, Formula.Type.COLUMN_EXPRESSION, "", "", maxRawMappings == 1);
85  DynamicUtil.addExtraColumns(formulas, dc, bas, "ev", "#", "[Xtra] ");
86  if (maxRawMappings == 1)
87  {
88    DynamicUtil.addRawDataColumns(formulas, dc, rdt, "", "", "[Raw] ");
89  }
90 
91  StringBuilder formulaOptions = new StringBuilder();
92  for (TableColumn tc : formulas)
93  {
94    if (tc.getJepExpression() != null && tc.getDatatype().isNumerical())
95    {
96      String jepExpression = tc.getJepExpression();
97      addFormulaOption(formulaOptions, jepExpression, tc.getTitle(), tc.getDescription());
98    }
99  }
100 
101  StringBuilder filterOptions = new StringBuilder();
102  ItemQuery<Formula> formulaQuery = Formula.getQuery(Formula.Type.COLUMN_RESTRICTION, rdt);
103  formulaQuery.order(Orders.asc(Hql.property("name")));
104  formulaQuery.include(Include.MINE, Include.SHARED, Include.IN_PROJECT, Include.OTHERS);
105  for (Formula formula : formulaQuery.list(dc))
106  {
107    String f = formula.getFormulas().get(0);
108    if (maxRawMappings == 1 || !f.contains("raw("))
109    {
110      addFormulaOption(filterOptions, f, 
111        formula.getName(), formula.getDescription());
112    }
113  }
114 
115  // Annnotations -- experimental factors and bioassay annotations
116  final ItemQuery<AnnotationType> query = AnnotationType.getQuery(null);
117  query.join(Hql.leftJoin("experiments", Item.EXPERIMENT.getAlias()));
118  query.join(Hql.innerJoin("itemTypes", "itemType"));
119  Restriction ef = Restrictions.eq(
120    Hql.alias(Item.EXPERIMENT.getAlias()), 
121    Hql.entity(experiment)
122  );
123  Restriction baa = Restrictions.eq(
124    Hql.alias("itemType"),
125    Expressions.integer(Item.BIOASSAY.getValue())
126  );
127  query.restrict(Restrictions.or(ef, baa));
128  query.include(Include.MINE, Include.SHARED, Include.IN_PROJECT, Include.OTHERS);
129  query.order(Orders.asc(Hql.property("name")));
130  List<AnnotationType> experimentalFactors = query.list(dc);
131 
132  String title = HTML.encodeTags("Plot " + (ba == null ? bas.getName() : ba.getName()));
133 
134  final boolean hasCreateFilePermission = sc.hasPermission(Permission.CREATE, Item.FILE);
135 
136  %>
137  <base:page type="popup" title="<%=title%>">
138  <base:head styles="tabcontrol.css" scripts="tabcontrol.js">
139  <script language="JavaScript">
140
141  function validate()
142  {
143    var plotType = getPlotType();
144    if (plotType == 'scatter')
145    {
146      return validateScatterPlot();
147    }
148    else if (plotType == 'histogram')
149    {
150      return validateHistogramPlot();
151    }
152    return false;
153  }
154  function validateScatterPlot()
155  {
156    var frm = document.forms['scatter'];
157    if (Main.trimString(frm.yFormula.value) == '')
158    {
159      alert("You must enter an expression for the Y axis");
160      frm.yFormula.focus();
161      return false;
162    }
163    else if (Main.trimString(frm.xFormula.value) == '')
164    {
165      alert("You must enter an expression for the X axis");
166      frm.xFormula.focus();
167      return false;
168    }
169    return true;
170  }
171  function validateHistogramPlot()
172  {
173    var frm = document.forms['histogram'];
174    var yAggregate = Forms.getCheckedRadio(frm.yAggregate).value;
175    if (Main.trimString(frm.xFormula.value) == '')
176    {
177      alert("You must enter an expression for the X axis");
178      frm.xFormula.focus();
179      return false;
180    }
181    else if (yAggregate != 'count' && Main.trimString(frm.yFormula.value) == '')
182    {
183      alert("You must enter an expression for the Y axis");
184      frm.yFormula.focus();
185      return false;
186    }
187    return true;
188  }
189
190  var plotType = 'scatter';
191  function getPlotType()
192  {
193    return plotType;
194  }
195
196  function switchTab(tabControlId, tabId)
197  {
198    if (tabId == 'scatter' || tabId == 'histogram')
199    {
200      plotType = tabId;
201    }
202    TabControl.setActiveTab(tabControlId, tabId);
203  }
204
205  function presetOnChange(list, formula, label)
206  {
207    var index = list.selectedIndex;
208    formula.value = list[index].value;
209    if (label && list[index].value != '') label.value = list[index].text;
210    list.selectedIndex = 0;
211  }
212 
213  function aggregateOnChange()
214  {
215    var frm = document.forms['histogram'];
216    var selected = Forms.getCheckedRadio(frm.yAggregate);
217    var isCount = selected.value == 'count';
218    frm.yFormula.disabled = isCount;
219    frm.yPresets.disabled = isCount;
220    frm.yLog.disabled = isCount;
221    for (var i = 0; i < frm.hiloAggregate.length; i++)
222    {
223      frm.hiloAggregate[i].disabled = isCount;
224    }
225    if (isCount)
226    {
227      Main.removeClass(frm.yFormula, 'required');
228      frm.yLabel.value = 'Count';
229    }
230    else
231    {
232      Main.addClass(frm.yFormula, 'required');
233      var yPreset = frm.yPresets[frm.yPresets.selectedIndex];
234      if (yPreset.value != '') frm.yLabel.value = yPreset.text;
235    }
236  }
237 
238  function annotationOnChange(list)
239  {
240    var frm = document.forms['plot'];
241    var selected = list[list.selectedIndex];
242    var value = selected.value && selected.value != '$' ? selected.text : '';
243    value = value.replace('\[A\] ', '');
244    frm.subTitle.value = value;
245   
246    var annotationFrm = document.forms['annotation'];
247    if (selected.value.substring(0, 1) == '$')
248    {
249      annotationFrm.annotationExp.disabled = true;
250    }
251    else
252    {
253      if (selected.value)
254      {
255        annotationFrm.annotationExp.value = selected.value;
256      }
257      annotationFrm.annotationExp.disabled = false;
258      annotationFrm.annotationExp.focus();
259    }
260  }
261 
262  function annotationExpressionOnChange()
263  {
264    var annotationFrm = document.forms['annotation'];
265    annotationFrm.annotationPresets.selectedIndex = annotationFrm.annotationPresets.length-1;
266  }
267 
268  function generatePlotUrl(fullSize)
269  {
270    if (validate())
271    {
272      var plotFrm = document.forms['plot'];
273      var url = 'plot?ID=<%=ID%>&bioassayset_id=<%=bioAssaySetId%>&bioassay_id=<%=bioAssayId%>';
274      url += '&title='+Main.encodeURI(plotFrm.title.value);
275      url += '&subTitle='+Main.encodeURI(plotFrm.subTitle.value);
276      if (fullSize)
277      {
278        url += '&width='+plotFrm.width.value;
279        url += '&height='+plotFrm.height.value;
280      }
281     
282      var filterFrm = document.forms['filter'];
283      if (filterFrm.filter.value != '')
284      {
285        url += '&filter='+Main.encodeURI(filterFrm.filter.value);
286      }
287     
288      var annotationFrm = document.forms['annotation'];
289      var annotation = '';
290      if (!annotationFrm.annotationExp.disabled)
291      {
292        if (annotationFrm.annotationExp.value)
293        {
294          annotation = '=' + annotationFrm.annotationExp.value;
295        }
296      }
297      else
298      {
299        annotation = annotationFrm.annotationPresets[annotationFrm.annotationPresets.selectedIndex].value.substring(1);
300      }
301      if (annotation)
302      {
303        url += '&annotation='+Main.encodeURI(annotation);
304      }
305
306      var plotType = getPlotType();
307      if (plotType == 'scatter')
308      {
309        var frm = document.forms['scatter'];
310        url += '&type=scatter';
311        url += '&x='+Main.encodeURI(frm.xFormula.value);
312        url += '&xLog='+(frm.xLog.checked ? 1 : 0);
313        url += '&xLabel='+Main.encodeURI(frm.xLabel.value);
314        url += '&y='+Main.encodeURI(frm.yFormula.value);
315        url += '&yLog='+(frm.yLog.checked ? 1 : 0);
316        url += '&yLabel='+Main.encodeURI(frm.yLabel.value);
317      }
318      else
319      {
320        var frm = document.forms['histogram'];
321        var yAggregate = Forms.getCheckedRadio(frm.yAggregate).value;
322        url += '&type=histogram';
323        url += '&x='+Main.encodeURI(frm.xFormula.value);
324        url += '&xLog='+(frm.xLog.checked ? 1 : 0);
325        url += '&xLabel='+Main.encodeURI(frm.xLabel.value);
326        url += '&binSize='+Main.encodeURI(frm.binSize.value);
327        url += '&yAggregate='+yAggregate;
328        if (yAggregate != 'count')
329        {
330          url += '&y='+Main.encodeURI(frm.yFormula.value);
331          url += '&yLog='+(frm.yLog.checked ? 1 : 0);
332          url += '&hiloAggregate='+Forms.getCheckedRadio(frm.hiloAggregate).value
333        }
334        url += '&yLabel='+Main.encodeURI(frm.yLabel.value);
335      }
336      return url;
337    }
338  }
339 
340  function openExpressionBuilder(title, frmName, inputName, formulaType)
341  {
342    if (!document.forms[frmName][inputName].disabled)
343    {
344      var restrictions = formulaType == '<%=Formula.Type.COLUMN_RESTRICTION.name()%>';
345      Main.expressionBuilder('<%=ID%>', title, frmName, inputName, formulaType, '<%=rdt.getId()%>', <%=rdt.getChannels()%>, restrictions, <%=bas.getId()%>);
346    }
347  }
348 
349  function previewPlot()
350  {
351    var url = generatePlotUrl(false);
352    if (url)
353    {
354      url += '&width=600&height=400';
355      var image = document.getElementById('preview');
356      if (image.src.indexOf('plot_select') == -1)
357      {
358        var background = document.getElementById('background');
359        background.src = image.src;
360      }
361      image.src = getRoot()+'images/plot_generating.gif';
362      // Otherwise, the browser refuses to display the 'plot_generating.gif' while we are waiting.
363      setTimeout('changePreviewImage()', 100);
364    }
365  }
366 
367  function changePreviewImage()
368  {
369    var url = generatePlotUrl(false);
370    if (url)
371    {
372      document.getElementById('preview').src = url;
373    }
374  }
375 
376  function viewPlot()
377  {
378    var url = generatePlotUrl(true);
379    if (url)
380    {
381      var frm = document.forms['plot'];
382      var width = parseInt(frm.width.value);
383      var height = parseInt(frm.height.value);
384      if (!width || width < 600) width = 600;
385      if (!height || height < 400) height = 400;
386      Main.openPopup('view.jsp?ID=<%=ID%>&title='+Main.encodeURI(frm.title.value), 'ViewPlot', width+50, height+100);
387    }
388  }
389 
390  function downloadPlot()
391  {
392    var url = generatePlotUrl(true);
393    if (url)
394    {
395      Main.openPopup('download.jsp?ID=<%=ID%>', 'DownloadPlot', 500, 260);
396    }
397  }
398 
399  function savePlotAs()
400  {
401    var url = generatePlotUrl(true);
402    if (url)
403    {
404      Main.openPopup('save_as.jsp?ID=<%=ID%>', 'SavePlotAs', 500, 260);
405    }
406  }
407 
408  function init()
409  {
410    aggregateOnChange();
411  }
412  </script>
413  </base:head>
414  <base:body onload="init()">
415 
416  <h3 class="docked"><%=title%> <base:help tabcontrol="plotType" /></h3>
417  <div class="boxed">
418 
419  <table border="0" cellspacing="0" cellpadding="2" width="100%">
420  <tr valign="bottom">
421    <td>
422    <form name="plot">
423    <table class="form">
424    <tr>
425      <td class="prompt">Plot title</td>
426      <td colspan="2"><input type="text" class="text" size="30" maxlength="255" name="title" 
427        value="<%=HTML.encodeTags(ba == null ? bas.getName() : ba.getName())%>"></td>
428    </tr>
429    <tr>
430      <td class="prompt">Subtitle</td>
431      <td colspan="2"><input type="text" class="text" size="30" maxlength="255" name="subTitle" 
432        value=""></td>
433    </tr>
434    <tr>
435      <td class="prompt">Width</td>
436      <td><input type="text" class="text" size="12" maxlength="10" name="width" 
437        value="800" onkeypress="return Numbers.integerOnly(event)"></td>
438      <td rowspan="2" valign="center">(not used by preview)</td>
439    </tr>
440    <tr>
441      <td class="prompt">Height</td>
442      <td><input type="text" class="text" size="12" maxlength="10" name="height" 
443        value="600" onkeypress="return Numbers.integerOnly(event)"></td>
444    </tr>
445    </table>
446    </form>
447    <p>
448
449    <t:tabcontrol id="plotType" style="<%="width: "+(int)(scale*340)+"px;"%>" contentstyle="<%="height: "+(int)(scale*340)+"px;"%>"
450      switch="switchTab">
451    <t:tab id="scatter" title="Scatter plot" helpid="plotter.scatterplot"
452      tooltip="Create a scatter plot">
453      <form name="scatter">
454      <table border="0" cellspacing="0" cellpadding="2" class="form">
455      <tr>
456        <td class="prompt" colspan="3">Y-axis</td>
457      </tr>
458      <tr>
459        <td>&nbsp;Presets</td>
460        <td colspan="2">
461        <select name="yPresets" style="width: 20em;"
462          onchange="presetOnChange(this, this.form.yFormula, this.form.yLabel)" 
463          >
464          <option value="">- select from list or enter formula below -
465          <%=formulaOptions.toString()%>
466        </select>
467        </td>
468      </tr>
469      <tr>
470        <td>&nbsp;Expression</td>
471        <td><input type="text" class="text required" size="30" maxlength="255" name="yFormula"></td>
472        <td>
473          <base:button
474            title=""
475            image="expression_builder.gif"
476            tooltip="Use the Expression builder"
477            onclick="openExpressionBuilder('Y-axis expression', 'scatter', 'yFormula', 'COLUMN_EXPRESSION')"
478          />
479        </td>
480      </tr>
481      <tr>
482        <td>&nbsp;Label</td>
483        <td colspan="2"><input type="text" class="text" size="30" maxlength="255" name="yLabel"></td>
484      </tr>
485      <tr>
486        <td>&nbsp;Log scale</td>
487        <td colspan="2"><input type="checkbox" name="yLog" value="1"></td>
488      </tr>
489      <tr>
490        <td class="prompt" colspan="3">X-axis</td>
491      </tr>
492      <tr>
493        <td>Presets</td>
494        <td colspan="2">
495        <select name="xPresets" style="width: 20em;"
496          onchange="presetOnChange(this, this.form.xFormula, this.form.xLabel)" 
497          >
498          <option value="">- select from list or enter formula below -
499          <%=formulaOptions.toString()%>
500        </select>
501        </td>
502      </tr>
503      <tr>
504        <td>Expression</td>
505        <td><input type="text" class="text required" size="30" maxlength="255" name="xFormula"></td>
506        <td>
507          <base:button
508            title=""
509            image="expression_builder.gif"
510            tooltip="Use the Expression builder"
511            onclick="openExpressionBuilder('X-axis expression', 'scatter', 'xFormula', 'COLUMN_EXPRESSION')"
512          />
513        </td>
514      </tr>
515      <tr>
516        <td>Label</td>
517        <td colspan="2"><input type="text" class="text" size="30" maxlength="255" name="xLabel"></td>
518      </tr>
519      <tr>
520        <td>Log scale</td>
521        <td colspan="2"><input type="checkbox" name="xLog" value="1"></td>
522      </tr>
523      </table>
524      </form>
525    </t:tab>
526
527    <t:tab id="histogram" title="Histogram plot" helpid="plotter.histogram"
528      tooltip="Create a histogram plot">
529      <form name="histogram">
530      <table border="0" cellspacing="0" cellpadding="2" class="form">
531      <tr>
532        <td class="prompt" >Y-axis</td>
533        <td colspan="2">
534          <input type="radio" name="yAggregate" value="count" checked onchange="aggregateOnChange()"> Count
535          <input type="radio" name="yAggregate" value="mean" onchange="aggregateOnChange()"> Mean
536        </td>
537      </tr>
538      <tr>
539        <td>&nbsp;Hi-lo</td>
540        <td colspan="2">
541          <input type="radio" name="hiloAggregate" value="" checked> None
542          <input type="radio" name="hiloAggregate" value="hilomaxmin"> Min/Max
543          <input type="radio" name="hiloAggregate" value="hilostdev"> Stdev
544        </td>
545      </tr>
546      <tr>
547        <td>&nbsp;Presets</td>
548        <td colspan="2">
549        <select name="yPresets" style="width: 20em;"
550          onchange="presetOnChange(this, this.form.yFormula, this.form.yLabel)" 
551          disabled
552          >
553          <option value="">- select from list or enter formula below -
554          <%=formulaOptions.toString()%>
555        </select>
556        </td>
557      </tr>
558      <tr>
559        <td>&nbsp;Expression</td>
560        <td><input type="text" class="text" size="30" maxlength="255" name="yFormula" disabled></td>
561        <td>
562          <base:button
563            title=""
564            image="expression_builder.gif"
565            tooltip="Use the Expression builder"
566            onclick="openExpressionBuilder('Y-axis expression', 'histogram', 'yFormula', 'COLUMN_EXPRESSION')"
567          />
568        </td>
569      </tr>
570
571      <tr>
572        <td>&nbsp;Label</td>
573        <td colspan="2"><input type="text" class="text" size="30" maxlength="255" 
574          name="yLabel" value="Count"></td>
575      </tr>
576      <tr>
577        <td>&nbsp;Log scale</td>
578        <td colspan="2"><input type="checkbox" name="yLog" value="1"></td>
579      </tr>
580      <tr>
581        <td class="prompt" colspan="3">X-axis</td>
582      </tr>
583      <tr>
584        <td>Presets</td>
585        <td colspan="2">
586        <select name="xPresets"  style="width: 20em;"
587          onchange="presetOnChange(this, this.form.xFormula, this.form.xLabel)" 
588          >
589          <option value="">- select from list or enter formula below -
590          <%=formulaOptions.toString()%>
591        </select>
592        </td>
593      </tr>
594      <tr>
595        <td>Expression</td>
596        <td><input type="text" class="text required" size="30" 
597          maxlength="255" name="xFormula"></td>
598        <td>
599          <base:button
600            title=""
601            image="expression_builder.gif"
602            tooltip="Use the Expression builder"
603            onclick="openExpressionBuilder('X-axis expression', 'histogram', 'xFormula', 'COLUMN_EXPRESSION')"
604          />
605        </td>
606      </tr>
607      <tr>
608        <td>Label</td>
609        <td colspan="2"><input type="text" class="text" size="30" maxlength="255" name="xLabel"></td>
610      </tr>
611      <tr>
612        <td>Log scale</td>
613        <td colspan="2"><input type="checkbox" name="xLog" value="1"></td>
614      </tr>
615      <tr>
616        <td>Bin size</td>
617        <td colspan="2"><input type="text" class="text" name="binSize" value="1"></td>
618      </tr>
619      </table>
620      </form>
621    </t:tab>
622   
623    <t:tab id="filter" title="Filter" helpid="plotter.filter"
624      tooltip="Specify a filter for spots that should be included in the plot">
625      <form name="filter">
626      <table border="0" cellspacing="0" cellpadding="2" class="form">
627      <tr>
628        <td class="prompt" colspan="2">Filter</td>
629      </tr>
630      <tr>
631        <td>&nbsp;Presets</td>
632        <td colspan="2">
633        <select name="filterPresets" style="width: 20em;"
634          onchange="presetOnChange(this, this.form.filter, null)" 
635          >
636          <option value="">- select from list or enter formula below -
637          <%=filterOptions.toString()%>
638        </select>
639        </td>
640      </tr>
641      <tr>
642        <td>&nbsp;Expression</td>
643        <td><input type="text" class="text" size="30" maxlength="255" name="filter"></td>
644        <td>
645          <base:button
646            title=""
647            image="expression_builder.gif"
648            tooltip="Use the Expression builder"
649            onclick="openExpressionBuilder('Filter expression', 'filter', 'filter', 'COLUMN_RESTRICTION')"
650          />
651        </td>
652      </tr>
653      </table>
654      </form>
655    </t:tab>
656   
657    <t:tab id="annotation" title="Annotation" helpid="plotter.annotation"
658      tooltip="Specify a property or expression for sub-grouping the plotted values">
659      <form name="annotation">
660     
661      <table border="0" cellspacing="0" cellpadding="2" class="form">
662      <tr>
663        <td class="prompt" colspan="2">Annotation</td>
664      </tr>
665      <tr>
666        <td>&nbsp;Presets</td>
667        <td colspan="2">
668        <select name="annotationPresets" onchange="annotationOnChange(this)">
669          <option value="$">- none -
670          <%
671          if (ba == null)
672          {
673            %>
674            <option value="$bioassay">Bioassay
675            <option value="$spots">Spots
676            <option value="$arrayDesign.name">Array design
677            <option value="$software.name">Software
678            <option value="$protocol.name">Protocol
679            <option value="$scan.scanner.name">Scanner
680            <option value="$scan.protocol.name">Scanning protocol
681            <option value="$scan.hybridization.protocol.name">Hybridization protocol
682            <option value="$scan.hybridization.creationEvent.eventDate">Hybridization date
683            <option value="" disabled>- annotations -
684            <%
685            for (AnnotationType at : experimentalFactors)
686            {
687              %>
688              <option value="$<%=at.getId()%>">[A] <%=HTML.encodeTags(at.getName())%>
689              <%
690            }
691          }
692          %>
693          <option value="" disabled>- expressions -
694          <%=filterOptions.toString()%>
695          <option value="">Other...
696        </select>
697        </td>
698      </tr>
699      <tr>
700        <td>&nbsp;Expression</td>
701        <td><input type="text" class="text" size="30" maxlength="255" name="annotationExp"
702          onchange="annotationExpressionOnChange()" disabled></td>
703        <td>
704          <base:button
705            title=""
706            image="expression_builder.gif"
707            tooltip="Use the Expression builder"
708            onclick="openExpressionBuilder('Annotation filter', 'annotation', 'annotationExp', 'COLUMN_RESTRICTION')"
709          />
710        </td>
711      </tr>
712      </table>
713      </form>
714    </t:tab> 
715   
716    </t:tabcontrol>
717    </td>
718    <td xstyle="width: 600px;">
719      <div style="position: relative; top: 0px; left: 0px; width: 600px; height: 400px; padding-bottom: 2px;">
720      <img src="../../../images/plot_empty.png" id="background" 
721        style="position: absolute; top: 0px; left: 0px; z-index: 1; border: 1px solid #999999;">
722      <img src="../../../images/plot_select.gif" id="preview" 
723        style="position: relative; top: 0px; left: 0px; z-index: 2; border: 1px solid #999999;">
724      </div>
725    </td>
726  </tr>
727  </table>
728  </div>
729    <p>
730    <div align="center">
731    <base:buttongroup>
732      <base:button title="Preview" onclick="previewPlot()" 
733        image="plotter_preview.gif" tooltip="Generate a preview of the plot" 
734      />
735      <base:button title="View&hellip;" onclick="viewPlot()" 
736        image="plotter.gif" tooltip="View a fullsized version of the plot (in a popup)" 
737      />
738      <base:button title="Download&hellip;" onclick="downloadPlot()" 
739        image="download.gif"
740        tooltip="Downlad a fullsized version of the plot to you computer" 
741      />
742      <base:button title="Save as&hellip;" onclick="savePlotAs()" 
743        image="<%=hasCreateFilePermission ? "saveas.gif" : "saveas_disabled.gif"%>"
744        disabled="<%=!hasCreateFilePermission%>"
745        tooltip="<%=hasCreateFilePermission ? 
746          "Save a fullsized version of the plot on the BASE server" :
747          "You don't have permission to create files" %>" 
748      />
749      <base:button onclick="window.close()" title="Close" />
750    </base:buttongroup>
751    </div>
752 
753  </base:body>
754  </base:page>
755  <%
756}
757finally
758{
759  if (dc != null) dc.close();
760}
761%>
Note: See TracBrowser for help on using the repository browser.