[PATCH] Added 'include-zero' attribute to <axis> tag in diagram configuration

Wald Commits scm-commit at wald.intevation.org
Fri Sep 20 12:35:17 CEST 2013


# HG changeset patch
# User Sascha L. Teichmann <teichmann at intevation.de>
# Date 1379673314 -7200
# Branch generator-refactoring
# Node ID 4310c612a986cbfba9ddb3cdfbf1bc354e4bf0fc
# Parent  4f6b3ba542de9f2d772977b77126c1286c8dce9e
Added 'include-zero' attribute to <axis> tag in diagram configuration.

diff -r 4f6b3ba542de -r 4310c612a986 artifacts/src/main/java/org/dive4elements/river/exports/DiagramAttributes.java
--- 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")));
         }
     }
 


More information about the Dive4elements-commits mailing list