# HG changeset patch # User Björn Ricks # Date 1351000098 -7200 # Node ID 207de712d79dce2d03d1e71c74717bc248258662 # Parent fcdc0d2fdf8f4e86cd2659c4e2cf3e664697f70b Move addMember and removeMember methods in GaugePanel class Also rename class member variable sectionStack to section to avoid confusion. diff -r fcdc0d2fdf8f -r 207de712d79d flys-client/src/main/java/de/intevation/flys/client/client/ui/GaugePanel.java --- 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); } } diff -r fcdc0d2fdf8f -r 207de712d79d flys-client/src/main/java/de/intevation/flys/client/client/ui/ParameterList.java --- 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();