Package org.apache.uima.caseditor.editor.util

Examples of org.apache.uima.caseditor.editor.util.Span


    List<AnnotationFS> selection = new ArrayList<AnnotationFS>();

    if (isSomethingSelected()) {
      Point selectedText = getSourceViewer().getTextWidget().getSelectionRange();

      Span selecectedSpan = new Span(selectedText.x, selectedText.y);

      Collection<AnnotationFS> selectedAnnotations = getAnnotation(getDocument().getCAS(),
              getAnnotationMode(), selecectedSpan);

      for (AnnotationFS annotation : selectedAnnotations) {
View Full Code Here


        Point selection = mTextWidget.getSelectionRange();

        // get old annotations of current type for this area
        // if there is something ... the delete them and add
        Collection<AnnotationFS> oldAnnotations = getAnnotation(getDocument().getCAS(),
            getAnnotationMode(), new Span(selection.x, selection.y));

        if (!oldAnnotations.isEmpty()) {
          getDocument().removeFeatureStructures(oldAnnotations);
        }
View Full Code Here

  /**
   * Test the Span.equals() method.
   */
  @Test
  public void testEquals() {
    Span a = new Span(100, 1000);
    Span b = new Span(100, 1000);

    assertEquals(a.equals(b), true);
  }
View Full Code Here

  /**
   * Test the Span.equals() method.
   */
  @Test
  public void testEqualsWithAnotherObject() {
    Span a = new Span(0, 0);

    assertFalse(Boolean.TRUE.equals(a));
  }
View Full Code Here

  /**
   * Test the Span.equals() method.
   */
  @Test
  public void testEqualsWithNull() {
    Span a = new Span(0, 0);

    assertEquals(a.equals(null), false);
  }
View Full Code Here

  /**
   * Test the Span.compareTo(Object) method.
   */
  @Test
  public void testCompareToWithBiggerSpan() {
    Span a = new Span(100, 1000);
    Span b = new Span(5000, 900);

    assertEquals(true, a.compareTo(b) > 0);
  }
View Full Code Here

  /**
   * Test the Span.compareTo(Object) method.
   */
  @Test
  public void testCompareToWithBiggerIntersectSpan() {
    Span a = new Span(100, 1000);
    Span b = new Span(900, 900);

    assertEquals(true, a.compareTo(b) > 0);
  }
View Full Code Here

  /**
   * Test the Span.compareTo(Object) method.
   */
  @Test
  public void testCompareToWithLowerSpan() {
    Span a = new Span(5000, 900);
    Span b = new Span(100, 1000);

    assertEquals(true, a.compareTo(b) < 0);
  }
View Full Code Here

  /**
   * Test the Span.compareTo(Object) method.
   */
  @Test
  public void testCompareToWithLowerIntersectSpan() {
    Span a = new Span(5000, 900);
    Span b = new Span(4900, 1000);

    assertEquals(true, a.compareTo(b) < 0);
  }
View Full Code Here

  /**
   * Test the Span.compareTo(Object) method.
   */
  @Test
  public void testCompareToEquals() {
    Span a = new Span(4900, 1000);
    Span b = new Span(4900, 1000);

    assertEquals(true, a.compareTo(b) == 0);
  }
View Full Code Here

TOP

Related Classes of org.apache.uima.caseditor.editor.util.Span

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.