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

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

Introduction

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

Prototype

public static FrameElement as(Element elem) 

Source Link

Document

Assert that the given Element is compatible with this class and automatically typecast it.

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  a 2s.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;
}