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

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


   */
  public void show() {
    if (!fireCancellableEvent(new BeforeShowEvent())) {
      return;
    }
    Point p = new Point((int) Window.getClientWidth() / 2, (int) Window.getClientHeight() / 2);
    showAt(p.getX(), p.getY());
  }
View Full Code Here


   */
  public void showAt(int x, int y) {
    if (!fireCancellableEvent(new BeforeShowEvent())) {
      return;
    }
    alignPoint = new Point(x, y);
    onShowPopup();
  }
View Full Code Here

  protected Popup onShowPopup() {
    RootPanel.get().add(this);

    hidden = false;
    Point p = null;

    if (alignElem != null) {
      alignPos = alignPos != null ? alignPos : getDefaultAlign();
      alignOffsets = alignOffsets != null ? alignOffsets : new int[] {0, 2};
      p = getElement().getAlignToXY(alignElem, alignPos, alignOffsets);
    } else if (alignPoint != null) {
      p = alignPoint;
    }
    getElement().makePositionable(true);
    getElement().setVisibility(false);

    getElement().setLeftTop(p.getX(), p.getY());

    alignElem = null;
    alignPos = null;
    alignOffsets = null;
    alignPoint = null;
View Full Code Here

    showing = true;
    doAutoSize();

    if (constrainViewport) {
      Point p = getElement().adjustForConstraints(new Point(x, y));
      x = p.getX();
      y = p.getY();
    }
    setPagePosition(x + XDOM.getBodyScrollLeft(), y + XDOM.getBodyScrollTop());
    if (enableScrolling) {
      constrainScroll(y);
    }
View Full Code Here

  @Override
  protected boolean shouldDeactivate(NativeEvent ce) {
    if (super.shouldDeactivate(ce)) {
      if (subMenu != null && subMenu.isVisible()) {
        Point xy = ce.<XEvent> cast().getXY();
        xy.setX(xy.getX() + XDOM.getBodyScrollLeft());
        xy.setY(xy.getY() + XDOM.getBodyScrollTop());

        Rectangle rec = subMenu.getElement().getBounds();
        if (getLayer(subMenu) != null) {
          Layer l = getLayer(subMenu);
          if (l.isShim() && l.isShadow()) {
View Full Code Here

      return allow;
    }

    private void positionTip(NativeEvent e) {
      Point thumbPosition = appearance.getThumb(parent).<XElement> cast().getPosition(false);

      int x = thumbPosition.getX();
      int y = thumbPosition.getY();

      XElement p = XElement.as(parent);
      int v = setValue(p, reverseValue(p, appearance.getClickedValue(context, p, e)));
      tip.getAppearance().getTextElement(tip.getElement()).setInnerText(onFormatValue(v));

      tip.showAt(-5000, -5000);
      int w = tip.getOffsetWidth();
      int h = tip.getOffsetHeight();

      if (!vertical) {
        boolean top = y > 35;
        if (top) {
          thumbPosition.setX(x - (w / 2) + (thumbWidth / 2));
          thumbPosition.setY(y - h - 5);

        } else {
          thumbPosition.setX(x - (w / 2) + (thumbWidth / 2));
          thumbPosition.setY(y + thumbHeight + 5);
        }
      } else {
        int vleft = Window.getClientWidth();
        boolean right = x < (vleft - 30);
        if (right) {
          thumbPosition.setX(parent.getAbsoluteLeft() + parent.getOffsetWidth() + 5);
          thumbPosition.setY(Math.max(0, y - (h / 2)));
        } else {
          thumbPosition.setX(parent.getAbsoluteLeft() - w - 5);
          thumbPosition.setY(Math.max(0, y - (h / 2)));
        }
      }

      tip.showAt(thumbPosition);
    }
View Full Code Here

   * @param alignment the position to align to (see {@link XElement#alignTo} for
   *          more details)
   * @param offsets the offsets
   */
  public void alignTo(Element elem, AnchorAlignment alignment, int[] offsets) {
    Point p = getElement().getAlignToXY(elem, alignment, offsets);
    setPagePosition(p.getX(), p.getY());
  }
View Full Code Here

  /**
   * Centers the window in the viewport. Should only be called when the window
   * is visible.
   */
  public void center() {
    Point p = getElement().getAlignToXY(Document.get().getBody(), new AnchorAlignment(Anchor.CENTER, Anchor.CENTER),
        null);
    setPagePosition(p.getX(), p.getY());
  }
View Full Code Here

    hidden = true;

    if (!maximized) {
      restoreSize = getElement().getSize();
      restorePos = new Point(getElement().getLeft(), getElement().getTop());
    }

    if (modalPreview != null) {
      modalPreview.removeHandler();
      modalPreview = null;
View Full Code Here

    if (isVisible()) {
      if (maximized) {
        fitContainer();
      } else {
        if (constrain) {
          Point p = getElement().adjustForConstraints(getElement().getPosition(false));
          setPagePosition(p.getX(), p.getY());
        }
      }
    }
  }
View Full Code Here

TOP

Related Classes of com.sencha.gxt.core.client.util.Point

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.