[Schmitzm-commits] r1204 - branches/2.2.x/src/schmitzm/jfree/chart/style

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Wed Nov 3 00:09:37 CET 2010


Author: mojays
Date: 2010-11-03 00:09:36 +0100 (Wed, 03 Nov 2010)
New Revision: 1204

Modified:
   branches/2.2.x/src/schmitzm/jfree/chart/style/ChartStyleXMLFactory.java
Log:
ChartStyleXMLFactory BugFix: scatter chart properties were not read correctly from XML

Modified: branches/2.2.x/src/schmitzm/jfree/chart/style/ChartStyleXMLFactory.java
===================================================================
--- branches/2.2.x/src/schmitzm/jfree/chart/style/ChartStyleXMLFactory.java	2010-11-02 22:53:55 UTC (rev 1203)
+++ branches/2.2.x/src/schmitzm/jfree/chart/style/ChartStyleXMLFactory.java	2010-11-02 23:09:36 UTC (rev 1204)
@@ -167,6 +167,8 @@
     // apply type specific properties
     if ( chartStyle instanceof BasicChartStyle )
       applyStyleFromXML((BasicChartStyle)chartStyle, element);
+    if ( chartStyle instanceof ScatterChartStyle )
+      applyStyleFromXML((ScatterChartStyle)chartStyle, element);
       
   }
   
@@ -188,6 +190,23 @@
   }
   
   /**
+   * Applies the {@link ScatterChartStyle} properties from XML (<b>not the
+   * {@link ChartStyle} properties!)</b>) to an existing
+   * {@link ScatterChartStyle} object.
+   * 
+   * @param chartStyle
+   *            an existing chart style ({@code null} not permitted!)
+   * @param element
+   *            element to read the properties from
+   */
+  private void applyStyleFromXML(ScatterChartStyle chartStyle, Element element) {
+      // visibility of regression line
+      Boolean regrLineVisible = XMLUtil.getBooleanAttribute(element, "regrLineVisible");
+      if (regrLineVisible != null)
+          chartStyle.setRegressionLineVisible(regrLineVisible);
+  }
+
+  /**
    * Reads the {@link ChartLabelStyle} properties from an XML element.
    * <ul>
    *   <li>Attribute "paint": color of the label</li>



More information about the Schmitzm-commits mailing list