use of com.google.gwt.dom.client.ImageElement in project gwt-test-utils by gwt-test-utils.
the class ImagePatcher method getDim.
private static int getDim(Image image, String dim) {
ImageElement elem = image.getElement().cast();
String width = elem.getStyle().getProperty(dim);
if (width == null) {
return 0;
}
Matcher m = PATTERN.matcher(width);
if (m.matches()) {
return Integer.parseInt(m.group(1));
}
return 0;
}
use of com.google.gwt.dom.client.ImageElement in project lienzo-core by ahome-it.
the class Sprite method load.
Sprite load() {
if (isLoaded()) {
if (null != m_loaded) {
m_loaded.onSpriteLoaded(this);
}
} else {
final String url = getURL();
new ImageLoader(url) {
@Override
public void onImageElementLoad(final ImageElement elem) {
m_sprite = elem;
if (null != m_loaded) {
m_loaded.onSpriteLoaded(Sprite.this);
}
}
@Override
public void onImageElementError(String message) {
LienzoCore.get().error("Sprite could not load URL " + url + " " + message);
}
};
}
return this;
}
Aggregations