Package com.google.gwt.user.client

Examples of com.google.gwt.user.client.Element


  /**
   * When the user clicks on a folder nothing gets selected.
   */
  public void onFolderClick(FolderClickEvent event) {
    try {
      Element e = EventHandler.getNativeMouseTarget();
      if (IMG_TAGNAME.equals(e.getTagName())) {
        onIconClick(event.getFolder());
      } else {
        if (event.getFolder() instanceof LayerTreeTreeNode) {
          mapModel.selectLayer(((LayerTreeTreeNode) event.getFolder()).getLayer());
        } else {
          mapModel.selectLayer(null);
        }
      }
    } catch (Exception e) {
      GWT.log(e.getMessage());
      // some other unusable element
    }
  }
View Full Code Here


   * to the selected leaf and the toolbar buttons are updated to represent the
   * correct state of the buttons.
   */
  public void onLeafClick(LeafClickEvent event) {
    try {
      Element e = EventHandler.getNativeMouseTarget();
      if (IMG_TAGNAME.equals(e.getTagName())) {
        onIconClick(event.getLeaf());
      } else {
        LayerTreeTreeNode layerTreeNode = (LayerTreeTreeNode) event.getLeaf();
        mapModel.selectLayer(layerTreeNode.getLayer());
      }
    } catch (Exception e) {
      GWT.log(e.getMessage());
      // some other unusable element
    }
  }
View Full Code Here

      return null;
    }
    if ("#text".equals(source.getNodeName())) {
      return Document.get().createTextNode(source.getNodeValue()).cast();
    }
    Element clone = DOM.createElementNS(DOM.NS_SVG, source.getNodeName());
    cloneAttributes(source, clone);
    for (int i = 0; i < source.getChildCount(); i++) {
      Element child = source.getChild(i).cast();
      clone.appendChild(cloneSvgElement(child));
    }

    return clone;
  }
View Full Code Here

   *
   * @param tagName
   *            The tag-name of the HTML that should be created (DIV, IMG, ...).
   */
  public AbstractHtmlObject(String tagName) {
    Element element = DOM.createElement(tagName);
    DOM.setStyleAttribute(element, "position", "absolute");
    DOM.setStyleAttribute(element, "width", "100%");
    DOM.setStyleAttribute(element, "height", "100%");
    setElement(element);
  }
View Full Code Here

   *            The width for this element, expressed in pixels.
   * @param height
   *            The height for this element, expressed in pixels.
   */
  public AbstractHtmlObject(String tagName, int width, int height) {
    Element element = DOM.createElement(tagName);
    DOM.setStyleAttribute(element, "position", "absolute");
    DOM.setStyleAttribute(element, "width", width + "px");
    DOM.setStyleAttribute(element, "height", height + "px");
    setElement(element);
  }
View Full Code Here

   *            How many pixels should this object be placed from the top (relative to the parent origin).
   * @param left
   *            How many pixels should this object be placed from the left (relative to the parent origin).
   */
  public AbstractHtmlObject(String tagName, int width, int height, int top, int left) {
    Element element = DOM.createElement(tagName);
    DOM.setStyleAttribute(element, "position", "absolute");
    DOM.setStyleAttribute(element, "width", width + "px");
    DOM.setStyleAttribute(element, "height", height + "px");
    DOM.setStyleAttribute(element, "top", top + "px");
    DOM.setStyleAttribute(element, "left", left + "px");
View Full Code Here

      return null;
    }
    if ("#text".equals(source.getNodeName())) {
      return Document.get().createTextNode(source.getNodeValue()).cast();
    }
    Element clone = createElementNS(NS_SVG, source.getNodeName());
    cloneAttributes(source, clone);
    for (int i = 0; i < source.getChildCount(); i++) {
      Element child = source.getChild(i).cast();
      clone.appendChild(clone(child));
    }

    return clone;
  }
View Full Code Here

    // Initialize the VML namespace:
    DOM.initVMLNamespace();

    // the root VML node
    Element rootNode = DOM.createElementNS(DOM.NS_HTML, "div");
    id = DOM.createUniqueId();
    rootNode.setId(id);
    DOM.setStyleAttribute(rootNode, "position", "absolute");
    DOM.setStyleAttribute(rootNode, "width", "100%");
    DOM.setStyleAttribute(rootNode, "height", "100%");
    DOM.setStyleAttribute(rootNode, "clip", "rect(0 " + width + "px " + height + "px 0)");
    DOM.setStyleAttribute(rootNode, "overflow", "hidden");
View Full Code Here

   * @param style
   *            The styling object by which the circle should be drawn.
   */
  public void drawCircle(Object parent, String name, Coordinate position, double radius, ShapeStyle style) {
    if (isAttached()) {
      Element circle = helper.createOrUpdateElement(parent, name, "oval", style);

      // Real position is the upper left corner of the circle:
      applyAbsolutePosition(circle, new Coordinate(position.getX() - radius, position.getY() - radius));

      // width and height are both radius*2
 
View Full Code Here

   * @param transformation
   *            transformation to apply to the group
   */
  public void drawData(Object parent, Object object, String data, Matrix transformation) {
    if (isAttached()) {
      Element group = helper.getGroup(object);
      if (group == null) {
        group = helper.createOrUpdateGroup(parent, object, transformation, null);
        DOM.setInnerHTML(group, data);
      }
    }
View Full Code Here

TOP

Related Classes of com.google.gwt.user.client.Element

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.