changeset 7061:4f6b3ba542de generator-refactoring

Added domain axis title to diagram attributes.
author Sascha L. Teichmann <teichmann@intevation.de>
date Fri, 20 Sep 2013 12:28:15 +0200
parents 78ded33f5f5b
children 4310c612a986
files artifacts/src/main/java/org/dive4elements/river/exports/DiagramAttributes.java artifacts/src/main/java/org/dive4elements/river/exports/XYChartGenerator.java
diffstat 2 files changed, 11 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/artifacts/src/main/java/org/dive4elements/river/exports/DiagramAttributes.java	Fri Sep 20 12:04:14 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/exports/DiagramAttributes.java	Fri Sep 20 12:28:15 2013 +0200
@@ -143,6 +143,7 @@
 
     private Title title;
     private Title subtitle;
+    private Title domainAxisTitle;
 
     public DiagramAttributes() {
         axesAttrs      = new ArrayList<AxisAttributes>(5);
@@ -155,6 +156,7 @@
         parseProcessors(config);
         parseTitle(config);
         parseSubtitle(config);
+        parseDomainAxisTitle(config);
     }
 
     public List<AxisAttributes> getAxesAttributes() {
@@ -195,6 +197,10 @@
         return subtitle;
     }
 
+    public Title getDomainAxisTitle() {
+        return domainAxisTitle;
+    }
+
     private void parseProcessors(Element config) {
         NodeList processorNodes = config.getElementsByTagName("processor");
 
@@ -235,6 +241,10 @@
         subtitle = extractTitle(config, "subtitle");
     }
 
+    private void parseDomainAxisTitle(Element config) {
+        domainAxisTitle = extractTitle(config, "domain-axis");
+    }
+
     private static Title extractTitle(Element config, String tagName) {
         NodeList titleNodes = config.getElementsByTagName(tagName);
         if (titleNodes.getLength() < 1) {
@@ -255,7 +265,7 @@
     }
 
     public int getAxisIndex(String axisName) {
-        for (int i=0; i < axesAttrs.size(); i++) {
+        for (int i = axesAttrs.size()-1; i >= 0; --i) {
             if (axesAttrs.get(i).getName().equals(axisName)) {
                 return i;
             }
--- a/artifacts/src/main/java/org/dive4elements/river/exports/XYChartGenerator.java	Fri Sep 20 12:04:14 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/exports/XYChartGenerator.java	Fri Sep 20 12:28:15 2013 +0200
@@ -404,7 +404,6 @@
 
         addAxisDataset(new XYSeriesCollection(series), index, visible);
 
-        AxisDataset axisDataset = (AxisDataset) getAxisDataset(index);
     }
 
 

http://dive4elements.wald.intevation.org