[Schmitzm-commits] r719 - in trunk/src/schmitzm/jfree: feature/style resource/locales
scm-commit@wald.intevation.org
scm-commit at wald.intevation.org
Thu Feb 25 13:27:31 CET 2010
Author: mojays
Date: 2010-02-25 13:27:29 +0100 (Thu, 25 Feb 2010)
New Revision: 719
Modified:
trunk/src/schmitzm/jfree/feature/style/FeatureChartStyle.java
trunk/src/schmitzm/jfree/resource/locales/JFreeResourceBundle.properties
trunk/src/schmitzm/jfree/resource/locales/JFreeResourceBundle_de.properties
Log:
FeatureChartStyle.AggregationFunction: methods for title and description
Modified: trunk/src/schmitzm/jfree/feature/style/FeatureChartStyle.java
===================================================================
--- trunk/src/schmitzm/jfree/feature/style/FeatureChartStyle.java 2010-02-22 21:38:10 UTC (rev 718)
+++ trunk/src/schmitzm/jfree/feature/style/FeatureChartStyle.java 2010-02-25 12:27:29 UTC (rev 719)
@@ -44,9 +44,11 @@
import org.opengis.feature.simple.SimpleFeature;
import org.opengis.feature.simple.SimpleFeatureType;
+import schmitzm.jfree.JFreeChartUtil;
import schmitzm.jfree.chart.style.AbstractChartStyle;
import schmitzm.jfree.chart.style.ChartStyle;
import schmitzm.lang.LangUtil;
+import schmitzm.lang.ResourceProvider;
/**
* This interface extends the chart style with several functionalities
@@ -82,6 +84,14 @@
STND_DEV;
/**
+ * Prefix for the title (.TITLE) and description (.DESC) key in
+ * the resource bundle.
+ * @see #getTitle()
+ * @see #getDescription()
+ */
+ public final String RESOURCE_PREFIX = getClass().getSimpleName() + "." + toString();
+
+ /**
* Returns the result of the function from a statistic.
* @param statistics Statistic to take the result from.
*/
@@ -99,6 +109,28 @@
}
throw new UnsupportedOperationException("Aggregation function not yet supported: "+this);
}
+
+ /**
+ * Returns a description of this kind of chart. Can be used for tool-tips.
+ * May return <code>null</code> if no localized String found.
+ */
+ public String getDescription() {
+ final String resource = JFreeChartUtil.R(RESOURCE_PREFIX + ".Desc");
+ if (resource == null || resource.equals(ResourceProvider.MISSING_RESOURCE_STRING))
+ return null;
+ return resource;
+ }
+
+ /**
+ * Returns a localized title of this kind of chart. If no localized string
+ * found, return the Enum.toString()
+ */
+ public String getTitle() {
+ final String resource = JFreeChartUtil.R(RESOURCE_PREFIX + ".Title");
+ if (resource == null || resource.equals(ResourceProvider.MISSING_RESOURCE_STRING))
+ return toString();
+ return resource;
+ }
}
/**
Modified: trunk/src/schmitzm/jfree/resource/locales/JFreeResourceBundle.properties
===================================================================
--- trunk/src/schmitzm/jfree/resource/locales/JFreeResourceBundle.properties 2010-02-22 21:38:10 UTC (rev 718)
+++ trunk/src/schmitzm/jfree/resource/locales/JFreeResourceBundle.properties 2010-02-25 12:27:29 UTC (rev 719)
@@ -50,3 +50,22 @@
ChartType_LINE.Object.Title=line
ChartType_POINT.Title=pointchart
ChartType_POINT.Object.Title=points
+
+AggregationFunction.COUNT.Title=Count
+AggregationFunction.COUNT.Desc=Count of features
+AggregationFunction.SUM.Title=Sum
+AggregationFunction.SUM.Desc=Sum of attribute values
+AggregationFunction.SUM_ABS.Title=Absolutes sum
+AggregationFunction.SUM_ABS.Desc=Sum of the absolute attribute values
+AggregationFunction.AVG.Title=Average
+AggregationFunction.AVG.Desc=Average attribute value
+AggregationFunction.MEDIAN.Title=Median
+AggregationFunction.MEDIAN.Desc=Median attribute value
+AggregationFunction.MIN.Title=Minimum
+AggregationFunction.MIN.Desc=Minimum attribute value
+AggregationFunction.MAX.Title=Maximum
+AggregationFunction.MAX.Desc=Maximum attribute value
+AggregationFunction.VARIANCE.Title=Variance
+AggregationFunction.VARIANCE.Desc=Variance of the attribute values
+AggregationFunction.STND_DEV.Title=Standard Deviation
+AggregationFunction.STND_DEV.Desc=Standard deviation of the attribute values
Modified: trunk/src/schmitzm/jfree/resource/locales/JFreeResourceBundle_de.properties
===================================================================
--- trunk/src/schmitzm/jfree/resource/locales/JFreeResourceBundle_de.properties 2010-02-22 21:38:10 UTC (rev 718)
+++ trunk/src/schmitzm/jfree/resource/locales/JFreeResourceBundle_de.properties 2010-02-25 12:27:29 UTC (rev 719)
@@ -50,3 +50,23 @@
ChartType_LINE.Object.Title=Linie
ChartType_POINT.Title=Punktdiagramm
ChartType_POINT.Object.Title=Punkte
+
+AggregationFunction.COUNT.Title=Anzahl
+AggregationFunction.COUNT.Desc=Anzahl der Feature
+AggregationFunction.SUM.Title=Summe
+AggregationFunction.SUM.Desc=Summe der Attribut-Werte
+AggregationFunction.SUM_ABS.Title=Absolut-Summe
+AggregationFunction.SUM_ABS.Desc=Summe der Attribut-Wert-Beträge
+AggregationFunction.AVG.Title=Durschnitt
+AggregationFunction.AVG.Desc=Durchschnittlicher Attribut-Wert
+AggregationFunction.MEDIAN.Title=Median
+AggregationFunction.MEDIAN.Desc=Median der Attribut-Werte
+AggregationFunction.MIN.Title=Minimum
+AggregationFunction.MIN.Desc=Minimaler Attribut-Wert
+AggregationFunction.MAX.Title=Maximum
+AggregationFunction.MAX.Desc=Maximaler Attribut-Wert
+AggregationFunction.VARIANCE.Title=Varianz
+AggregationFunction.VARIANCE.Desc=Varianz der Attribut-Werte
+AggregationFunction.STND_DEV.Title=Standard-Abweichung
+AggregationFunction.STND_DEV.Desc=Standard-Abweichung der Attribut-Werte
+
More information about the Schmitzm-commits
mailing list