Package com.google.collide.shared.document

Examples of com.google.collide.shared.document.LineInfo.number()


    LineInfo curLine = start.getLineInfo();
    curLine.moveTo(iterateForward);

    while (curLine.line() != end.getLine()) {
      if (!lineVisitor.accept(curLine.line(), curLine.number(), 0, curLine.line().length())) {
        return;
      }

      if (!curLine.moveTo(iterateForward)) {
        throw new IllegalStateException(
View Full Code Here


    if (beginLineNumber <= viewport.getBottomLineNumber()) {
      // Only fill or update lines if the content change affects the viewport
      LineInfo beginLine =
          viewport.getDocument().getLineFinder().findLine(viewport.getBottom(), beginLineNumber);
      animationController.onBeforeAnimationStarted();
      fillOrUpdateLines(beginLine.line(), beginLine.number(), viewport.getBottomLine(),
          viewport.getBottomLineNumber(), createOffset);
    }
  }

  void renderViewportLineNumbersChanged(EnumSet<Edge> changedEdges) {
View Full Code Here

       * Collaborator added/removed lines above us, update the viewport lines
       * since their tops may have changed
       */
      LineInfo top = viewport.getTop();
      LineInfo bottom = viewport.getBottom();
      fillOrUpdateLines(top.line(), top.number(), bottom.line(), bottom.number(), 0);
    }
  }
 
  /**
   * Renders changes to the viewport positioning.
View Full Code Here

        viewportOldBottomAnchor != null ? viewportOldBottomAnchor.getLineInfo() : null;

    LineInfo top = viewport.getTop();
    LineInfo bottom = viewport.getBottom();

    if (oldTop == null || oldBottom == null || bottom.number() < oldTop.number()
        || top.number() > oldBottom.number() || forceRerender) {
      /*
       * The viewport does not overlap with its old position, GC old lines and
       * render all of the new ones (or we are forced to rerender everything)
       */
 
View Full Code Here

       */
      if (oldTop != null && oldBottom != null) {
        garbageCollectLines(oldTop.line(), oldTop.number(), oldBottom.line(), oldBottom.number());
      }

      fillOrUpdateLines(top.line(), top.number(), bottom.line(), bottom.number(), 0);

    } else {
      // There is some overlap, so be more efficient with our update
      if (oldTop.number() < top.number()) {
        // The viewport moved down, need to GC the offscreen lines
View Full Code Here

        // The viewport moved up, need to fill with lines
        fillOrUpdateLines(top.line(), top.number(), oldTop.line().getPreviousLine(),
            oldTop.number() - 1, 0);
      }

      if (oldBottom.number() < bottom.number()) {
        // The viewport moved down, need to fill with lines
        fillOrUpdateLines(oldBottom.line().getNextLine(), oldBottom.number() + 1, bottom.line(),
            bottom.number(), 0);
      } else if (oldBottom.number() > bottom.number()) {
        // The viewport moved up, need to GC the offscreen lines
View Full Code Here

      }

      if (oldBottom.number() < bottom.number()) {
        // The viewport moved down, need to fill with lines
        fillOrUpdateLines(oldBottom.line().getNextLine(), oldBottom.number() + 1, bottom.line(),
            bottom.number(), 0);
      } else if (oldBottom.number() > bottom.number()) {
        // The viewport moved up, need to GC the offscreen lines
        garbageCollectLines(bottom.line().getNextLine(), bottom.number() + 1, oldBottom.line(),
            oldBottom.number());
      }
View Full Code Here

      if (oldBottom.number() < bottom.number()) {
        // The viewport moved down, need to fill with lines
        fillOrUpdateLines(oldBottom.line().getNextLine(), oldBottom.number() + 1, bottom.line(),
            bottom.number(), 0);
      } else if (oldBottom.number() > bottom.number()) {
        // The viewport moved up, need to GC the offscreen lines
        garbageCollectLines(bottom.line().getNextLine(), bottom.number() + 1, oldBottom.line(),
            oldBottom.number());
      }
    }
View Full Code Here

        // The viewport moved down, need to fill with lines
        fillOrUpdateLines(oldBottom.line().getNextLine(), oldBottom.number() + 1, bottom.line(),
            bottom.number(), 0);
      } else if (oldBottom.number() > bottom.number()) {
        // The viewport moved up, need to GC the offscreen lines
        garbageCollectLines(bottom.line().getNextLine(), bottom.number() + 1, oldBottom.line(),
            oldBottom.number());
      }
    }
  }
View Full Code Here

    int lineNumber = buffer.convertYToLineNumber(y, true);
    LineInfo newLineInfo =
        document.getLineFinder().findLine(cursorAnchor.getLineInfo(), lineNumber);

    // Only move the cursor
    if (viewport.isLineNumberFullyVisibleInViewport(newLineInfo.number())) {
      moveCursorUsingSelectionGranularity(newLineInfo, x, false);
    }
    manageRepeaterForDrag(x, y);
  }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.