Package org.waveprotocol.wave.model.util

Examples of org.waveprotocol.wave.model.util.IntRange


      return null;
    }

    if (DomHelper.isTextNode(node)) {
      Element parentElement = node.getParentElement();
      return new IntRange(parentElement.getAbsoluteTop(), parentElement.getAbsoluteBottom());
    } else {
      Element e = node.<Element>cast();
      return new IntRange(e.getAbsoluteTop(), e.getAbsoluteBottom());
    }
  }
View Full Code Here


  }

  @Override
  public IntRange getFocusBounds() {
    // NOTE(user): Consider returning the bottom here as well in the range.
    return new IntRange(getFocusPosition().top);
  }
View Full Code Here

  public void onUpdate(EditorUpdateEvent event) {
    // Check isEditing to prevent code from running during session teardown.
    if (isEditing() && event.selectionCoordsChanged()) {
      // First use a non-invasive approach for discovering the focus location.
      // This query does not mutate the DOM, so will not force a layout cycle.
      IntRange r = NativeSelectionUtil.getFocusBounds();
      if (r != null) {
        double focusStartInScreen = r.getFirst();
        double focusEndInScreen = r.getSecond();
        double viewportStartInScreen = measurer.top(null, viewport);
        double viewportEndInScreen = measurer.bottom(null, viewport);
        if (viewportStartInScreen < focusStartInScreen - PAD_PX
            && focusEndInScreen + PAD_PX < viewportEndInScreen) {
          // All ok.
View Full Code Here

      return null;
    }

    if (DomHelper.isTextNode(node)) {
      Element parentElement = node.getParentElement();
      return new IntRange(parentElement.getAbsoluteTop(), parentElement.getAbsoluteBottom());
    } else {
      Element e = node.<Element>cast();
      return new IntRange(e.getAbsoluteTop(), e.getAbsoluteBottom());
    }
  }
View Full Code Here

  public void onUpdate(EditorUpdateEvent event) {
    // Check isEditing to prevent code from running during session teardown.
    if (isEditing() && event.selectionCoordsChanged()) {
      // First use a non-invasive approach for discovering the focus location.
      // This query does not mutate the DOM, so will not force a layout cycle.
      IntRange r = NativeSelectionUtil.getFocusBounds();
      if (r != null) {
        double focusStartInScreen = r.getFirst();
        double focusEndInScreen = r.getSecond();
        double viewportStartInScreen = measurer.top(null, viewport);
        double viewportEndInScreen = measurer.bottom(null, viewport);
        if (viewportStartInScreen < focusStartInScreen - PAD_PX
            && focusEndInScreen + PAD_PX < viewportEndInScreen) {
          // All ok.
View Full Code Here

  }

  @Override
  public IntRange getFocusBounds() {
    // NOTE(user): Consider returning the bottom here as well in the range.
    return new IntRange(getFocusPosition().top);
  }
View Full Code Here

TOP

Related Classes of org.waveprotocol.wave.model.util.IntRange

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.