[Dive4elements-commits] [PATCH 2 of 2] Removed the legend images from map theme panel

Wald Commits scm-commit at wald.intevation.org
Tue Oct 30 15:35:26 CET 2012


# HG changeset patch
# User Ingo Weinzierl <ingo.weinzierl at intevation.de>
# Date 1351607709 -3600
# Node ID 93e02313154636274935e00199940923c2c99783
# Parent  c9dcce9448f24e8a5a6291071d1b5a9c367df2a5
Removed the legend images from map theme panel.

diff -r c9dcce9448f2 -r 93e023131546 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	Tue Oct 30 12:16:26 2012 +0100
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/map/MapOutputTab.java	Tue Oct 30 15:35:09 2012 +0100
@@ -447,7 +447,7 @@
     protected Canvas createThemePanel() {
         Canvas c = new Canvas();
         c.setMinWidth(300);
-        c.setWidth(300);
+        c.setWidth(200);
         c.setHeight100();
         c.setCanDragResize(true);
         c.setBorder("1px solid black");
diff -r c9dcce9448f2 -r 93e023131546 flys-client/src/main/java/de/intevation/flys/client/client/ui/map/MapThemePanel.java
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/map/MapThemePanel.java	Tue Oct 30 12:16:26 2012 +0100
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/map/MapThemePanel.java	Tue Oct 30 15:35:09 2012 +0100
@@ -1,20 +1,13 @@
 package de.intevation.flys.client.client.ui.map;
 
 import com.google.gwt.core.client.GWT;
-
-import com.smartgwt.client.types.ImageStyle;
 import com.smartgwt.client.types.ListGridFieldType;
-import com.smartgwt.client.types.VerticalAlignment;
 import com.smartgwt.client.util.BooleanCallback;
 import com.smartgwt.client.util.SC;
-import com.smartgwt.client.widgets.Canvas;
-import com.smartgwt.client.widgets.Img;
-import com.smartgwt.client.widgets.grid.ListGrid;
 import com.smartgwt.client.widgets.grid.ListGridField;
 import com.smartgwt.client.widgets.grid.ListGridRecord;
 import com.smartgwt.client.widgets.grid.events.HeaderDoubleClickEvent;
 import com.smartgwt.client.widgets.grid.events.HeaderDoubleClickHandler;
-import com.smartgwt.client.widgets.layout.HLayout;
 import com.smartgwt.client.widgets.layout.VLayout;
 import com.smartgwt.client.widgets.menu.Menu;
 import com.smartgwt.client.widgets.menu.MenuItem;
@@ -24,7 +17,6 @@
 import de.intevation.flys.client.client.FLYSConstants;
 import de.intevation.flys.client.client.ui.CollectionView;
 import de.intevation.flys.client.client.ui.ThemePanel;
-import de.intevation.flys.client.shared.MapUtils;
 import de.intevation.flys.client.shared.model.AttributedTheme;
 import de.intevation.flys.client.shared.model.FacetRecord;
 import de.intevation.flys.client.shared.model.OutputMode;
@@ -36,8 +28,7 @@
  */
 public class MapThemePanel extends ThemePanel {
 
-    public static final int CELL_HEIGHT      = 75;
-    public static final int STYLE_CELL_WIDTH = 150;
+    public static final int CELL_HEIGHT = 25;
 
 
     public interface ActivateCallback {
@@ -66,7 +57,6 @@
 
 
     public static final String GRID_FIELD_ACTIVE = "active";
-    public static final String GRID_FIELD_STYLE  = "style";
     public static final String GRID_FIELD_NAME   = "name";
 
 
@@ -140,53 +130,11 @@
         active.setType(ListGridFieldType.BOOLEAN);
         active.setCanDragResize(false);
 
-        ListGridField style = new ListGridField(
-            GRID_FIELD_STYLE,
-            MSG.map_themepanel_header_style(),
-            STYLE_CELL_WIDTH);
-        style.setCanEdit(false);
-        style.setCanDragResize(false);
-
         ListGridField name = new ListGridField(
             GRID_FIELD_NAME, MSG.chart_themepanel_header_themes());
         name.setType(ListGridFieldType.TEXT);
 
-        list.setFields(active, style, name);
-    }
-
-
-    @Override
-    protected ListGrid createNewGrid() {
-        ListGrid grid = new ListGrid() {
-            @Override
-            protected Canvas createRecordComponent(final ListGridRecord record, Integer colNum) {
-                String fieldname = getFieldName(colNum);
-
-                if (fieldname.equals(GRID_FIELD_STYLE)) {
-                    FacetRecord      r = (FacetRecord) record;
-                    AttributedTheme at = (AttributedTheme) r.getTheme();
-
-                    String imgUrl = MapUtils.getLegendGraphicUrl(
-                        at.getAttr("url"),
-                        at.getAttr("layers"));
-
-                    HLayout layout = new HLayout();
-                    layout.setAlign(VerticalAlignment.CENTER);
-                    layout.setLayoutAlign(VerticalAlignment.CENTER);
-
-                    Img img = new Img(imgUrl);
-                    img.setImageType(ImageStyle.CENTER);
-
-                    layout.addMember(img);
-
-                    return layout;
-                }
-
-                return super.createRecordComponent(record, colNum);
-            }
-        };
-
-        return grid;
+        list.setFields(active, name);
     }
 
 


More information about the Dive4elements-commits mailing list