Mercurial > dive4elements > river
comparison flys-client/src/main/java/de/intevation/flys/client/client/ui/map/MapPanel.java @ 4571:95e23bcf6a50
Fix FLYS logo URL for printing.
Remove obsolete code from MapPanel.
author | Christian Lins <christian.lins@intevation.de> |
---|---|
date | Tue, 20 Nov 2012 15:28:07 +0100 |
parents | 8ca06d3040d0 |
children | ef32ab3c1679 |
comparison
equal
deleted
inserted
replaced
4570:8ca06d3040d0 | 4571:95e23bcf6a50 |
---|---|
1 package de.intevation.flys.client.client.ui.map; | 1 package de.intevation.flys.client.client.ui.map; |
2 | 2 |
3 import com.google.gwt.core.client.GWT; | 3 import com.google.gwt.core.client.GWT; |
4 import com.smartgwt.client.widgets.Canvas; | |
5 import com.smartgwt.client.widgets.WidgetCanvas; | |
6 import com.smartgwt.client.widgets.events.ParentMovedEvent; | 4 import com.smartgwt.client.widgets.events.ParentMovedEvent; |
7 import com.smartgwt.client.widgets.events.ParentMovedHandler; | 5 import com.smartgwt.client.widgets.events.ParentMovedHandler; |
8 import com.smartgwt.client.widgets.events.ResizedEvent; | 6 import com.smartgwt.client.widgets.events.ResizedEvent; |
9 import com.smartgwt.client.widgets.events.ResizedHandler; | 7 import com.smartgwt.client.widgets.events.ResizedHandler; |
10 import com.smartgwt.client.widgets.layout.VLayout; | 8 import com.smartgwt.client.widgets.layout.VLayout; |
67 floodMapWidget.getMap().updateSize(); | 65 floodMapWidget.getMap().updateSize(); |
68 } | 66 } |
69 }); | 67 }); |
70 } | 68 } |
71 | 69 |
72 /** | |
73 * Due to the fact that SmartGWT Layout misses a removeMember(Widget) | |
74 * method we use this method to remove all WidgetCanvas members. | |
75 * WidgetCanvas is the wrapper class used by Layout to handle Widget | |
76 * objects. | |
77 */ | |
78 protected void removeWidgetCanvasMember() { | |
79 Canvas[] allCanvas = getMembers(); | |
80 for (Canvas canvas : allCanvas) { | |
81 if (canvas instanceof WidgetCanvas) { | |
82 removeMember(canvas); | |
83 } | |
84 } | |
85 } | |
86 | |
87 protected void doLayout() { | 70 protected void doLayout() { |
88 int width = getWidth(); | 71 int width = getWidth(); |
89 int height = getHeight(); | 72 int height = getHeight(); |
90 GWT.log("MapPanel.size: " + width + "x" + height); | 73 GWT.log("MapPanel.size: " + width + "x" + height); |
91 | 74 |
92 width -= 2; // minus black borders | 75 width -= 2; // minus black borders |
93 height -= toolbar.getHeight() + 4; | 76 height -= toolbar.getHeight() + 4; |
94 | 77 |
95 // Recreate Map widget | 78 if (width < 0 || height < 0) { |
96 /*removeWidgetCanvasMember(); | 79 GWT.log("MapPanel: Oops what a size!"); |
97 floodMap.recreateWidget(width, height); | 80 return; |
98 floodMapWidget = floodMap.getMapWidget(); | 81 } |
99 addMember(floodMapWidget); | 82 |
100 */ | |
101 floodMapWidget.setSize(Integer.toString(width), Integer.toString(height)); | 83 floodMapWidget.setSize(Integer.toString(width), Integer.toString(height)); |
102 floodMapWidget.getMap().updateSize(); | 84 floodMapWidget.getMap().updateSize(); |
103 } | 85 } |
104 | 86 |
105 | 87 |