Examples of MoveablePoint


Examples of org.waveprotocol.wave.client.paging.Traverser.MoveablePoint

    if (block == root) {
      assertTrue(block.isPagedIn());
      return;
    }

    MoveablePoint start = SimpleMoveablePoint.startOf(block);
    MoveablePoint end = SimpleMoveablePoint.endOf(block);
    if (start.hasPrevious()) {
      start.previous();
    }
    if (end.hasNext()) {
      end.next();
    }
    Region blockRegion = RegionImpl.at(start.absoluteLocation(), end.absoluteLocation());
    // If a block has an edge on the viewport, then both paged in and paged out make sense.
    boolean exclude =
        blockRegion.getStart() == viewport.getEnd() || blockRegion.getEnd() == viewport.getStart();
    if (!exclude) {
      boolean shouldBeIn =
View Full Code Here

Examples of org.waveprotocol.wave.client.paging.Traverser.MoveablePoint

  public void testComplexNext() {
    List<Point> expected = buildComplex();
    List<Point> actual = new ArrayList<Point>();

    MoveablePoint point = SimpleMoveablePoint.startOf(root);
    actual.add(SimplePoint.at(point));
    while (point.hasNext()) {
      point.next();
      actual.add(SimplePoint.at(point));
    }

    assertEquals(expected, actual);
  }
View Full Code Here

Examples of org.waveprotocol.wave.client.paging.Traverser.MoveablePoint

  public void testComplexPrevious() {
    List<Point> expected = buildComplex();
    Collections.reverse(expected);
    List<Point> actual = new ArrayList<Point>();

    MoveablePoint point = SimpleMoveablePoint.endOf(root);
    actual.add(SimplePoint.at(point));
    while (point.hasPrevious()) {
      point.previous();
      actual.add(SimplePoint.at(point));
    }

    assertEquals(expected, actual);
  }
View Full Code Here

Examples of org.waveprotocol.wave.client.paging.Traverser.MoveablePoint

      assert areBlocksValid(root);
    }
  }

  private static boolean areBlocksValid(Block root) {
    MoveablePoint point = SimpleMoveablePoint.startOf(root);
    double lastLocation = point.absoluteLocation();
    while (point.hasNext()) {
      point.next();
      double location = point.absoluteLocation();
      assert location + 0.01 >= lastLocation : "point backtracks";
      lastLocation = location;
    }
    return true;
  }
View Full Code Here

Examples of org.waveprotocol.wave.client.paging.Traverser.MoveablePoint

      assert areBlocksValid(root);
    }
  }

  private static boolean areBlocksValid(Block root) {
    MoveablePoint point = SimpleMoveablePoint.startOf(root);
    double lastLocation = point.absoluteLocation();
    while (point.hasNext()) {
      point.next();
      double location = point.absoluteLocation();
      assert location + 0.01 >= lastLocation : "point backtracks";
      lastLocation = location;
    }
    return true;
  }
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.