d@9698: package org.dive4elements.river.client.client.ui.map; d@9698: d@9698: import com.google.gwt.event.dom.client.LoadEvent; d@9698: import com.google.gwt.event.shared.HandlerRegistration; d@9698: import com.google.gwt.user.client.ui.Image; d@9698: import com.smartgwt.client.widgets.layout.HLayout; d@9698: d@9698: public class MyLoadHandler implements com.google.gwt.event.dom.client.LoadHandler { d@9698: private Image m_image; d@9699: private HLayout m_row; d@9698: private HandlerRegistration m_handelReg; d@9698: d@9698: public MyLoadHandler(HLayout row, Image image) { d@9698: m_image = image; d@9698: m_row = row; d@9699: m_handelReg = image.addLoadHandler(this); d@9698: } d@9698: d@9698: @Override d@9698: public void onLoad(LoadEvent event) { d@9698: setDimensions(m_row, m_image.getHeight(), m_image.getWidth()); d@9698: if (m_handelReg != null) d@9698: m_handelReg.removeHandler(); d@9698: } d@9699: d@9698: private void setDimensions(HLayout row, int height, int width) { d@9698: final int minHeight = 30; d@9698: row.setHeight(height < minHeight ? minHeight : height); d@9698: row.setWidth(width); d@9698: } d@9699: }