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

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


  private Point getTargetXY(int targetCounter) {
    if (toolTipConfig.getAnchor() != null) {
      targetCounter++;
      int[] offsets = getOffsets();
      Point xy = (toolTipConfig.isAnchorToTarget() && !toolTipConfig.isTrackMouse()) ? getElement().getAlignToXY(
          target.getElement(), getAnchorAlign(), null) : targetXY;

      int dw = XDOM.getViewWidth(false) - 5;
      int dh = XDOM.getViewHeight(false) - 5;
      int scrollX = XDOM.getBodyScrollLeft() + 5;
      int scrollY = XDOM.getBodyScrollTop() + 5;

      int[] axy = new int[] {xy.getX() + offsets[0], xy.getY() + offsets[1]};
      Size sz = getElement().getSize();
      Region r = XElement.as(target.getElement()).getRegion();

      appearance.removeAnchorStyle(anchorEl);

      // if we are not inside valid ranges we try to switch the anchor
      if (!((toolTipConfig.getAnchor() == Side.TOP && (sz.getHeight() + offsets[1] + scrollY < dh - r.getBottom()))
          || (toolTipConfig.getAnchor() == Side.RIGHT && (sz.getWidth() + offsets[0] + scrollX < r.getLeft()))
          || (toolTipConfig.getAnchor() == Side.BOTTOM && (sz.getHeight() + offsets[1] + scrollY < r.getTop())) || (toolTipConfig.getAnchor() == Side.LEFT && (sz.getWidth()
          + offsets[0] + scrollX < dw - r.getRight())))
          && targetCounter < 4) {
        if (sz.getWidth() + offsets[0] + scrollX < dw - r.getRight()) {
          toolTipConfig.setAnchor(Side.LEFT);
          return getTargetXY(targetCounter);
        }
        if (sz.getWidth() + offsets[0] + scrollX < r.getLeft()) {
          toolTipConfig.setAnchor(Side.RIGHT);
          return getTargetXY(targetCounter);
        }
        if (sz.getHeight() + offsets[1] + scrollY < dh - r.getBottom()) {
          toolTipConfig.setAnchor(Side.TOP);
          return getTargetXY(targetCounter);
        }
        if (sz.getHeight() + offsets[1] + scrollY < r.getTop()) {
          toolTipConfig.setAnchor(Side.BOTTOM);
          return getTargetXY(targetCounter);
        }
      }

      appearance.applyAnchorDirectionStyle(anchorEl, toolTipConfig.getAnchor());

      targetCounter = 0;
      return new Point(axy[0], axy[1]);

    } else {
      int x = targetXY.getX();
      int y = targetXY.getY();

      int[] mouseOffset = toolTipConfig.getMouseOffset();
      if (mouseOffset != null) {
        x += mouseOffset[0];
        y += mouseOffset[1];
      }
      return new Point(x, y);
    }

  }
View Full Code Here


    getElement().setInnerHTML(sb.toSafeHtml().asString());

    XElement target = appearance.getContentElement(getElement());
    target.setInnerHTML(config.render(this).asString());

    Point p = position();
    getElement().setLeftTop(p.getX(), p.getY());
    getElement().updateZIndex(0);

    slots.add(this);

    setWidth(config.getWidth());
View Full Code Here

    if (slots.size() > 0) {
      Info bottom = slots.peek();
      top = bottom.getAbsoluteTop() + bottom.getOffsetHeight() + 20;
    }

    return new Point(left, top);
  }
View Full Code Here

        logger.finest("doLayout");
      }
      XElement con = getContainerTarget();
      XElement e = widget.getElement().cast();
      e.makePositionable(true);
      Point p = e.getAlignToXY(con, new AnchorAlignment(Anchor.CENTER, Anchor.CENTER), null);
      p = e.translatePoints(p);
      applyLayout(widget, new Rectangle(p.getX(), p.getY(), -1, -1));
    }
  }
View Full Code Here

   * Returns the mouse location.
   *
   * @return the mouse location
   */
  public final Point getXY() {
    return new Point(getClientX(), getClientY());
  }
View Full Code Here

          con.add(w);
          adj = 0;
        }
      }

      Point p = XElement.as(getEditableGrid().getView().getRow(cell.getRow())).getXY();
      rowEditor.setPagePosition(p.getX(), p.getY());

      verifyLayout();

      startMonitoring();
      focusField(activeCell);
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.