[HepData-svn] r1534 - trunk/hepdata-webapp/src/main/java/cedar/hepdata/webapp/pages

blackhole at projects.hepforge.org blackhole at projects.hepforge.org
Tue May 1 09:53:27 BST 2012


Author: whalley
Date: Tue May  1 09:53:27 2012
New Revision: 1534

Log:
latest mods

Modified:
   trunk/hepdata-webapp/src/main/java/cedar/hepdata/webapp/pages/CombinedPlot.java
   trunk/hepdata-webapp/src/main/java/cedar/hepdata/webapp/pages/CombinedPlotAdvanced.java
   trunk/hepdata-webapp/src/main/java/cedar/hepdata/webapp/pages/DataSeries.java
   trunk/hepdata-webapp/src/main/java/cedar/hepdata/webapp/pages/View.java

Modified: trunk/hepdata-webapp/src/main/java/cedar/hepdata/webapp/pages/CombinedPlot.java
==============================================================================
--- trunk/hepdata-webapp/src/main/java/cedar/hepdata/webapp/pages/CombinedPlot.java	Tue Apr 24 15:44:07 2012	(r1533)
+++ trunk/hepdata-webapp/src/main/java/cedar/hepdata/webapp/pages/CombinedPlot.java	Tue May  1 09:53:27 2012	(r1534)
@@ -514,19 +514,28 @@
 	            yhigh = yhigh*factor;
 	            ylow = ylow*factor;
 	    
-	            double x;
+	            Double x = _xaxis.getBin(ip).getFocus();
+	            Double dxminus = x-_xaxis.getBin(ip).getLowValue();
+	            Double dxplus = _xaxis.getBin(ip).getHighValue()-x;
 	            double xhigh;
 	            double xlow;
