diff flys-artifacts/src/main/java/de/intevation/flys/exports/ChartSettings.java @ 2050:c4e0e433f825

Use axes ranges specified in ChartSettings for zooming in charts. flys-artifacts/trunk@3540 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Tue, 27 Dec 2011 07:17:07 +0000
parents 2ae0627f956e
children 76eeb3b4358e
line wrap: on
line diff
--- a/flys-artifacts/src/main/java/de/intevation/flys/exports/ChartSettings.java	Fri Dec 23 15:10:13 2011 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/exports/ChartSettings.java	Tue Dec 27 07:17:07 2011 +0000
@@ -94,7 +94,7 @@
      *
      * @param axisSection The Section specific for a chart axis.
      */
-    public void addAxisSection(Section axisSection) {
+    public void addAxisSection(AxisSection axisSection) {
         if (axisSection != null) {
             axesSection.addSubsection(axisSection);
         }
@@ -102,6 +102,28 @@
 
 
     /**
+     * This method returns an AxisSection specified by <i>axisId</i> or null if
+     * no AxisSection is existing with identifier <i>axisId</i>.
+     *
+     * @param axisId The identifier of the wanted AxisSection.
+     *
+     * @return the AxisSection specified by <i>axisId</i> or null.
+     */
+    public AxisSection getAxisSection(String axisId) {
+        for (int i = 0, n = axesSection.getSubsectionCount(); i < n; i++) {
+            AxisSection as = (AxisSection) axesSection.getSubsection(i);
+            String      id = as.getIdentifier();
+
+            if (id != null && id.equals(axisId)) {
+                return as;
+            }
+        }
+
+        return null;
+    }
+
+
+    /**
      * Parses the settings from <i>settings</i>. The result is a new
      * ChartSettings instance.
      *

http://dive4elements.wald.intevation.org