Changeset 3543


Ignore:
Timestamp:
Oct 14, 2015, 2:11:57 PM (7 years ago)
Author:
Nicklas Nordborg
Message:

References #812: Pilot report wizard

Minor adjusments to text positions.

A new version of the R script has "class" name in the pam50.txt file that doesn't match any of the headers, so we need to check which score that is the highest to be able to print it in bold.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/pdf/PilotReportWorker.java

    r3542 r3543  
    9090  private static final float PLOT_START_Y = 474.5f;
    9191  // Distance between plots
    92   private static final float PLOT_DELTA_Y = 89.5f;
     92  private static final float PLOT_DELTA_Y = 89.3f;
    9393  // Size of plots
    9494  private static final float PLOT_WIDTH = 160;
     
    9696  // Text releated to plot
    9797  private static final float PLOT_TEXT_X = 214;
    98   private static final float PLOT_TEXT_START_Y = 510;
     98  private static final float PLOT_TEXT_START_Y = 509.5f;
    9999 
    100100  private PilotReport script;
     
    200200      String subtypeClass = parsePam50(new File(workDir, "PAM50.txt"), subtypeNames, subtypeScores);
    201201      pdfUtil.addText(subtypeClass, 14, Element.ALIGN_LEFT, SUBTYPE_X1, SUBTYPE_Y1);
     202      // Find max score
     203      float maxScore = subtypeScores[0];
     204      for (int scoreNo = 1; scoreNo < subtypeScores.length; scoreNo++)
     205      {
     206        if (subtypeScores[scoreNo] > maxScore) maxScore = subtypeScores[scoreNo];
     207      }
     208      // Print scores
    202209      for (int scoreNo = 0; scoreNo < subtypeScores.length; scoreNo++)
    203210      {
    204         if (subtypeClass.equals(subtypeNames[scoreNo]))
     211        if (Float.compare(subtypeScores[scoreNo], maxScore) == 0)
    205212        {
    206213          pdfUtil.addBoldText(twoDecimals.format(subtypeScores[scoreNo]), 12, Element.ALIGN_LEFT, SUBTYPE_X2+scoreNo*SUBTYPE_XX, SUBTYPE_Y2);
Note: See TracChangeset for help on using the changeset viewer.