# HG changeset patch # User Christian Lins # Date 1342525535 0 # Node ID 6d749af6a9c2c7afba14e5f4cd8b61cd9bc28a0d # Parent f2039d030b5e163ad44a3a6f59b40bc58da35b54 Issue #726 work. flys-client/trunk@5022 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r f2039d030b5e -r 6d749af6a9c2 flys-client/ChangeLog --- a/flys-client/ChangeLog Mon Jul 16 08:37:24 2012 +0000 +++ b/flys-client/ChangeLog Tue Jul 17 11:45:35 2012 +0000 @@ -1,3 +1,22 @@ +2012-07-17 Christian Lins + + * src/main/java/de/intevation/flys/client/client/ui/chart/ChartToolbar.java: + Correct height of ChartToolbar to 35 pixels. + + * src/main/java/de/intevation/flys/client/client/ui/map/GetFeatureInfoWindow.java: + Make use of generics and cosmetics. + + * src/main/java/de/intevation/flys/client/client/ui/map/FloodMap.java, + src/main/java/de/intevation/flys/client/client/ui/map/MapOutputTab.java, + src/main/java/de/intevation/flys/client/client/ui/map/MapPanel.java: + ThemePanel toggle stuff. + + * src/main/java/de/intevation/flys/client/client/ui/CollectionView.java: + Increase default size as the toolbar has grown as well. + + * pom.xml: + Add commons-codec dependency. + 2012-07-13 Felix Wolfsteller * src/main/java/de/intevation/flys/client/server/MetaDataServiceImpl.java, diff -r f2039d030b5e -r 6d749af6a9c2 flys-client/src/main/java/de/intevation/flys/client/client/ui/CollectionView.java --- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/CollectionView.java Mon Jul 16 08:37:24 2012 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/CollectionView.java Tue Jul 17 11:45:35 2012 +0000 @@ -216,8 +216,8 @@ * This method handles the initial layout stuff. */ protected void init() { - setWidth(950); - setHeight(650); + setWidth(1010); + setHeight(700); layout.setWidth100(); @@ -384,7 +384,7 @@ protected void artifactChanged() { ArtifactDescription desc = getArtifact().getArtifactDescription(); - OutputMode[] outs = desc.getOutputModes(); + //OutputMode[] outs = desc.getOutputModes(); final Recommendation[] recom = desc.getRecommendations(); Collection c = getCollection(); diff -r f2039d030b5e -r 6d749af6a9c2 flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/ChartOutputTab.java --- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/ChartOutputTab.java Mon Jul 16 08:37:24 2012 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/ChartOutputTab.java Tue Jul 17 11:45:35 2012 +0000 @@ -149,7 +149,6 @@ chart = createChartImg(); right.addChild(chart); right.setOverflow(Overflow.HIDDEN); - //right.addChild(createChartPanel()); left.addChild(ctp); tbarPanel = new ChartToolbar(this); diff -r f2039d030b5e -r 6d749af6a9c2 flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/ChartToolbar.java --- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/ChartToolbar.java Mon Jul 16 08:37:24 2012 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/ChartToolbar.java Tue Jul 17 11:45:35 2012 +0000 @@ -7,8 +7,6 @@ import com.smartgwt.client.widgets.Label; import com.smartgwt.client.widgets.events.ClickEvent; import com.smartgwt.client.widgets.events.ClickHandler; -import com.smartgwt.client.widgets.events.ResizedEvent; -import com.smartgwt.client.widgets.events.ResizedHandler; import de.intevation.flys.client.client.FLYSConstants; import de.intevation.flys.client.client.event.ZoomEvent; @@ -27,7 +25,7 @@ protected static FLYSConstants MSG = GWT.create(FLYSConstants.class); - public static final int PANEL_HEIGHT = 30; + public static final int PANEL_HEIGHT = 35; protected Button manageThemes; protected Button datacage; @@ -193,17 +191,6 @@ chartProperties.setTooltip(MSG.chartPropertiesTooltip()); initLayout(); - addResizedHandler(new ResizedHandler() { - @Override - public void onResized(ResizedEvent e) { - if (getVisibleWidth() < 740) { - setHeight(55); - } - else { - setHeight(40); - } - } - }); } /** Set width, height and other properties of an imagebutton. */ diff -r f2039d030b5e -r 6d749af6a9c2 flys-client/src/main/java/de/intevation/flys/client/client/ui/map/FloodMap.java --- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/map/FloodMap.java Mon Jul 16 08:37:24 2012 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/map/FloodMap.java Tue Jul 17 11:45:35 2012 +0000 @@ -1,6 +1,7 @@ package de.intevation.flys.client.client.ui.map; import org.gwtopenmaps.openlayers.client.Bounds; +import org.gwtopenmaps.openlayers.client.LonLat; import org.gwtopenmaps.openlayers.client.Map; import org.gwtopenmaps.openlayers.client.MapOptions; import org.gwtopenmaps.openlayers.client.MapWidget; @@ -8,7 +9,6 @@ import org.gwtopenmaps.openlayers.client.control.ScaleLine; import org.gwtopenmaps.openlayers.client.control.ScaleLineOptions; import org.gwtopenmaps.openlayers.client.event.VectorFeatureAddedListener; -import org.gwtopenmaps.openlayers.client.event.VectorFeatureAddedListener.FeatureAddedEvent; import org.gwtopenmaps.openlayers.client.feature.VectorFeature; import org.gwtopenmaps.openlayers.client.format.GeoJSON; import org.gwtopenmaps.openlayers.client.layer.Layer; @@ -17,7 +17,6 @@ import org.gwtopenmaps.openlayers.client.util.Attributes; import org.gwtopenmaps.openlayers.client.util.JObjectArray; import org.gwtopenmaps.openlayers.client.util.JSObject; -import org.gwtopenmaps.openlayers.client.LonLat; public class FloodMap implements VectorFeatureAddedListener { @@ -38,7 +37,12 @@ public FloodMap(String srid, Bounds maxExtent) { this.srid = srid; this.maxExtent = maxExtent; + recreateWidget("100%", "99px"); + getBarrierLayer(); + } + + public void recreateWidget(String width, String height) { MapOptions opts = new MapOptions(); opts.setControls(new JObjectArray(new JSObject[] {})); opts.setNumZoomLevels(16); @@ -47,10 +51,8 @@ opts.setUnits("m"); opts.setMaxResolution(500); // TODO DO THIS ON THE FLY - mapWidget = new MapWidget("510px", "635px", opts); + mapWidget = new MapWidget(width, height, opts); map = mapWidget.getMap(); - - getBarrierLayer(); } diff -r f2039d030b5e -r 6d749af6a9c2 flys-client/src/main/java/de/intevation/flys/client/client/ui/map/GetFeatureInfoWindow.java --- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/map/GetFeatureInfoWindow.java Mon Jul 16 08:37:24 2012 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/map/GetFeatureInfoWindow.java Tue Jul 17 11:45:35 2012 +0000 @@ -1,24 +1,22 @@ package de.intevation.flys.client.client.ui.map; +import com.google.gwt.core.client.GWT; +import com.smartgwt.client.widgets.Label; +import com.smartgwt.client.widgets.Window; +import com.smartgwt.client.widgets.layout.HLayout; +import com.smartgwt.client.widgets.layout.VLayout; + +import de.intevation.flys.client.client.FLYSConstants; +import de.intevation.flys.client.shared.model.FeatureInfo; + import java.util.List; import java.util.Map; import java.util.Set; -import com.google.gwt.core.client.GWT; - -import com.smartgwt.client.widgets.Label; -import com.smartgwt.client.widgets.Window; -import com.smartgwt.client.widgets.layout.HLayout; -import com.smartgwt.client.widgets.layout.VLayout; - import org.gwtopenmaps.openlayers.client.feature.VectorFeature; import org.gwtopenmaps.openlayers.client.util.Attributes; import org.gwtopenmaps.openlayers.client.util.JSObject; -import de.intevation.flys.client.shared.model.FeatureInfo; - -import de.intevation.flys.client.client.FLYSConstants; - public class GetFeatureInfoWindow extends Window { @@ -75,7 +73,7 @@ Map attrs = feature.getAttrs(); Set> entries = attrs.entrySet(); - for (Map.Entry entry: entries) { + for (Map.Entry entry: entries) { Label attr = new Label(entry.getKey() + ": " + entry.getValue()); attr.setHeight(ROW_HEIGHT); diff -r f2039d030b5e -r 6d749af6a9c2 flys-client/src/main/java/de/intevation/flys/client/client/ui/map/MapOutputTab.java --- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/map/MapOutputTab.java Mon Jul 16 08:37:24 2012 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/map/MapOutputTab.java Tue Jul 17 11:45:35 2012 +0000 @@ -2,7 +2,6 @@ import com.google.gwt.core.client.GWT; import com.google.gwt.user.client.rpc.AsyncCallback; -import com.google.gwt.user.client.ui.HorizontalPanel; import com.google.gwt.user.client.ui.Widget; import com.smartgwt.client.util.SC; import com.smartgwt.client.widgets.Canvas; @@ -86,6 +85,7 @@ protected ThemePanel themePanel; protected Canvas themePanelCanvas; protected Widget mapPanel; + protected Canvas mapPanelCanvas; protected FloodMap floodMap; @@ -139,21 +139,16 @@ rootLayout.setMembersMargin(2); final HLayout hlayout = new HLayout(); - hlayout.setHeight("*"); - hlayout.setWidth100(); hlayout.setMembersMargin(2); this.themePanelCanvas = createThemePanel(); controlPanel = createControlPanel(); - mapPanel = floodMap.getMapWidget(); - final HorizontalPanel layout = new HorizontalPanel(); - layout.setWidth("99%"); - layout.setHeight("99%"); - layout.add(mapPanel); - + //mapPanel = new Image(); + //((Image)mapPanel).setUrl("http://www.hedweb.com/animimag/cool-pony.jpg"); + mapPanel = floodMap.getMapWidget(); hlayout.addMember(themePanelCanvas); - hlayout.addMember(layout); + hlayout.addMember(mapPanel); rootLayout.addMember(controlPanel); rootLayout.addMember(hlayout); @@ -161,8 +156,9 @@ hlayout.addResizedHandler(new ResizedHandler() { @Override public void onResized(ResizedEvent e) { - Integer height = hlayout.getHeight(); - Integer width = hlayout.getWidth() - themePanelCanvas.getWidth(); + int height = hlayout.getHeight(); + int width = hlayout.getWidth() - + (themePanelCanvas.isVisible() ? themePanelCanvas.getWidth() : 0); height = height * 99 / 100; width = width * 99 / 100; @@ -170,7 +166,7 @@ String w = String.valueOf(width) + "px"; String h = String.valueOf(height) + "px"; - floodMap.setSize(w, h); + mapPanel.setSize(w, h); } }); @@ -568,6 +564,8 @@ public void toogleThemePanel() { this.themePanelCanvas.setVisible(!themePanelCanvas.isVisible()); + this.themePanelCanvas.setSize(themePanelCanvas.getWidthAsString(), + themePanelCanvas.getHeightAsString()); } } // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : diff -r f2039d030b5e -r 6d749af6a9c2 flys-client/src/main/java/de/intevation/flys/client/client/ui/map/MapPanel.java --- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/map/MapPanel.java Mon Jul 16 08:37:24 2012 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/map/MapPanel.java Tue Jul 17 11:45:35 2012 +0000 @@ -1,15 +1,14 @@ package de.intevation.flys.client.client.ui.map; import com.google.gwt.user.client.ui.HorizontalPanel; - import com.smartgwt.client.widgets.Canvas; import com.smartgwt.client.widgets.layout.VLayout; -import org.gwtopenmaps.openlayers.client.Bounds; - import de.intevation.flys.client.shared.model.BBox; import de.intevation.flys.client.shared.model.MapInfo; +import org.gwtopenmaps.openlayers.client.Bounds; + public class MapPanel extends VLayout { @@ -55,7 +54,7 @@ toolbar = new MapToolbar(floodMap, digitizeEnabled); addMember(toolbar); - addMember(mapArea); + addMember(wrapper); }