[Schmitzm-commits] r192 - trunk/src/schmitzm/jfree/chart/style
scm-commit@wald.intevation.org
scm-commit at wald.intevation.org
Fri Jul 3 18:28:15 CEST 2009
Author: mojays
Date: 2009-07-03 18:28:15 +0200 (Fri, 03 Jul 2009)
New Revision: 192
Modified:
trunk/src/schmitzm/jfree/chart/style/AbstractChartStyle.java
trunk/src/schmitzm/jfree/chart/style/ChartStyle.java
trunk/src/schmitzm/jfree/chart/style/ChartStyleXMLFactory.java
Log:
"description" property for ChartStyle
Modified: trunk/src/schmitzm/jfree/chart/style/AbstractChartStyle.java
===================================================================
--- trunk/src/schmitzm/jfree/chart/style/AbstractChartStyle.java 2009-07-03 16:18:56 UTC (rev 191)
+++ trunk/src/schmitzm/jfree/chart/style/AbstractChartStyle.java 2009-07-03 16:28:15 UTC (rev 192)
@@ -65,6 +65,8 @@
protected ChartType type = null;
/** Holds the chart title. */
protected ChartLabelStyle titleStyle = new ChartLabelStyle();
+ /** Holds a long description for the chart. */
+ protected ChartLabelStyle descStyle = null;
/** Holds the background color for the chart. */
protected Paint bgPaint = null;
/** Stores whether a border is shown around the whole chart. */
@@ -185,6 +187,21 @@
}
/**
+ * Returns the style of the long chart description.
+ */
+ public ChartLabelStyle getDescStyle() {
+ return descStyle;
+ }
+
+ /**
+ * Sets the long description for the chart.
+ * @param descStyle the new chart description style
+ */
+ public void setDescStyle(ChartLabelStyle descStyle) {
+ this.descStyle = descStyle;
+ }
+
+ /**
* Returns the background color of the chart.
*/
public Paint getBackground() {
Modified: trunk/src/schmitzm/jfree/chart/style/ChartStyle.java
===================================================================
--- trunk/src/schmitzm/jfree/chart/style/ChartStyle.java 2009-07-03 16:18:56 UTC (rev 191)
+++ trunk/src/schmitzm/jfree/chart/style/ChartStyle.java 2009-07-03 16:28:15 UTC (rev 192)
@@ -83,7 +83,8 @@
public void setOrientation(PlotOrientation orientation);
/**
- * Returns the style of the chart title.
+ * Returns the style of the chart title. <b>Should never return
+ * {@code null}!!</b>
*/
public ChartLabelStyle getTitleStyle();
@@ -94,6 +95,17 @@
public void setTitleStyle(ChartLabelStyle titleStyle);
/**
+ * Returns the style of the long chart description.
+ */
+ public ChartLabelStyle getDescStyle();
+
+ /**
+ * Sets the long description for the chart.
+ * @param descStyle the new chart description style
+ */
+ public void setDescStyle(ChartLabelStyle descStyle);
+
+ /**
* Returns the background color of the chart.
*/
public Paint getBackground();
Modified: trunk/src/schmitzm/jfree/chart/style/ChartStyleXMLFactory.java
===================================================================
--- trunk/src/schmitzm/jfree/chart/style/ChartStyleXMLFactory.java 2009-07-03 16:18:56 UTC (rev 191)
+++ trunk/src/schmitzm/jfree/chart/style/ChartStyleXMLFactory.java 2009-07-03 16:28:15 UTC (rev 192)
@@ -106,8 +106,11 @@
throw new UnsupportedOperationException("Unknown orientation definition: "+orientationStr);
// Title style
+ if ( element.getChild("desc") != null );
+ chartStyle.setDescStyle( createLabelStyleFromXML(element.getChild("desc") ) );
+ // Title style
if ( element.getChild("title") != null );
- chartStyle.setTitleStyle( createTitleStyleFromXML(element.getChild("title") ) );
+ chartStyle.setTitleStyle( createLabelStyleFromXML(element.getChild("title") ) );
// Domain axis
if ( element.getChild("domainAxis") != null );
chartStyle.setAxisStyle( ChartStyle.DOMAIN_AXIS,createAxisStyleFromXML(element.getChild("domainAxis") ) );
@@ -154,7 +157,7 @@
* Creates a {@link ChartLabelStyle} from XML element.
* @param element an element
*/
- public ChartLabelStyle createTitleStyleFromXML(Element element) {
+ public ChartLabelStyle createLabelStyleFromXML(Element element) {
ChartLabelStyle style = new ChartLabelStyle();
// read the common ChartLabelStyle properties
More information about the Schmitzm-commits
mailing list