Package com.sencha.gxt.core.client.util

Examples of com.sencha.gxt.core.client.util.Size


    this.scrollSupport = support;
  }

  @Override
  protected void doLayout() {
    Size size = getContainerTarget().getStyleSize();

    if (GXTLogConfiguration.loggingIsEnabled()) {
      logger.finest(getId() + " doLayout size: " + size);
    }

    int w = size.getWidth() - (adjustForScroll ? XDOM.getScrollBarWidth() : 0);
    int h = size.getHeight();
    int pw = w;

    int count = getWidgetCount();

    // some columns can be percentages while others are fixed
View Full Code Here


  }

  @Override
  protected void doLayout() {

    Size size = getContainerTarget().getStyleSize();

    int width = -1;

    if (!isAutoWidth()) {
      width = size.getWidth() - getLeftRightMargins(widget);

      if (northWidget != null) {
        applyLayout(northWidget, size.getWidth() - getLeftRightMargins(northWidget), -1);
      }
      if (southWidget != null) {
        applyLayout(southWidget, size.getWidth() - getLeftRightMargins(southWidget), -1);
      }
    }
    if (widget != null) {
      int height = -1;
      if (!isAutoHeight()) {
        if ((northWidget instanceof HasWidgets || northWidget instanceof IndexedPanel
            || southWidget instanceof HasWidgets || southWidget instanceof IndexedPanel)
            && !secondPassRequired) {
          secondPassRequired = true;
          Scheduler.get().scheduleDeferred(forceLayoutCommand);
          return;
        }

        secondPassRequired = false;

        height = size.getHeight() - getTopBottomMargins(widget);
        if (northWidget != null) {
          height -= northWidget.getOffsetHeight();
          height -= getTopBottomMargins(northWidget);
        }
        if (southWidget != null) {
View Full Code Here

    this.scrollSupport = support;
  }

  @Override
  protected void doLayout() {
    Size size = getContainerTarget().getStyleSize();

    if (GXTLogConfiguration.loggingIsEnabled()) {
      logger.finest(getId() + " doLayout size: " + size);
    }

    int w = size.getWidth() - (adjustForScroll ? XDOM.getScrollBarWidth() : 0);
    int h = size.getHeight();
    int ph = h;

    int count = getWidgetCount();

    // some columns can be percentages while others are fixed
View Full Code Here

          }
        }
      }
    }

    Size size = getContainerTarget().getStyleSize();

    if (GXTLogConfiguration.loggingIsEnabled()) {
      logger.finest(getId() + " doLayout size: " + size);
    }

    int w = size.getWidth();
    int h = size.getHeight();

    int sLeft = getContainerTarget().getPadding(Side.LEFT);
    int sTop = getContainerTarget().getPadding(Side.TOP);
    int centerW = w, centerH = h, centerY = 0, centerX = 0;

    if (north != null) {
      BorderLayoutData data = getLayoutData(north);
      north.setVisible(!data.isHidden());

      if (north.isVisible()) {
        Rectangle b = new Rectangle();
        Margins m = data.getMargins() != null ? data.getMargins() : new Margins();
        double s = data.getSize() <= 1 ? data.getSize() * size.getHeight() : data.getSize();
        b.setHeight((int) s);
        b.setWidth(w - (m.getLeft() + m.getRight()));
        b.setX(m.getLeft());
        b.setY(m.getTop());
        centerY = b.getHeight() + b.getY() + m.getBottom();
        centerH -= centerY;
        b.setX(b.getX() + sLeft);
        b.setY(b.getY() + sTop);
        applyLayout(north, b);
      }
    }
    if (south != null) {
      BorderLayoutData data = getLayoutData(south);
      south.setVisible(!data.isHidden());
      if (south.isVisible()) {
        Rectangle b = new Rectangle();
        Margins m = data.getMargins() != null ? data.getMargins() : new Margins();
        double s = data.getSize() <= 1 ? data.getSize() * size.getHeight() : data.getSize();
        b.setHeight((int) s);
        b.setWidth(w - (m.getLeft() + m.getRight()));
        b.setX(m.getLeft());
        int totalHeight = (b.getHeight() + m.getTop() + m.getBottom());
        b.setY(h - totalHeight + m.getTop());
        centerH -= totalHeight;
        b.setX(b.getX() + sLeft);
        b.setY(b.getY() + sTop);
        applyLayout(south, b);
      }
    }

    if (west != null) {
      BorderLayoutData data = getLayoutData(west);
      west.setVisible(!data.isHidden());
      if (west.isVisible()) {
        Rectangle box = new Rectangle();
        Margins m = data.getMargins() != null ? data.getMargins() : new Margins();
        double s = data.getSize() <= 1 ? data.getSize() * size.getWidth() : data.getSize();
        box.setWidth((int) s);
        box.setHeight(centerH - (m.getTop() + m.getBottom()));
        box.setX(m.getLeft());
        box.setY(centerY + m.getTop());
        int totalWidth = (box.getWidth() + m.getLeft() + m.getRight());
        centerX += totalWidth;
        centerW -= totalWidth;
        box.setX(box.getX() + sLeft);
        box.setY(box.getY() + sTop);
        applyLayout(west, box);
      }

    }
    if (east != null) {
      BorderLayoutData data = getLayoutData(east);
      east.setVisible(!data.isHidden());
      if (east.isVisible()) {
        Rectangle b = new Rectangle();
        Margins m = data.getMargins() != null ? data.getMargins() : new Margins();
        double s = data.getSize() <= 1 ? data.getSize() * size.getWidth() : data.getSize();
        b.setWidth((int) s);
        b.setHeight(centerH - (m.getTop() + m.getBottom()));
        int totalWidth = (b.getWidth() + m.getLeft() + m.getRight());
        b.setX(w - totalWidth + m.getLeft());
        b.setY(centerY + m.getTop());
View Full Code Here

  }

  @Override
  protected void onResize(int width, int height) {
    super.onResize(width, height);
    Size frameWidth = getElement().getFrameSize();

    if (!isAutoHeight()) {
      height -= frameWidth.getHeight() + appearance.getBar(getElement()).getOffsetHeight();
    }
    if (!isAutoWidth()) {
      width -= frameWidth.getWidth();
    }

    appearance.getBody(getElement()).setSize(width, height, true);
    appearance.getBar(getElement()).setWidth(width, true);
View Full Code Here

      }
    }

    // we can't get height of topBorder as it is includes the header, using
    // width of topLeftBorder assuming equally rounded corners
    return new Size(resources.leftBorder().getWidth() + resources.rightBorder().getWidth(), h
        + resources.bottomBorder().getHeight());
  }
