[HepData-svn] r1451 - trunk/hepdata-webapp/src/main/java/cedar/hepdata/webapp/components

blackhole at projects.hepforge.org blackhole at projects.hepforge.org
Mon Apr 4 15:02:36 BST 2011


Author: whalley
Date: Mon Apr  4 15:02:36 2011
New Revision: 1451

Log:
better positioning of units in axis comments

Modified:
   trunk/hepdata-webapp/src/main/java/cedar/hepdata/webapp/components/DatasetAsHtml.java

Modified: trunk/hepdata-webapp/src/main/java/cedar/hepdata/webapp/components/DatasetAsHtml.java
==============================================================================
--- trunk/hepdata-webapp/src/main/java/cedar/hepdata/webapp/components/DatasetAsHtml.java	Wed Mar 30 15:37:00 2011	(r1450)
+++ trunk/hepdata-webapp/src/main/java/cedar/hepdata/webapp/components/DatasetAsHtml.java	Mon Apr  4 15:02:36 2011	(r1451)
@@ -70,7 +70,18 @@
             int j=-1;
             List <String> storelist = new ArrayList();
             // first add the comment elements (strings)
-            for (String comment : y.getComments()){storelist.add(comment);}
+            for (String comment : y.getComments()){
+                if(comment.indexOf(" IN ") > 0){
+                    int len = comment.length();
+                    int ip1 = comment.indexOf(" IN ");
+                    int ip2 = comment.indexOf(" : ");
+                    String comment2 = comment.substring(0,ip1);
+                    comment2 += comment.substring(ip2,len);
+                    comment2 += comment.substring(ip1+3,ip2).replace("EV","eV");
+                    comment = comment2;
+                }
+                storelist.add(comment);
+            }
             for (Property property : y.getProperties()) {
                 j++;
                 String tempstr = property.getName().toString();


More information about the HepData-svn mailing list