[seam-commits] Seam SVN: r10093 - trunk/src/pdf/org/jboss/seam/pdf/ui.

seam-commits at lists.jboss.org seam-commits at lists.jboss.org
Thu Feb 26 14:14:39 EST 2009


Author: norman.richards at jboss.com
Date: 2009-02-26 14:14:39 -0500 (Thu, 26 Feb 2009)
New Revision: 10093

Modified:
   trunk/src/pdf/org/jboss/seam/pdf/ui/UITimeSeriesChart.java
Log:
JBSEAM-3750

Modified: trunk/src/pdf/org/jboss/seam/pdf/ui/UITimeSeriesChart.java
===================================================================
--- trunk/src/pdf/org/jboss/seam/pdf/ui/UITimeSeriesChart.java	2009-02-25 22:03:49 UTC (rev 10092)
+++ trunk/src/pdf/org/jboss/seam/pdf/ui/UITimeSeriesChart.java	2009-02-26 19:14:39 UTC (rev 10093)
@@ -4,6 +4,8 @@
 
 import org.jfree.chart.ChartFactory;
 import org.jfree.chart.JFreeChart;
+import org.jfree.chart.plot.Plot;
+import org.jfree.chart.plot.XYPlot;
 import org.jfree.data.general.Dataset;
 import org.jfree.data.xy.DefaultXYDataset;
 import org.jfree.data.xy.XYDataset;
@@ -12,7 +14,6 @@
     extends UIChart 
 {
     private String domainAxisLabel;
-    private String domainLabelPosition;
     private String domainAxisPaint;
     private Boolean domainGridlinesVisible;
     private String domainGridlinePaint;
@@ -39,14 +40,6 @@
     public void setRangeAxisLabel(String valueAxisLabel) {
         this.rangeAxisLabel = valueAxisLabel;
     }
-
-    public String getDomainLabelPosition() {
-        return (String) valueBinding("domainLabelPosition", domainLabelPosition);
-    }
-
-    public void setDomainLabelPosition(String domainLabelPosition) {
-        this.domainLabelPosition = domainLabelPosition;
-    }
     
     public String getDomainGridlinePaint() {
         return (String) valueBinding("domainGridlinePaint", domainGridlinePaint);
@@ -114,6 +107,7 @@
     public void setRangeAxisPaint(String rangeAxisPaint) {
         this.rangeAxisPaint = rangeAxisPaint;
     }
+
     
     @Override
     public void restoreState(FacesContext context, Object state) {
@@ -139,7 +133,7 @@
         rangeGridlinesVisible = (Boolean) values[17];
         rangeGridlinePaint = (String) values[18];
         rangeGridlineStroke = (String) values[19];
-        domainLabelPosition = (String) values[20];
+        //domainLabelPosition = (String) values[20];
     }
 
     @Override
@@ -165,7 +159,7 @@
         values[17] = rangeGridlinesVisible;
         values[18] = rangeGridlinePaint;
         values[19] = rangeGridlineStroke;
-        values[20] = domainLabelPosition;
+        //values[20] = domainLabelPosition;
 
         return values;
     }
@@ -177,9 +171,53 @@
                   getRangeAxisLabel(), 
                   (XYDataset) getDataset(), 
                   true, false, false);
-       
     }
 
+   @Override
+    public void configurePlot(Plot plot) {
+        super.configurePlot(plot);
+        
+        if (plot instanceof XYPlot) {
+            configureXYPlot((XYPlot) plot);
+        }  
+   }
+   
+   public void configureXYPlot(XYPlot plot) {
+
+        if (getDomainGridlinesVisible() != null) {
+            plot.setDomainGridlinesVisible(getDomainGridlinesVisible());
+        }
+
+        if (findColor(getDomainGridlinePaint()) != null) {
+            plot.setDomainGridlinePaint(findColor(getDomainGridlinePaint()));
+        }
+        
+        if (findStroke(getDomainGridlineStroke()) != null) {
+            plot.setDomainGridlineStroke(findStroke(getDomainGridlineStroke()));
+        }
+        
+        if (findColor(getDomainAxisPaint()) != null) {
+            plot.getDomainAxis().setLabelPaint(findColor(getDomainAxisPaint()));
+        }
+
+        if (getRangeGridlinesVisible() != null) {
+            plot.setRangeGridlinesVisible(getRangeGridlinesVisible());
+        }
+        
+        if (findColor(getRangeGridlinePaint()) != null) {
+            plot.setRangeGridlinePaint(findColor(getRangeGridlinePaint()));
+        }
+        
+        if (findStroke(getRangeGridlineStroke()) != null) {
+            plot.setRangeGridlineStroke(findStroke(getRangeGridlineStroke()));
+        }
+        
+        if (findColor(getRangeAxisPaint()) != null) {
+            plot.getRangeAxis().setLabelPaint(findColor(getRangeAxisPaint()));
+        }
+    } 
+   
+    
     @Override
     public Dataset createDataset() {
         return new DefaultXYDataset();




More information about the seam-commits mailing list