[jboss-cvs] jboss-seam/src/pdf/org/jboss/seam/pdf/ui ...
Norman Richards
norman.richards at jboss.com
Mon Jul 2 01:09:51 EDT 2007
User: nrichards
Date: 07/07/02 01:09:50
Modified: src/pdf/org/jboss/seam/pdf/ui UIBarChart.java
Log:
a few more options
Revision Changes Path
1.12 +37 -3 jboss-seam/src/pdf/org/jboss/seam/pdf/ui/UIBarChart.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: UIBarChart.java
===================================================================
RCS file: /cvsroot/jboss/jboss-seam/src/pdf/org/jboss/seam/pdf/ui/UIBarChart.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -b -r1.11 -r1.12
--- UIBarChart.java 1 Jul 2007 23:19:36 -0000 1.11
+++ UIBarChart.java 2 Jul 2007 05:09:50 -0000 1.12
@@ -6,6 +6,7 @@
import org.jfree.chart.JFreeChart;
import org.jfree.chart.renderer.category.BarRenderer;
import org.jfree.chart.renderer.category.CategoryItemRenderer;
+import org.jfree.chart.title.LegendTitle;
import org.jfree.chart.title.TextTitle;
import org.jfree.data.category.CategoryDataset;
import org.jfree.data.category.DefaultCategoryDataset;
@@ -28,6 +29,10 @@
private String titleBackgroundPaint;
private String titlePaint;
+ private String legendBackgroundPaint;
+
+ private String legendItemPaint;
+
public void setTitle(String title) {
this.title = title;
}
@@ -92,6 +97,22 @@
return (String) valueBinding("titlePaint", titlePaint);
}
+ public String getLegendBackgroundPaint() {
+ return legendBackgroundPaint;
+ }
+
+ public void setLegendBackgroundPaint(String legendBackgroundPaint) {
+ this.legendBackgroundPaint = legendBackgroundPaint;
+ }
+
+ public String getLegendItemPaint() {
+ return legendItemPaint;
+ }
+
+ public void setLegendItemPaint(String legendItemPaint) {
+ this.legendItemPaint = legendItemPaint;
+ }
+
@Override
public void restoreState(FacesContext context, Object state)
{
@@ -176,11 +197,24 @@
}
- TextTitle t = chart.getTitle();
- t.setBackgroundPaint(findColor(getTitleBackgroundPaint()));
- t.setPaint(findColor(getTitlePaint()));
+ TextTitle chartTitle = chart.getTitle();
+
+ if (findColor(getTitleBackgroundPaint()) != null) {
+ chartTitle.setBackgroundPaint(findColor(getTitleBackgroundPaint()));
+ }
+
+ if (findColor(getTitlePaint()) != null) {
+ chartTitle.setPaint(findColor(getTitlePaint()));
+ }
// t.setFont(titleFont);
+ LegendTitle chartLegend = chart.getLegend();
+ if (findColor(getLegendBackgroundPaint())!=null) {
+ chartLegend.setBackgroundPaint(findColor(getLegendBackgroundPaint()));
+ }
+ if (findColor(getLegendItemPaint())!= null) {
+ chartLegend.setItemPaint(findColor(getLegendItemPaint()));
+ }
return chart;
}
More information about the jboss-cvs-commits
mailing list