[Schmitzm-commits] r1072 - branches/2.2.x/src/schmitzm/jfree/chart/style
scm-commit@wald.intevation.org
scm-commit at wald.intevation.org
Tue Oct 5 10:32:08 CEST 2010
Author: mojays
Date: 2010-10-05 10:32:02 +0200 (Tue, 05 Oct 2010)
New Revision: 1072
Modified:
branches/2.2.x/src/schmitzm/jfree/chart/style/AbstractChartStyle.java
branches/2.2.x/src/schmitzm/jfree/chart/style/ChartStyleXMLFactory.java
Log:
BugFix in ChartStyleXMLFactory (Attribute "margin" was put in false XML-element)
BugFix in AbstractChartStyle (maxRendererDatasetIdx was 0 even if no renderer was set, so renderer count was 1 in this case!)
Modified: branches/2.2.x/src/schmitzm/jfree/chart/style/AbstractChartStyle.java
===================================================================
--- branches/2.2.x/src/schmitzm/jfree/chart/style/AbstractChartStyle.java 2010-10-05 08:31:46 UTC (rev 1071)
+++ branches/2.2.x/src/schmitzm/jfree/chart/style/AbstractChartStyle.java 2010-10-05 08:32:02 UTC (rev 1072)
@@ -120,7 +120,7 @@
/** Holds the styles for the chart renderers. */
protected Map<Integer,ChartRendererStyle> rendererStyle = new HashMap<Integer,ChartRendererStyle>();
/** Holds the maximum dataset index for which a renderer is specified. */
- protected int maxRendererDatasetIdx = 0;
+ protected int maxRendererDatasetIdx = -1;
/** Holds the style for the chart's plot. */
protected ChartPlotStyle plotStyle = null;
@@ -421,7 +421,7 @@
*/
public void setRendererStyle(int dataset, ChartRendererStyle style) {
rendererStyle.put(dataset, style);
- maxRendererDatasetIdx = LangUtil.max( rendererStyle.keySet() );
+ maxRendererDatasetIdx = LangUtil.max( -1, rendererStyle.keySet() );
}
/**
Modified: branches/2.2.x/src/schmitzm/jfree/chart/style/ChartStyleXMLFactory.java
===================================================================
--- branches/2.2.x/src/schmitzm/jfree/chart/style/ChartStyleXMLFactory.java 2010-10-05 08:31:46 UTC (rev 1071)
+++ branches/2.2.x/src/schmitzm/jfree/chart/style/ChartStyleXMLFactory.java 2010-10-05 08:32:02 UTC (rev 1072)
@@ -676,7 +676,7 @@
if ( rendererStyle != null ) {
// Margin attribute
- XMLUtil.setNotNullAttribute(element, "margin", rendererStyle.getMargin());
+ XMLUtil.setNotNullAttribute(rendererElem, "margin", rendererStyle.getMargin());
// Attributes for default series properties
XMLUtil.setNotNullAttribute(rendererElem, "paint", rendererStyle.getDefaultPaint());
XMLUtil.setNotNullAttribute(rendererElem, "lineWidth", rendererStyle.getDefaultLineWidth());
More information about the Schmitzm-commits
mailing list