changeset 4229:207de712d79d

Move addMember and removeMember methods in GaugePanel class Also rename class member variable sectionStack to section to avoid confusion.
author Björn Ricks <bjoern.ricks@intevation.de>
date Tue, 23 Oct 2012 15:48:18 +0200
parents fcdc0d2fdf8f
children eab85cf85b10
files flys-client/src/main/java/de/intevation/flys/client/client/ui/GaugePanel.java flys-client/src/main/java/de/intevation/flys/client/client/ui/ParameterList.java
diffstat 2 files changed, 21 insertions(+), 21 deletions(-) [+]
line wrap: on
line diff
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/GaugePanel.java	Tue Oct 23 14:32:48 2012 +0200
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/GaugePanel.java	Tue Oct 23 15:48:18 2012 +0200
@@ -31,7 +31,7 @@
 public class GaugePanel extends VLayout implements ResizedHandler {
 
     /** SectionStackSection where this GaugePanel belongs in*/
-    private SectionStackSection sectionStack;
+    private SectionStackSection section;
 
     /** Name of the river */
     private String river;
@@ -52,17 +52,17 @@
      * The GaugePanel's SectionStackSection is hidden by default.
      *
      * @param flys The FLYS object
-     * @param sectionStack The section stack section to place the VLayout in.
+     * @param section The section stack section to place the VLayout in.
      */
-    public GaugePanel(FLYS flys, SectionStackSection sectionStack) {
+    public GaugePanel(FLYS flys, SectionStackSection section) {
         gaugetree = new GaugeTree(flys);
         gaugetreecanvas = new Canvas();
         gaugetreecanvas.addChild(gaugetree);
 
         setOverflow(Overflow.HIDDEN);
-        sectionStack.setHidden(true);
-        sectionStack.setItems(this);
-        this.sectionStack = sectionStack;
+        section.setHidden(true);
+        section.setItems(this);
+        this.section = section;
         setStyleName("gaugepanel");
         addResizedHandler(this);
     }
@@ -148,7 +148,7 @@
     @Override
     public void hide() {
         GWT.log("GaugePanel - hide");
-        this.sectionStack.setHidden(true);
+        this.section.setHidden(true);
     }
 
     /**
@@ -157,6 +157,18 @@
     @Override
     public void show() {
         GWT.log("GaugePanel - show");
-        this.sectionStack.setHidden(false);
+        this.section.setHidden(false);
+    }
+
+    @Override
+    public void addMember(Canvas component) {
+        super.addMember(component);
+        section.setExpanded(true);
+    }
+
+    @Override
+    public void removeMembers(Canvas[] components) {
+        super.removeMembers(components);
+        section.setExpanded(false);
     }
 }
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/ParameterList.java	Tue Oct 23 14:32:48 2012 +0200
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/ParameterList.java	Tue Oct 23 15:48:18 2012 +0200
@@ -214,19 +214,7 @@
         final SectionStackSection gaugeSection = new SectionStackSection();
         gaugeSection.setExpanded(false);
         gaugeSection.setTitle(MSG.gaugePanelTitle());
-        gaugePanel = new GaugePanel(flys, gaugeSection) {
-            @Override
-            public void addMember(Canvas component) {
-                super.addMember(component);
-                gaugeSection.setExpanded(true);
-            }
-
-            @Override
-            public void removeMembers(Canvas[] components) {
-                super.removeMembers(components);
-                gaugeSection.setExpanded(false);
-            }
-        };
+        gaugePanel = new GaugePanel(flys, gaugeSection);
         gaugePanel.setWidth100();
         gaugePanel.setHeight100();
 

http://dive4elements.wald.intevation.org