comparison 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
comparison
equal deleted inserted replaced
4228:fcdc0d2fdf8f 4229:207de712d79d
29 * @author <a href="mailto:bjoern.ricks@intevation.de">Björn Ricks</a> 29 * @author <a href="mailto:bjoern.ricks@intevation.de">Björn Ricks</a>
30 */ 30 */
31 public class GaugePanel extends VLayout implements ResizedHandler { 31 public class GaugePanel extends VLayout implements ResizedHandler {
32 32
33 /** SectionStackSection where this GaugePanel belongs in*/ 33 /** SectionStackSection where this GaugePanel belongs in*/
34 private SectionStackSection sectionStack; 34 private SectionStackSection section;
35 35
36 /** Name of the river */ 36 /** Name of the river */
37 private String river; 37 private String river;
38 38
39 /** The message class that provides i18n strings.*/ 39 /** The message class that provides i18n strings.*/
50 /** 50 /**
51 * Creates a new VLayout with a SectionStackSection 51 * Creates a new VLayout with a SectionStackSection
52 * The GaugePanel's SectionStackSection is hidden by default. 52 * The GaugePanel's SectionStackSection is hidden by default.
53 * 53 *
54 * @param flys The FLYS object 54 * @param flys The FLYS object
55 * @param sectionStack The section stack section to place the VLayout in. 55 * @param section The section stack section to place the VLayout in.
56 */ 56 */
57 public GaugePanel(FLYS flys, SectionStackSection sectionStack) { 57 public GaugePanel(FLYS flys, SectionStackSection section) {
58 gaugetree = new GaugeTree(flys); 58 gaugetree = new GaugeTree(flys);
59 gaugetreecanvas = new Canvas(); 59 gaugetreecanvas = new Canvas();
60 gaugetreecanvas.addChild(gaugetree); 60 gaugetreecanvas.addChild(gaugetree);
61 61
62 setOverflow(Overflow.HIDDEN); 62 setOverflow(Overflow.HIDDEN);
63 sectionStack.setHidden(true); 63 section.setHidden(true);
64 sectionStack.setItems(this); 64 section.setItems(this);
65 this.sectionStack = sectionStack; 65 this.section = section;
66 setStyleName("gaugepanel"); 66 setStyleName("gaugepanel");
67 addResizedHandler(this); 67 addResizedHandler(this);
68 } 68 }
69 69
70 /** 70 /**
146 * Hide the section stack section. 146 * Hide the section stack section.
147 */ 147 */
148 @Override 148 @Override
149 public void hide() { 149 public void hide() {
150 GWT.log("GaugePanel - hide"); 150 GWT.log("GaugePanel - hide");
151 this.sectionStack.setHidden(true); 151 this.section.setHidden(true);
152 } 152 }
153 153
154 /** 154 /**
155 * Show the section stack section. 155 * Show the section stack section.
156 */ 156 */
157 @Override 157 @Override
158 public void show() { 158 public void show() {
159 GWT.log("GaugePanel - show"); 159 GWT.log("GaugePanel - show");
160 this.sectionStack.setHidden(false); 160 this.section.setHidden(false);
161 }
162
163 @Override
164 public void addMember(Canvas component) {
165 super.addMember(component);
166 section.setExpanded(true);
167 }
168
169 @Override
170 public void removeMembers(Canvas[] components) {
171 super.removeMembers(components);
172 section.setExpanded(false);
161 } 173 }
162 } 174 }

http://dive4elements.wald.intevation.org