-	            if(_xaxis.getBin(ip).getLowValue() != null  && _xaxis.getBin(ip).getHighValue() != null){
-	                x = (_xaxis.getBin(ip).getLowValue()+_xaxis.getBin(ip).getHighValue())/2;
-	                xlow =  _xaxis.getBin(ip).getLowValue();
-	                xhigh =  _xaxis.getBin(ip).getHighValue();
+                
+                if(x == null){
+	                if(_xaxis.getBin(ip).getLowValue() != null  && _xaxis.getBin(ip).getHighValue() != null){
+	                    x = (_xaxis.getBin(ip).getLowValue()+_xaxis.getBin(ip).getHighValue())/2;
+	                    xlow =  _xaxis.getBin(ip).getLowValue();
+	                    xhigh =  _xaxis.getBin(ip).getHighValue();
+                    }
+	                else{
+	                    x = _xaxis.getBin(ip).getFocus();
+	                    xhigh = _xaxis.getBin(ip).getFocus();
+	                    xlow = _xaxis.getBin(ip).getFocus();
+	                }
+                }
+                else{
+                	xhigh = x + dxplus;
+	                xlow  = x - dxminus;
                 }
-	            else{
-	                x = _xaxis.getBin(ip).getFocus();
-	                xhigh = _xaxis.getBin(ip).getFocus();
-	                xlow = _xaxis.getBin(ip).getFocus();
-	            }
 	            if(_xaxis.getHeader().endsWith("IN MEV")){
 	               x = x/1000.0;
 	               xhigh = xhigh/1000.0;

Modified: trunk/hepdata-webapp/src/main/java/cedar/hepdata/webapp/pages/CombinedPlotAdvanced.java
==============================================================================
--- trunk/hepdata-webapp/src/main/java/cedar/hepdata/webapp/pages/CombinedPlotAdvanced.java	Tue Apr 24 15:44:07 2012	(r1533)
+++ trunk/hepdata-webapp/src/main/java/cedar/hepdata/webapp/pages/CombinedPlotAdvanced.java	Tue May  1 09:53:27 2012	(r1534)
@@ -727,19 +727,28 @@
 	                ylow = ylow*factor;
                 }
 	    
-	            double x;
+	            Double x = _xaxis.getBin(ip).getFocus();
+	            Double dxminus = x-_xaxis.getBin(ip).getLowValue();
+	            Double dxplus = _xaxis.getBin(ip).getHighValue()-x;
 	            double xhigh;
 	            double xlow;
-	            if(_xaxis.getBin(ip).getLowValue() != null  && _xaxis.getBin(ip).getHighValue() != null){
-	                x = (_xaxis.getBin(ip).getLowValue()+_xaxis.getBin(ip).getHighValue())/2;
-	                xlow =  _xaxis.getBin(ip).getLowValue();
-	                xhigh =  _xaxis.getBin(ip).getHighValue();
+                
+                if(x == null){
+	                if(_xaxis.getBin(ip).getLowValue() != null  && _xaxis.getBin(ip).getHighValue() != null){
+	                    x = (_xaxis.getBin(ip).getLowValue()+_xaxis.getBin(ip).getHighValue())/2;
+	                    xlow =  _xaxis.getBin(ip).getLowValue();
+	                    xhigh =  _xaxis.getBin(ip).getHighValue();
+                    }
+	                else{
+	                    x = _xaxis.getBin(ip).getFocus();
+	                    xhigh = _xaxis.getBin(ip).getFocus();
+	                    xlow = _xaxis.getBin(ip).getFocus();
+	                }
+                }
+                else{
+                	xhigh = x + dxplus;
+	                xlow  = x - dxminus;
                 }
-	            else{
-	                x = _xaxis.getBin(ip).getFocus();
-	                xhigh = _xaxis.getBin(ip).getFocus();
-	                xlow = _xaxis.getBin(ip).getFocus();
-	            }
 	            if(_xaxis.getHeader().endsWith("IN MEV")){
 	               x = x/1000.0;
 	               xhigh = xhigh/1000.0;

Modified: trunk/hepdata-webapp/src/main/java/cedar/hepdata/webapp/pages/DataSeries.java
==============================================================================
--- trunk/hepdata-webapp/src/main/java/cedar/hepdata/webapp/pages/DataSeries.java	Tue Apr 24 15:44:07 2012	(r1533)
+++ trunk/hepdata-webapp/src/main/java/cedar/hepdata/webapp/pages/DataSeries.java	Tue May  1 09:53:27 2012	(r1534)
@@ -142,19 +142,28 @@
 	                ylow = ylow*factor;
                 }
 	    
-	            double x;
+	            Double x = _xaxis.getBin(ip).getFocus();
+	            Double dxminus = x-_xaxis.getBin(ip).getLowValue();
+	            Double dxplus = _xaxis.getBin(ip).getHighValue()-x;
 	            double xhigh;
 	            double xlow;
-	            if(_xaxis.getBin(ip).getLowValue() != null  && _xaxis.getBin(ip).getHighValue() != null){
-	                x = (_xaxis.getBin(ip).getLowValue()+_xaxis.getBin(ip).getHighValue())/2;
-	                xlow =  _xaxis.getBin(ip).getLowValue();
-	                xhigh =  _xaxis.getBin(ip).getHighValue();
+
+                if(x == null){
+	                if(_xaxis.getBin(ip).getLowValue() != null  && _xaxis.getBin(ip).getHighValue() != null){
+	                    x = (_xaxis.getBin(ip).getLowValue()+_xaxis.getBin(ip).getHighValue())/2;
+	                    xlow =  _xaxis.getBin(ip).getLowValue();
+	                    xhigh =  _xaxis.getBin(ip).getHighValue();
+                    }
+	                else{
+	                    x = _xaxis.getBin(ip).getFocus();
+	                    xhigh = _xaxis.getBin(ip).getFocus();
+	                    xlow = _xaxis.getBin(ip).getFocus();
+	                }
+                }
+                else{
+                	xhigh = x + dxplus;
+	                xlow  = x - dxminus;
                 }
-	            else{
-	                x = _xaxis.getBin(ip).getFocus();
-	                xhigh = _xaxis.getBin(ip).getFocus();
-	                xlow = _xaxis.getBin(ip).getFocus();
-	            }
 	            if(_xaxis.getHeader().endsWith("IN MEV")){
 	               x = x/1000.0;
 	               xhigh = xhigh/1000.0;

Modified: trunk/hepdata-webapp/src/main/java/cedar/hepdata/webapp/pages/View.java
==============================================================================
--- trunk/hepdata-webapp/src/main/java/cedar/hepdata/webapp/pages/View.java	Tue Apr 24 15:44:07 2012	(r1533)
+++ trunk/hepdata-webapp/src/main/java/cedar/hepdata/webapp/pages/View.java	Tue May  1 09:53:27 2012	(r1534)
@@ -299,6 +299,18 @@
         }
         return line;
     }
+    public String getShowExtraIRNLink1() {
+        String filename = "/home/whalley/resource/" + getPaper().getSpiresId() + "/link1";
+        File testfile = new File(filename);
+        String line = "";
+        if(testfile.exists()){
+            try {
+               BufferedReader in = new BufferedReader(new FileReader(filename));
+               line = in.readLine();
+               } catch (IOException e){}
+        }
+        return line;
+    }
     public String getShowExtraIRNDesc2() {
         String filename = "/home/whalley/resource/" + getPaper().getSpiresId() + "/description2";
         File testfile = new File(filename);
@@ -311,6 +323,18 @@
         }
         return line;
     }
+    public String getShowExtraIRNLink2() {
+        String filename = "/home/whalley/resource/" + getPaper().getSpiresId() + "/link2";
+        File testfile = new File(filename);
+        String line = "";
+        if(testfile.exists()){
+            try {
+               BufferedReader in = new BufferedReader(new FileReader(filename));
+               line = in.readLine();
+               } catch (IOException e){}
+        }
+        return line;
+    }
     public String getShowExtraREDDesc() {
         String filename = "/home/whalley/resource/" + getPaper().getRedId() + "/description";
         File testfile = new File(filename);
@@ -335,6 +359,18 @@
         }
         return line;
     }
+    public String getShowExtraREDLink1() {
+        String filename = "/home/whalley/resource/" + getPaper().getRedId() + "/link1";
+        File testfile = new File(filename);
+        String line = "";
+        if(testfile.exists()){
+            try {
+               BufferedReader in = new BufferedReader(new FileReader(filename));
+               line = in.readLine();
+               } catch (IOException e){}
+        }
+        return line;
+    }
     public String getShowExtraREDDesc2() {
         String filename = "/home/whalley/resource/" + getPaper().getRedId() + "/description2";
         File testfile = new File(filename);
@@ -347,5 +383,17 @@
         }
         return line;
     }
+    public String getShowExtraREDLink2() {
+        String filename = "/home/whalley/resource/" + getPaper().getRedId() + "/link2";
+        File testfile = new File(filename);
+        String line = "";
+        if(testfile.exists()){
+            try {
+               BufferedReader in = new BufferedReader(new FileReader(filename));
+               line = in.readLine();
+               } catch (IOException e){}
+        }
+        return line;
+    }
 
 }


More information about the HepData-svn mailing list