01: /*
02: * MyGWT Widget Library
03: * Copyright(c) 2007, MyGWT.
04: * licensing@mygwt.net
05: *
06: * http://mygwt.net/license
07: */
08: package net.mygwt.ui.client.widget.impl;
09:
10: import net.mygwt.ui.client.widget.PNGImage;
11:
12: import com.google.gwt.user.client.DOM;
13: import com.google.gwt.user.client.Element;
14:
15: /**
16: * PNG support.
17: * <p>
18: * Implementation adapted from GWT Widget Library
19: * (http://gwt-widget.sourceforge.net/).
20: * </p>
21: *
22: */
23: public class PNGImageImpl {
24:
25: public Element createElement(String url, int width, int height) {
26: Element result = DOM.createImg();
27: DOM.setElementProperty(result, "src", url);
28: DOM.setElementPropertyInt(result, "width", width);
29: DOM.setElementPropertyInt(result, "height", height);
30: return result;
31: }
32:
33: public String getUrl(PNGImage image) {
34: return DOM.getElementProperty(image.getElement(), "src");
35: }
36:
37: }
|