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

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


  }

  private void showMonthPicker() {
    createMonthPicker();

    Size s = getElement().getSize(true);
    s.setHeight(s.getHeight() - 2);

    monthPicker.setTop(1);

    appearance.onMonthPickerSize(monthPicker, s.getWidth(), s.getHeight());

    mpSelMonth = (activeDate != null ? activeDate : value).getMonth();

    updateMPMonth(mpSelMonth);
    mpSelYear = (activeDate != null ? activeDate : value).getFullYear();
View Full Code Here


    appearance.onHideHeader(getElement(), !visible);
  }

  @Override
  protected void onResize(int width, int height) {
    Size frameSize = getFrameSize();

    if (isAutoWidth()) {
      getContainerTarget().getStyle().clearWidth();
    } else {
      width -= frameSize.getWidth();
      getContainerTarget().setWidth(width - frameSize.getWidth(), true);

    }

    if (isAutoHeight()) {
      getContainerTarget().getStyle().clearHeight();
    } else {
      height -= frameSize.getHeight();
      height -= appearance.getHeaderElement(getElement()).getOffsetHeight();
      getContainerTarget().setHeight(height - frameSize.getHeight(), true);
    }

    super.onResize(width, height);
  }
View Full Code Here

  protected XElement getContainerTarget() {
    return appearance.getContentElem(getElement());
  }

  protected Size getFrameSize() {
    return new Size(appearance.getFrameWidth(getElement()), appearance.getFrameHeight(getElement()));
  }
View Full Code Here

  }

  @Override
  protected void doLayout() {
    if (widget != null) {
      Size size = getElement().getStyleSize();
      int width = -1;
      if (!isAutoWidth()) {

        if (options.getLabelAlign() == LabelAlign.TOP) {
          width = size.getWidth() - getLeftRightMargins(widget);
        } else {
          XElement wrapper = appearance.getChildElementWrapper(getElement());
          width = (wrapper != null ? wrapper.getWidth(true) : size.getWidth()) - getLeftRightMargins(widget);
        }

        if (GXT.isIE6()) {
          width -= 5;
        }
      }
      int height = -1;

      if (!isAutoHeight()) {
        height = size.getHeight() - getTopBottomMargins(widget);
      }

      applyLayout(widget, width, height);
    }
  }
View Full Code Here

  protected void doLayout() {
    if (activeWidget != null) {
      if (GXTLogConfiguration.loggingIsEnabled()) {
        logger.finest("doLayout");
      }
      Size size = getContainerTarget().getStyleSize();

      switch (expandMode) {
        case MULTI:
        case SINGLE:
          for (int i = 0, len = getWidgetCount(); i < len; i++) {
            ContentPanel c = (ContentPanel) getWidget(i);
            if (expandMode == ExpandMode.SINGLE && c != activeWidget) {
              c.collapse();
            }
            applyLayout(c, size.getWidth(), -1);
          }
          break;
        case SINGLE_FILL:
          if (activeWidget.isExpanded()) {
            int hh = 0;
            for (int i = 0, len = getWidgetCount(); i < len; i++) {
              ContentPanel c = (ContentPanel) getWidget(i);

              if (c != activeWidget) {
                c.collapse();
                hh += c.getAppearance().getHeaderSize(c.getElement()).getHeight();
                applyLayout(c, size.getWidth(), -1);
              }
            }
            activeWidget.setPixelSize(size.getWidth(), size.getHeight() - hh);
          } else {
            for (int i = 0, len = getWidgetCount(); i < len; i++) {
              ContentPanel c = (ContentPanel) getWidget(i);
              if (c != activeWidget) {
                c.collapse();
              }
              applyLayout(c, size.getWidth(), -1);
            }
          }

      }
View Full Code Here

    this.vBoxLayoutAlign = vBoxLayoutAlign;
  }

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

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

    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

  protected void doLayout() {
    if (activeWidget == null && getWidgetCount() > 0) {
      setActiveWidget(getWidget(0));
    }
    if (activeWidget != null) {
      Size size = getContainerTarget().getStyleSize();
      if (GXTLogConfiguration.loggingIsEnabled()) {
        logger.finest(getId() + " doLayout size: " + size);
      }
      int width = -1;
      if (!isAutoWidth()) {
        width = size.getWidth() - getLeftRightMargins(activeWidget);
      }
      int height = -1;
      if (!isAutoHeight()) {
        height = size.getHeight() - getTopBottomMargins(activeWidget);
      }
      applyLayout(activeWidget, width, height);
    }
  }
View Full Code Here

    return hadLayoutRunning;
  }

  public void onResize() {
    if (isAttached()) {
      Size s = XElement.as(getElement().getParentElement()).getSize(true);
      setPixelSize(s.getWidth(), s.getHeight());
    }
  }
