Package java.text

Examples of java.text.AttributedCharacterIterator.last()


   */
  public void test_last() {
    String test = "Test 23ring";
    AttributedString attrString = new AttributedString(test);
    AttributedCharacterIterator it = attrString.getIterator();
    assertEquals("Wrong last1", 'g', it.last());
    it = attrString.getIterator(null, 0, 3);
    assertEquals("Wrong last2", 's', it.last());
    it = attrString.getIterator(null, 2, 8);
    assertEquals("Wrong last3", 'r', it.last());
    it = attrString.getIterator(null, 0, 0);
View Full Code Here


    String test = "Test 23ring";
    AttributedString attrString = new AttributedString(test);
    AttributedCharacterIterator it = attrString.getIterator();
    assertEquals("Wrong last1", 'g', it.last());
    it = attrString.getIterator(null, 0, 3);
    assertEquals("Wrong last2", 's', it.last());
    it = attrString.getIterator(null, 2, 8);
    assertEquals("Wrong last3", 'r', it.last());
    it = attrString.getIterator(null, 0, 0);
    assertTrue("Wrong last4", it.last() == CharacterIterator.DONE);
  }
View Full Code Here

    AttributedCharacterIterator it = attrString.getIterator();
    assertEquals("Wrong last1", 'g', it.last());
    it = attrString.getIterator(null, 0, 3);
    assertEquals("Wrong last2", 's', it.last());
    it = attrString.getIterator(null, 2, 8);
    assertEquals("Wrong last3", 'r', it.last());
    it = attrString.getIterator(null, 0, 0);
    assertTrue("Wrong last4", it.last() == CharacterIterator.DONE);
  }

  /**
 
View Full Code Here

    it = attrString.getIterator(null, 0, 3);
    assertEquals("Wrong last2", 's', it.last());
    it = attrString.getIterator(null, 2, 8);
    assertEquals("Wrong last3", 'r', it.last());
    it = attrString.getIterator(null, 0, 0);
    assertTrue("Wrong last4", it.last() == CharacterIterator.DONE);
  }

  /**
   * @tests java.text.AttributedCharacterIterator#next()
   */
 
View Full Code Here

        TextSpanLayout lastLayout =
            ((TextRun)textRuns.get(textRuns.size()-1)).getLayout();

        int lastGlyphIndex = lastLayout.getGlyphCount()-1;
        aci.last();

        int charIndex = ((Integer)aci.getAttribute(GVTAttributedCharacterIterator.TextAttribute.CHAR_INDEX)).intValue();
        TextHit textHit = new TextHit(charIndex, false);
        return  new BasicTextPainter.BasicMark(node, lastLayout, textHit);
    }
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.