View Full Code Here

    return style.pressed();
  }

  @Override
  public Size getFrameSize(XElement parent) {
    return new Size(resources.topBorder().getHeight(), resources.rightBorder().getWidth());
  }
View Full Code Here

    this.styleFloat = styleFloat;
  }

  @Override
  protected void doLayout() {
    Size size = getContainerTarget().getStyleSize();

    if (GXTLogConfiguration.loggingIsEnabled()) {
      logger.finest(getId() + " doLayout size: " + size);
    }

    int w = size.getWidth() - (adjustForScroll ? XDOM.getScrollBarWidth() : 0);
    w -= getContainerTarget().getFrameWidth(Side.LEFT, Side.RIGHT);
    int pw = w;

    int count = getWidgetCount();
View Full Code Here

    moreMenu.clear();
  }

  @Override
  protected void doLayout() {
    Size size = getElement().getStyleSize();

    if (GXTLogConfiguration.loggingIsEnabled()) {
      logger.finest(getId() + " doLayout  size: " + size);
    }

    if ((size.getHeight() == 0 && size.getWidth() == 0) || size.getWidth() == 0) {
      return;
    }

    int w = size.getWidth() - getScrollOffset();
    int h = size.getHeight();

    int styleHeight = Util.parseInt(getElement().getStyle().getProperty("height"), Style.DEFAULT);
    int styleWidth = Util.parseInt(getElement().getStyle().getProperty("width"), Style.DEFAULT);

    boolean findWidth = styleWidth == -1;
View Full Code Here

    super.onRemove(child);
    child.removeStyleName(CommonStyles.get().floatLeft());
  }

  protected void onOverflow() {
    Size size = getElement().getStyleSize();
    final int w = size.getWidth() - getScrollOffset() - triggerWidth;

    boolean change = false;

    int loopWidth = 0;
    for (int i = 0; i < getWidgetCount(); i++) {
View Full Code Here

TOP

Related Classes of com.sencha.gxt.core.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.