View Full Code Here

    afterShow();
  }

  protected Point position() {
    Size viewport = XDOM.getViewportSize();

    int scrollLeft = XDOM.getBodyScrollLeft();
    int scrollTop = XDOM.getBodyScrollTop();

    int margin = config.getMargin();

    int left = 0;
    int top = 0;

    switch (config.getPosition()) {
      case TOP_LEFT:
        if (topLeft.size() == 0) {
          left = margin + scrollLeft;
          top = margin;

        } else {
          Info prev = topLeft.peek();
          top = prev.getAbsoluteTop() + prev.getOffsetHeight() + margin;
          left = prev.getAbsoluteLeft();

          int bottom = top + getOffsetHeight();

          if (bottom > viewport.getHeight()) {
            top = config.getMargin();
            left = prev.getAbsoluteLeft() + config.getWidth() + margin + scrollLeft;
          }

        }
        topLeft.add(this);
        break;
      case TOP_RIGHT:
        if (topRight.size() == 0) {
          left = viewport.getWidth() - config.getWidth() - margin + scrollLeft;
          top = config.getMargin();

        } else {
          Info prev = topRight.peek();
          top = prev.getAbsoluteTop() + prev.getOffsetHeight() + margin;
          left = prev.getAbsoluteLeft();

          int bottom = top + getOffsetHeight();

          if (bottom > viewport.getHeight()) {
            top = margin;
            left = prev.getAbsoluteLeft() - config.getWidth() - margin + scrollLeft;
          }
        }
        topRight.add(this);
        break;
      case BOTTOM_LEFT: {
        int height = config.getHeight() == -1 ? getOffsetHeight() : config.getHeight();

        if (bottomLeft.size() == 0) {
          top = viewport.getHeight() - height - margin + scrollTop;
          left = margin + scrollLeft;

        } else {
          Info prev = bottomLeft.peek();
          left = prev.getAbsoluteLeft() + scrollLeft;
          top = prev.getAbsoluteTop() - height - margin;

          if (top < 0) {
            top = viewport.getHeight() - height - margin + scrollTop;
            left = prev.getAbsoluteLeft() + prev.getOffsetWidth() + margin + scrollLeft;
          }
        }
        bottomLeft.add(this);
      }
        break;
      case BOTTOM_RIGHT: {
        int height = config.getHeight() == -1 ? getOffsetHeight() : config.getHeight();
        if (bottomRight.size() == 0) {
          top = viewport.getHeight() - height - margin - XDOM.getBodyScrollTop();
          left = viewport.getWidth() - config.getWidth() - margin + scrollLeft - XDOM.getScrollBarWidth();
        } else {
          Info prev = bottomRight.peek();
          top = prev.getAbsoluteTop() - height - margin;
          left = prev.getAbsoluteLeft() + scrollLeft;

          if (top < 0) {
            top = viewport.getHeight() - height - margin + scrollTop;
            left = prev.getAbsoluteLeft() - prev.getOffsetWidth() - margin + scrollLeft;
          }
        }
        bottomRight.add(this);
      }
View Full Code Here

  }

  @Override
  protected void doLayout() {
    if (widget != null && resize) {
      Size size = getContainerTarget().getStyleSize();

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

      int width = -1;
      if (!isAutoWidth()) {
        width = size.getWidth() - getLeftRightMargins(widget);
      }
      int height = -1;
      if (!isAutoHeight()) {
        height = size.getHeight() - getTopBottomMargins(widget);
      }
      applyLayout(widget, width, height);
    }
  }
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.