Example usage for com.google.gwt.dom.client FrameElement getAbsoluteLeft

List of usage examples for com.google.gwt.dom.client FrameElement getAbsoluteLeft

Introduction

In this page you can find the example usage for com.google.gwt.dom.client FrameElement getAbsoluteLeft.

Prototype

@Override
    public int getAbsoluteLeft() 

Source Link

Usage

From source file:ch.unifr.pai.twice.multipointer.client.MouseCursor.java

License:Apache License

/**
 * Get the element within an embedded frame
 * /*from  w ww.  ja  va2 s  .  co m*/
 * @param e
 * @param x
 * @param y
 * @return
 */
private Element getElementInFrame(Element e, int x, int y) {
    if (e != null && e.getTagName() != null && e.getTagName().equalsIgnoreCase("iframe")) {
        FrameElement frame = FrameElement.as(e);
        Document doc = frame.getContentDocument();
        if (doc == null)
            return e;
        x = x - frame.getAbsoluteLeft();
        y = y - frame.getAbsoluteTop();
        e = elementFromPoint(doc, x, y);
        return getElementInFrame(e, x, y);
    } else
        return e;
}