[HepData-svn] r1410 - trunk/hepdata-webapp/src/main/java/cedar/hepdata/formats

blackhole at projects.hepforge.org blackhole at projects.hepforge.org
Thu Oct 14 16:40:38 BST 2010


Author: whalley
Date: Thu Oct 14 16:40:38 2010
New Revision: 1410

Log:
tweaking Jhepwork formatter

Modified:
   trunk/hepdata-webapp/src/main/java/cedar/hepdata/formats/JhepworkFormatter.java

Modified: trunk/hepdata-webapp/src/main/java/cedar/hepdata/formats/JhepworkFormatter.java
==============================================================================
--- trunk/hepdata-webapp/src/main/java/cedar/hepdata/formats/JhepworkFormatter.java	Thu Oct 14 14:00:14 2010	(r1409)
+++ trunk/hepdata-webapp/src/main/java/cedar/hepdata/formats/JhepworkFormatter.java	Thu Oct 14 16:40:38 2010	(r1410)
@@ -88,11 +88,23 @@
                 Bin b = x.getBin(r);
                 Point p = y.getPoint(r);
                 if (b != null && p != null) {
-                    Double xlow = b.getLowValue();
-                    Double xhigh = b.getHighValue();
-                    Double xfocus = b.getFocus();
-                    Double xup = xhigh - xfocus;
-                    Double xdn = xfocus - xlow;
+                    Double xfocus = null;
+                    Double xup = null;
+                    Double xdn = null;
+                    if(b.getRelation() == Relation.EQUALS){
+                         System.out.println(" " + b.getFocus() + " " + b.getHighValue() + " " + b.getLowValue()  + " " + b.getRelation());
+                         xfocus = b.getFocus();
+                         if(xfocus != null) {
+                             xup = b.getHighValue() - xfocus;
+                             xdn = xfocus - b.getLowValue(); 
+                         }                  
+                    }
+                    else if (b.getRelation() == Relation.GREATER || b.getRelation() == Relation.GREATEREQUALS){
+                        xdn = b.getLowValue();
+                    } 
+                    else if (b.getRelation() == Relation.LESS || b.getRelation() == Relation.LESSEQUALS){
+                        xup = b.getHighValue();
+                    } 
                     Double yval = p.getValue();
                     Double statdn = null;
                     Double statup = null;


More information about the HepData-svn mailing list