[jboss-cvs] jboss-seam/src/pdf/org/jboss/seam/pdf/ui ...
Norman Richards
norman.richards at jboss.com
Tue Jul 24 17:29:08 EDT 2007
User: nrichards
Date: 07/07/24 17:29:08
Modified: src/pdf/org/jboss/seam/pdf/ui UICategoryChartBase.java
UIChartData.java
Log:
fix null bugs
Revision Changes Path
1.5 +15 -11 jboss-seam/src/pdf/org/jboss/seam/pdf/ui/UICategoryChartBase.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: UICategoryChartBase.java
===================================================================
RCS file: /cvsroot/jboss/jboss-seam/src/pdf/org/jboss/seam/pdf/ui/UICategoryChartBase.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -b -r1.4 -r1.5
--- UICategoryChartBase.java 4 Jul 2007 15:25:17 -0000 1.4
+++ UICategoryChartBase.java 24 Jul 2007 21:29:08 -0000 1.5
@@ -310,6 +310,7 @@
}
public void configureTitle(TextTitle chartTitle) {
+ if (chartTitle!=null) {
if (findColor(getTitleBackgroundPaint()) != null) {
chartTitle.setBackgroundPaint(findColor(getTitleBackgroundPaint()));
}
@@ -318,8 +319,10 @@
chartTitle.setPaint(findColor(getTitlePaint()));
}
}
+ }
void configureLegend(LegendTitle chartLegend) {
+ if (chartLegend!=null) {
if (findColor(getLegendBackgroundPaint())!=null) {
chartLegend.setBackgroundPaint(findColor(getLegendBackgroundPaint()));
}
@@ -327,5 +330,6 @@
chartLegend.setItemPaint(findColor(getLegendItemPaint()));
}
}
+ }
}
1.8 +14 -28 jboss-seam/src/pdf/org/jboss/seam/pdf/ui/UIChartData.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: UIChartData.java
===================================================================
RCS file: /cvsroot/jboss/jboss-seam/src/pdf/org/jboss/seam/pdf/ui/UIChartData.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -b -r1.7 -r1.8
--- UIChartData.java 4 Jul 2007 15:25:17 -0000 1.7
+++ UIChartData.java 24 Jul 2007 21:29:08 -0000 1.8
@@ -14,8 +14,7 @@
extends ITextComponent
{
private String key;
- private String columnKey;
- private String rowKey;
+ private String series;
private Object value;
private Float explodedPercent;
@@ -42,20 +41,18 @@
}
}
- public String getColumnKey() {
- return (String) valueBinding("columnKey", columnKey);
- }
-
-
-
public String getKey() {
return (String) valueBinding("key", key);
}
+ public void setKey(String key) {
+ this.key = key;
+ }
- public String getRowKey() {
- String value = (String) valueBinding("rowkey", rowKey);
+
+ public String getSeries() {
+ String value = (String) valueBinding("series", series);
if (value == null) {
UIChartSeries series = (UIChartSeries) findITextParent(this, UIChartSeries.class);
value = series.getKey();
@@ -63,21 +60,10 @@
return value;
}
-
-
- public void setKey(String key) {
- this.key = key;
- }
-
-
-
- public void setRowKey(String rowKey) {
- this.rowKey = rowKey;
+ public void setSeries(String series) {
+ this.series = series;
}
- public void setColumnKey(String columnKey) {
- this.columnKey = columnKey;
- }
public void setValue(Double value) {
this.value = value;
@@ -124,8 +110,8 @@
super.restoreState(context, values[0]);
key = (String) values[1];
- columnKey = (String) values[2];
- rowKey = (String) values[3];
+ //columnKey = (String) values[2];
+ series = (String) values[3];
value = (Number) values[4];
explodedPercent = (Float) values[5];
sectionPaint = (String) values[6];
@@ -140,8 +126,8 @@
values[0] = super.saveState(context);
values[1] = key;
- values[2] = columnKey;
- values[3] = rowKey;
+ //values[2] = columnKey;
+ values[3] = series;
values[4] = value;
values[5] = explodedPercent;
values[6] = sectionPaint;
@@ -187,7 +173,7 @@
DefaultCategoryDataset data = (DefaultCategoryDataset) dataset;
//CategoryPlot plot = (CategoryPlot) chart.getChart().getPlot();
- data.addValue(getNumericValue(), getRowKey(), getColumnKey());
+ data.addValue(getNumericValue(), getSeries(), getKey());
} else {
throw new RuntimeException("Cannot add data to dataset of type " + dataset.getClass());
}
More information about the jboss-cvs-commits
mailing list