[HepData-svn] r1772 - in trunk/hepdata-webapp: . src/main/java/cedar/hepdata/formats

blackhole at projects.hepforge.org blackhole at projects.hepforge.org
Wed Mar 26 16:17:11 GMT 2014


Author: watt
Date: Wed Mar 26 16:17:11 2014
New Revision: 1772

Log:
Reinstating formatting in InputFormatter with correction for negative y values

Modified:
   trunk/hepdata-webapp/pom.xml
   trunk/hepdata-webapp/src/main/java/cedar/hepdata/formats/InputFormatter.java

Modified: trunk/hepdata-webapp/pom.xml
==============================================================================
--- trunk/hepdata-webapp/pom.xml	Wed Mar 26 15:53:38 2014	(r1771)
+++ trunk/hepdata-webapp/pom.xml	Wed Mar 26 16:17:11 2014	(r1772)
@@ -40,7 +40,8 @@
         <!-- Jetty7: unstable -->
         <!-- <artifactId>jetty-maven-plugin</artifactId> -->
         <configuration>
-          <contextPath>/h8test</contextPath>
+          <!-- <contextPath>/h8test</contextPath> -->
+	  <contextPath>/h2test</contextPath>
           <!-- <scanIntervalSeconds>10</scanIntervalSeconds> -->
           <requestLog implementation="org.mortbay.jetty.NCSARequestLog">
             <append>true</append>

Modified: trunk/hepdata-webapp/src/main/java/cedar/hepdata/formats/InputFormatter.java
==============================================================================
--- trunk/hepdata-webapp/src/main/java/cedar/hepdata/formats/InputFormatter.java	Wed Mar 26 15:53:38 2014	(r1771)
+++ trunk/hepdata-webapp/src/main/java/cedar/hepdata/formats/InputFormatter.java	Wed Mar 26 16:17:11 2014	(r1772)
@@ -245,23 +245,22 @@
 				s.append(" " + f_desc);
 			    }
 			    else {
-				// G.W. 26/03/2014 Keep formatting switched off for the moment.
-				// if(yax.getPoint(i+1).getValueLength() != null) {
-				//     int lsd = yax.getPoint(i+1).getValueLength();
-				//     int msd = 0;
-				//     if(lsd > 0){
-				// 	msd = f_val.indexOf(".");
-				//     }  else{
-				// 	msd = f_val.length() - 2;
-				//     }
-				//     if (
-				//     f_val = Formats.forms(yax.getPoint(i+1).getValue(),msd,lsd);
-				// }
-				// if(f_val.contains("E-")){
-				//     int lsd = Integer.parseInt(f_val.substring(f_val.indexOf("E")+2));
-				//     int ldiff = f_val.length() + lsd;
-				//     f_val = Formats.forms(yax.getPoint(i+1).getValue(),1,ldiff-5);
-				// }
+				if(yax.getPoint(i+1).getValueLength() != null) {
+				    int lsd = yax.getPoint(i+1).getValueLength();
+				    int msd = 0;
+				    if(lsd > 0){
+					msd = f_val.indexOf(".");
+				    }  else{
+					msd = f_val.length() - 2;
+				    }
+				    if (yax.getPoint(i+1).getValue() < 0) { msd -= 1; }
+				    f_val = Formats.forms(yax.getPoint(i+1).getValue(),msd,lsd);
+				}
+				if(f_val.contains("E-")){
+				    int lsd = Integer.parseInt(f_val.substring(f_val.indexOf("E")+2));
+				    int ldiff = f_val.length() + lsd;
+				    f_val = Formats.forms(yax.getPoint(i+1).getValue(),1,ldiff-5);
+				}
 				s.append(" " + f_val);
 				// s.append(" " + yax.getPoint(i+1).getValue());
 			    }


More information about the HepData-svn mailing list