Package net.mygwt.ui.client.util

Examples of net.mygwt.ui.client.util.Rectangle


      DOM.setStyleAttribute(w.getElement(), "position", "absolute");
    }
   
    Element ct = container.getLayoutTarget();

    Rectangle rect = MyDOM.getBounds(ct, true);

    int width = rect.width - margin * 2;
    int height = rect.height - margin * 2;

    if (type == Style.HORIZONTAL) {
View Full Code Here


  protected boolean isSelected() {
    return selected;
  }

  public void onBaseEvent(BaseEvent be) {
    Rectangle rect = MyDOM.getBounds(getElement());
    if (rect.contains(be.getClientX(), be.getClientY())) {
      if (!hovering) {
        hovering = true;
        onMouseOver(be);
      }
    } else {
View Full Code Here

      width -= getDecorationWidth(elem, Style.LEFT | Style.RIGHT);
      height -= getDecorationWidth(elem, Style.TOP | Style.BOTTOM);
    }
    width = Math.max(0, width);
    height = Math.max(0, height);
    return new Rectangle(x, y, width, height);
  }
View Full Code Here

   *
   * @param elem the element
   * @return a region containing top, left, bottom, right
   */
  public static Region getRegion(Element elem) {
    Rectangle bounds = getBounds(elem, false);
    Region r = new Region();
    r.left = bounds.x;
    r.top = bounds.y;
    r.right = r.left + bounds.width;
    r.bottom = r.top + bounds.height;
View Full Code Here

   * @param height the height
   * @param adjust <code>true</code> to adjust for box model issues
   */
  public static void setBounds(Element elem, int x, int y, int width, int height,
      boolean adjust) {
    Rectangle rect = new Rectangle(x, y, width, height);
    setBounds(elem, rect, adjust);
  }
View Full Code Here

    MyDOM.setTop(wrapper, t);

    MyDOM.setTop(elem, 0);
    MyDOM.setLeft(elem, 0);

    return new Rectangle(l, t, w, h);

  }
View Full Code Here

    if (constrainViewport) {
      int clientHeight = Window.getClientHeight() + MyDOM.getBodyScrollTop();
      int clientWidth = Window.getClientWidth() + MyDOM.getBodyScrollLeft();

      Rectangle r = MyDOM.getBounds(getElement());

      int x = r.x;
      int y = r.y;

      if (y + r.height > clientHeight) {
View Full Code Here

  }

  private void handleMouseUp() {
    dragging = false;
    DOM.removeEventPreview(preview);
    Rectangle rect = MyDOM.getBounds(dragElem, false);

    rect.width = Math.min(rect.width, maxWidth);
    rect.height = Math.min(rect.height, maxHeight);

  
View Full Code Here

   * @param x the end x coordinate
   * @param y the end y coordinate
   */
  public void move(int x, int y) {
    if (running) return;
    Rectangle r = MyDOM.getBounds(elem, false);
    Effect xe = new Effect(elem, "x", r.x, x);
    Effect ye = new Effect(elem, "y", r.y, y);
    start(new Effect[] {xe, ye});
  }
View Full Code Here

  protected void onLayout(Container container, Element target) {
    super.onLayout(container, target);

    WidgetContainer wc = (WidgetContainer) container;
    Rectangle rect = MyDOM.getBounds(target, true);

    int height = rect.height - (2 * margin);
    int width = rect.width - (2 * margin);
    int top = rect.y += margin;
    int left = rect.x += margin;
View Full Code Here

TOP

Related Classes of net.mygwt.ui.client.util.Rectangle

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.