changeset 4330:93e023131546

Removed the legend images from map theme panel.
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Tue, 30 Oct 2012 15:35:09 +0100
parents c9dcce9448f2
children cf419a37e836
files flys-client/src/main/java/de/intevation/flys/client/client/ui/map/MapOutputTab.java flys-client/src/main/java/de/intevation/flys/client/client/ui/map/MapThemePanel.java
diffstat 2 files changed, 3 insertions(+), 55 deletions(-) [+]
line wrap: on
line diff
--- 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");
--- 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);
     }
 
 

http://dive4elements.wald.intevation.org