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

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

Introduction

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

Prototype

@Override
    public int getAbsoluteTop() 

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  .  j a  v a2  s. c  o 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;
}