Package com.extjs.gxt.ui.client.util

Examples of com.extjs.gxt.ui.client.util.Size


    removeEmptyText();
    applyEmptyText();
  }

  protected Size adjustInputSize() {
    return new Size(0, 0);
  }
View Full Code Here


  }

  @Override
  protected void onResize(int width, int height) {
    super.onResize(width, height);
    Size asize = adjustInputSize();
    getInputEl().setSize(width - asize.width, height - asize.height, true);
  }
View Full Code Here

  }

  @Override
  protected void onResize(int width, int height) {
    super.onResize(width, height);
    Size frameSize = el().getFrameSize();
    startBtn.setSize(width - frameSize.width, height - frameSize.height);
  }
View Full Code Here

   * Returns the viewports size.
   *
   * @return the viewport size
   */
  public static Size getViewportSize() {
    return new Size(getViewportWidth(), getViewportHeight());
  }
View Full Code Here

   * @param adjust if true sizes get adjusted
   *
   * @return the element's bounds
   */
  public Rectangle getBounds(boolean local, boolean adjust) {
    Size s = getSize(adjust);
    Rectangle rect = new Rectangle();
    rect.width = s.width;
    rect.height = s.height;
    if (local) {
      rect.x = getLeft(true);
View Full Code Here

        width += Util.parseInt(map.get(s), 0);
      } else {
        height += Util.parseInt(map.get(s), 0);
      }
    }
    return new Size(width, height);
  }
View Full Code Here

   */
  public Size getSize(boolean content) {
    int w = getWidth();
    int h = getHeight();
    if (content) {
      Size frameWidth = getFrameSize();
      w -= frameWidth.width;
      h -= frameWidth.height;
    }
    return new Size(Math.max(0,w),Math.max(0,h));
  }
View Full Code Here

    }

    int offsetWidth = Style.DEFAULT;
    int offsetHeight = Style.DEFAULT;
    if (w == Style.DEFAULT && h == Style.DEFAULT) {
      Size s = getSize(contentOnly);
      offsetWidth = s.width;
      offsetHeight = s.height;
      if (s.width > 0) {
        w = s.width;
      }
      if (s.height > 0) {
        h = s.height;
      }
    } else if (w == Style.DEFAULT) {
      offsetWidth = getWidth(contentOnly);
      if (offsetWidth > 0) {
        w = offsetWidth;
      }
    } else if (h == Style.DEFAULT) {
      offsetHeight = getHeight(contentOnly);
      if (offsetHeight > 0) {
        h = offsetHeight;
      }
    }

    List<String> l = new ArrayList<String>();
    if (w == Style.DEFAULT) {
      l.add("width");
    }
    if (h == Style.DEFAULT) {
      l.add("height");
    }
    Map<String, String> map = getStyleAttribute(l);
    if (map != null) {
      String wid = map.get("width");
      if (wid != null) {
        w = Util.parseInt(wid, Style.DEFAULT);
        if (offsetWidth == 0 &&isBorderBox  && contentOnly && w != Style.DEFAULT && !GXT.isIE) {
          w -= getFrameWidth("lr");
        } else if(GXT.isIE && isBorderBox && w != Style.DEFAULT && contentOnly){
          w-= getFrameWidth("lr");
        } else if(offsetWidth == 0 && !isBorderBox && !contentOnly && w != Style.DEFAULT){
          w += getFrameWidth("lr");
        }
      }
      String hei = map.get("height");
      if (hei != null) {
        h = Util.parseInt(hei, Style.DEFAULT);
        if (offsetHeight == 0 && isBorderBox && contentOnly && h != Style.DEFAULT && !GXT.isIE) {
          h -= getFrameWidth("tb");
        } else if(GXT.isIE && isBorderBox && h != Style.DEFAULT && contentOnly){
          h-= getFrameWidth("tb");
        } else if(offsetHeight == 0 && !isBorderBox && !contentOnly && h != Style.DEFAULT ){
          h+= getFrameWidth("tb");
        }
      }
    }
    if (w == Style.DEFAULT && h == Style.DEFAULT) {
      return new Size(offsetWidth, offsetHeight);
    }
    return new Size(w != Style.DEFAULT ? w : offsetWidth, h != Style.DEFAULT ? h : offsetHeight);
  }
View Full Code Here

   * @param adjust <code>true</code> to adjust for box model issues
   * @return this
   */
  public El setSize(int width, int height, boolean adjust) {
    if (adjust && !isBorderBox()) {
      Size frameWidth = getFrameSize();
      width -= frameWidth.width;
      height -= frameWidth.height;
    }
    if (width >= 0) {
      dom.getStyle().setPropertyPx("width", width);
View Full Code Here

   * @param adjust if true sizes get adjusted
   *
   * @return the element's bounds
   */
  public Rectangle getBounds(boolean local, boolean adjust) {
    Size s = getSize(adjust);
    Rectangle rect = new Rectangle();
    rect.width = s.width;
    rect.height = s.height;
    if (local) {
      rect.x = getLeft(true);
View Full Code Here

TOP

Related Classes of com.extjs.gxt.ui.client.util.Size

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.