changeset 7062:4310c612a986 generator-refactoring

Added 'include-zero' attribute to <axis> tag in diagram configuration.
author Sascha L. Teichmann <teichmann@intevation.de>
date Fri, 20 Sep 2013 12:35:14 +0200
parents 4f6b3ba542de
children eb24d5203d17
files artifacts/src/main/java/org/dive4elements/river/exports/DiagramAttributes.java
diffstat 1 files changed, 14 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/artifacts/src/main/java/org/dive4elements/river/exports/DiagramAttributes.java	Fri Sep 20 12:28:15 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/exports/DiagramAttributes.java	Fri Sep 20 12:35:14 2013 +0200
@@ -31,6 +31,7 @@
         private String  name;
         private boolean isLeftAlign;
         private boolean forceAlign;
+        private boolean includeZero;
 
         public AxisAttributes() {
         }
@@ -38,11 +39,13 @@
         public AxisAttributes(
             String  name,
             boolean isLeftAlign,
-            boolean forceAlign
+            boolean forceAlign,
+            boolean includeZero
         ) {
             this.name        = name;
             this.isLeftAlign = isLeftAlign;
             this.forceAlign  = forceAlign;
+            this.includeZero = includeZero;
         }
 
         public String getName() {
@@ -56,6 +59,10 @@
         public boolean forceAlign() {
             return forceAlign;
         }
+
+        public boolean includeZero() {
+            return includeZero;
+        }
     } // class AxisAttributes
 
     public static class Argument {
@@ -170,6 +177,8 @@
             Element axisElement = (Element)axisNodes.item(i);
             String name = axisElement.getAttribute("name").trim();
             String align = axisElement.getAttribute("align").trim();
+            String includeZero =
+                axisElement.getAttribute("include-zero").trim();
             if (name.isEmpty()) {
                 continue;
             }
@@ -181,7 +190,10 @@
                 else if ("right".equals(part)) isleftAlign = false;
                 else if ("force".equals(part)) forceAlign  = true;
             }
-            axesAttrs.add(new AxisAttributes(name, isleftAlign, forceAlign));
+
+            axesAttrs.add(new AxisAttributes(
+                name, isleftAlign, forceAlign,
+                includeZero.equals("true")));
         }
     }
 

http://dive4elements.wald.intevation.org