Mercurial > dive4elements > river
diff flys-client/src/main/java/de/intevation/flys/client/client/ui/GaugePanel.java @ 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 | 0dd8963cec9c |
children | e68a710d9652 |
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); } }