[Schmitzm-commits] r1071 - trunk/src/schmitzm/jfree/chart/style
scm-commit@wald.intevation.org
scm-commit at wald.intevation.org
Tue Oct 5 10:31:55 CEST 2010
Author: mojays
Date: 2010-10-05 10:31:46 +0200 (Tue, 05 Oct 2010)
New Revision: 1071
Modified:
trunk/src/schmitzm/jfree/chart/style/AbstractChartStyle.java
trunk/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: trunk/src/schmitzm/jfree/chart/style/AbstractChartStyle.java
===================================================================
--- trunk/src/schmitzm/jfree/chart/style/AbstractChartStyle.java 2010-10-05 08:09:10 UTC (rev 1070)
+++ trunk/src/schmitzm/jfree/chart/style/AbstractChartStyle.java 2010-10-05 08:31:46 UTC (rev 1071)
@@ -123,7 +123,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;
/** Holds the maximum index for which an axis is specified. */
@@ -430,7 +430,7 @@
*/
public void setRendererStyle(int dataset, ChartRendererStyle style) {
rendererStyle.put(dataset, style);
- maxRendererDatasetIdx = LangUtil.max( rendererStyle.keySet() );
+ maxRendererDatasetIdx = LangUtil.max( -1, rendererStyle.keySet() );
}
/**
Modified: trunk/src/schmitzm/jfree/chart/style/ChartStyleXMLFactory.java
===================================================================
--- trunk/src/schmitzm/jfree/chart/style/ChartStyleXMLFactory.java 2010-10-05 08:09:10 UTC (rev 1070)
+++ trunk/src/schmitzm/jfree/chart/style/ChartStyleXMLFactory.java 2010-10-05 08:31:46 UTC (rev 1071)
@@ -701,7 +701,7 @@
if ( rendererStyle != null ) {
// Margin attribute
- XMLUtil.setNotNullAttribute(element, "margin", rendererStyle.getMargin());
+ XMLUtil.setAttribute(rendererElem, "margin", rendererStyle.getMargin(),true);
// 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