comparison gwt-client/src/main/java/org/dive4elements/river/client/client/ui/map/LegendWindow.java @ 9701:0caaca0df028

another try for river axis legend
author dnt_bjoernsen <d.tironi@bjoernsen.de>
date Wed, 20 Jan 2021 19:25:47 +0100
parents b2768f367dff
children 20456a3c92e2
comparison
equal deleted inserted replaced
9700:b2768f367dff 9701:0caaca0df028
84 // String url = "url"; 84 // String url = "url";
85 if (img instanceof Image) { 85 if (img instanceof Image) {
86 // url = " url " + ((Image) img).getUrl(); 86 // url = " url " + ((Image) img).getUrl();
87 new MyLoadHandler(row, ((Image) img)); 87 new MyLoadHandler(row, ((Image) img));
88 88
89 } else if (img instanceof Img) { 89 // } else if (img instanceof Img) {
90 setDimensions(row, ((Img) img).getHeight(), ((Img) img).getWidth()); 90 // setDimensions(row, ((Img) img).getHeight(), ((Img) img).getWidth());
91 // url = " dataPath " + ((Img) img).getDataPath(); 91 // url = " dataPath " + ((Img) img).getDataPath();
92 } else { 92 } else {
93 setDimensions(row, 150, 400); // not sure when this is executed 93 setDimensions(row, 150, 400); // not sure when this is executed
94 } 94 }
95 // String labelText = at.getDescription() + ", height: " + row.getHeight() + "width: " + row.getWidth() + " " 95 // String labelText = at.getDescription() + ", height: " + row.getHeight() + "width: " + row.getWidth() + " "
108 private Widget createLegendGraphics(HLayout row, final AttributedTheme at) { 108 private Widget createLegendGraphics(HLayout row, final AttributedTheme at) {
109 109
110 final String legend = at.getAttr("legend"); 110 final String legend = at.getAttr("legend");
111 // TEST: final Image img = new Image("/images/FLYS_Donau.png"); (funktioniert!), 111 // TEST: final Image img = new Image("/images/FLYS_Donau.png"); (funktioniert!),
112 // ebenso FLYSResources.getTest(); 112 // ebenso FLYSResources.getTest();
113 if (legend != null && !"".equals(legend)) { 113 // if (legend != null && !"".equals(legend)) {
114 114
115 final String imgUrl = URL.encode(GWT.getHostPageBaseURL() + "images/wms_legend/" + legend); 115 final String imgUrl = URL.encode(GWT.getHostPageBaseURL() + "images/wms_legend/" + legend);
116 116
117 final Image image = new Image(imgUrl); 117 final Image image = new Image(imgUrl);
118 new MyWMSLoadHandler(row, image); 118 new MyWMSLoadHandler(row, image);
119 119
120 return image; 120 return image;
121 } 121 // }
122 final String imgUrl = MapUtils.getLegendGraphicUrl(at.getAttr("url"), at.getAttr("layers")); 122 // final String imgUrl = MapUtils.getLegendGraphicUrl(at.getAttr("url"), at.getAttr("layers"));
123 // final Img img = new Img(imgUrl);
124 // img.setImageType(ImageStyle.CENTER);
125 // img.setAutoFit(true);
123 126
124 final Img img = new Img(imgUrl); 127 // return img;
125 img.setImageType(ImageStyle.CENTER);
126 img.setAutoFit(true);
127
128 return img;
129 } 128 }
130 129
131 private void init() { 130 private void init() {
132 this.legendContainer.setAutoHeight(); 131 this.legendContainer.setAutoHeight();
133 this.legendContainer.setLayoutAlign(VerticalAlignment.TOP); 132 this.legendContainer.setLayoutAlign(VerticalAlignment.TOP);

http://dive4elements.wald.intevation.org