changeset 1476:edf18a9dfd8b

Uncommented some code paths to avoid unwanted side effects, cosmetics. flys-client/trunk@3521 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Thu, 22 Dec 2011 09:23:42 +0000
parents fb2fefe0325f
children 6e694603cde1
files flys-client/ChangeLog flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/CrossSectionChartThemePanel.java
diffstat 2 files changed, 23 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/flys-client/ChangeLog	Thu Dec 22 09:02:28 2011 +0000
+++ b/flys-client/ChangeLog	Thu Dec 22 09:23:42 2011 +0000
@@ -1,3 +1,10 @@
+2011-12-22	Felix Wolfsteller	<felix.wolfsteller@intevation.de>
+
+	* src/main/java/de/intevation/flys/client/client/ui/chart/CrossSectionChartThemePanel.java:
+	  Refactored, use string constant.
+	  Uncommented some code paths and mark with todo, as they lead to
+	  not yet well-understood side-effects.
+
 2011-12-22	Felix Wolfsteller	<felix.wolfsteller@intevation.de>
 
 	* src/main/java/de/intevation/flys/client/client/ui/chart/CrossSectionChartThemePanel.java
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/CrossSectionChartThemePanel.java	Thu Dec 22 09:02:28 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/CrossSectionChartThemePanel.java	Thu Dec 22 09:23:42 2011 +0000
@@ -71,7 +71,10 @@
     protected VLayout layout;
 
     /** Data item name for CrossSections selected km. */
-    protected static String CROSS_KM = "cross_section.km";
+    protected static String CS_KM = "cross_section.km";
+
+    /** Data item name for CrossSections selected km. */
+    protected static String CS_IS_MASTER = "cross_section.master?";
 
 
     /**
@@ -104,7 +107,7 @@
      */
     public void feedTellMaster(final String artifact) {
         Data[] feedData = DefaultData.createSimpleStringDataArray(
-            "cross_section.master?", "1");
+            CS_IS_MASTER, "1");
 
         feedService.feed(
             Config.getInstance().getLocale(),
@@ -138,7 +141,7 @@
         Theme  firstCS     = null;
         for (int i = 1; i <= count; i++) {
             Theme theme = themeList.getThemeAt(i);
-            String value = dataOf(theme, "cross_section.master?");
+            String value = dataOf(theme, CS_IS_MASTER);
 
             if (value != null) {
                 if (firstCSUuid == null) {
@@ -151,14 +154,15 @@
                         + "/" + theme.getDescription());
                     Theme collectionMaster = getThemeList().getTheme(
                         view.getArtifact().getUuid());
-                    if (!dataOf(theme, CROSS_KM)
-                            .equals(dataOf(collectionMaster, CROSS_KM))
+                    if (!dataOf(theme, CS_KM)
+                            .equals(dataOf(collectionMaster, CS_KM))
                     ) {
                         // Tell Collection Master which kilometer the Cross-
                         // Section Master is at, to have consistent subtitle
                         // in diagram.
+                        // TODO fix
                         //sendFeed(view.getArtifact().getUuid(),
-                        //     Double.valueOf(dataOf(theme, CROSS_KM)));
+                        //    Double.valueOf(dataOf(theme, CS_KM)));
                     }
 
                     return theme.getDescription();
@@ -172,8 +176,9 @@
             // Tell Collection Master which kilometer the Cross-
             // Section Master is at, to have consistent subtitle
             // in diagram.
-            sendFeed(view.getArtifact().getUuid(),
-                Double.valueOf(dataOf(firstCS, CROSS_KM)));
+            // TODO fix
+            //sendFeed(view.getArtifact().getUuid(),
+            //    Double.valueOf(dataOf(firstCS, CS_KM)));
         }
         return null;
     }
@@ -217,7 +222,7 @@
                 // Tell current master that he is not master anymore.
                 if (getCurrentCSMaster() != null) {
                     Data[] feedData = DefaultData.createSimpleStringDataArray(
-                            "cross_section.master?", "0");
+                            CS_IS_MASTER, "0");
                     feedService.feed(
                         locale,
                         artifactReference(getCurrentCSMaster()),
@@ -295,7 +300,7 @@
         final String locale = config.getLocale();
 
         Data[] feedData =
-            DefaultData.createSimpleStringDataArray(CROSS_KM,
+            DefaultData.createSimpleStringDataArray(CS_KM,
                 Double.valueOf(kmD).toString());
 
         disable();
@@ -413,7 +418,7 @@
         spinnerItem.setWidth(45);
         spinnerItem.setDefaultValue(facetRecord.getTheme()
             .getCollectionItem()
-            .getData().get(CROSS_KM));
+            .getData().get(CS_KM));
 
         spinnerItem.setMin(0);
         spinnerItem.setMax(2000);

http://dive4elements.wald.intevation.org