iterator.setIndex(start); while (iterator.getIndex() < end) { buffer.append(iterator.current()); iterator.next();
/** * Gets the character at the current position (as returned by getIndex()). */ public char current() { return reorderedACI.current(); }
/** * Get the character at the current position (as returned * by getIndex()). * <br><b>Specified by:</b> java.text.CharacterIterator. */ public char current() { return aci.current(); }
/** * Gets the character at the current position (as returned by getIndex()). */ public char current() { return reorderedACI.current(); }
/** * Get the character at the current position (as returned * by getIndex()). * <br><b>Specified by:</b> java.text.CharacterIterator. */ public char current() { return aci.current(); }
/** * Get the character at the current position (as returned * by getIndex()). * <br><b>Specified by:</b> java.text.CharacterIterator. */ public char current() { return aci.current(); }
/** * Gets the character at the current position (as returned by getIndex()). */ public char current() { return reorderedACI.current(); }
/** {@inheritDoc} */ public char current() { return this.realIterators.get(this.currentList).current(); }
private void computePlainString() { StringBuilder sb = new StringBuilder(); char ch; AttributedCharacterIterator iterator = paragraphText.getIterator(); while((ch = iterator.current()) != AttributedCharacterIterator.DONE) { sb.append(ch); iterator.next(); } plainText = sb.toString(); }
private void computePlainString() { StringBuilder sb = new StringBuilder(); char ch; AttributedCharacterIterator iterator = paragraphText.getIterator(); while((ch = iterator.current()) != AttributedCharacterIterator.DONE) { sb.append(ch); iterator.next(); } plainText = sb.toString(); }
private void computePlainString() { StringBuilder sb = new StringBuilder(); char ch; AttributedCharacterIterator iterator = paragraphText.getIterator(); while((ch = iterator.current()) != AttributedCharacterIterator.DONE) { sb.append(ch); iterator.next(); } plainText = sb.toString(); }
protected void printAttrs(AttributedCharacterIterator aci) { aci.first(); int start = aci.getBeginIndex(); System.out.print("AttrRuns: "); while (aci.current() != CharacterIterator.DONE) { int end = aci.getRunLimit(); System.out.print(""+(end-start)+", "); aci.setIndex(end); start = end; } System.out.println(""); }
protected void printAttrs(AttributedCharacterIterator aci) { aci.first(); int start = aci.getBeginIndex(); System.out.print("AttrRuns: "); while (aci.current() != CharacterIterator.DONE) { int end = aci.getRunLimit(); System.out.print(""+(end-start)+", "); aci.setIndex(end); start = end; } System.out.println(""); }
@Override public void drawString(AttributedCharacterIterator iterator, int x, int y) { StringBuilder builder = new StringBuilder(iterator.getEndIndex() - iterator.getBeginIndex()); while (iterator.next() != AttributedCharacterIterator.DONE) { builder.append(iterator.current()); } drawString(builder.toString(), x, y); }
@Override public void drawString(AttributedCharacterIterator iterator, int x, int y) { StringBuilder builder = new StringBuilder(iterator.getEndIndex() - iterator.getBeginIndex()); while (iterator.next() != AttributedCharacterIterator.DONE) { builder.append(iterator.current()); } drawString(builder.toString(), x, y); }
protected void printAttrs(AttributedCharacterIterator aci) { aci.first(); int start = aci.getBeginIndex(); System.out.print("AttrRuns: "); while (aci.current() != CharacterIterator.DONE) { int end = aci.getRunLimit(); System.out.print(""+(end-start)+", "); aci.setIndex(end); start = end; } System.out.println(""); }
/** * Collects all characters from an {@link AttributedCharacterIterator}. * @param runaci the character iterator * @return the characters */ protected CharSequence collectCharacters(AttributedCharacterIterator runaci) { StringBuffer chars = new StringBuffer(); for (runaci.first(); runaci.getIndex() < runaci.getEndIndex();) { chars.append(runaci.current()); runaci.next(); } return chars; }
private static int char32AtAndAdvance(AttributedCharacterIterator iterator) { char c1 = iterator.current(); char c2 = iterator.next(); if (UCharacter.isHighSurrogate(c1)) { // If c2 is DONE, it will fail the low surrogate test and we // skip this block. if (UCharacter.isLowSurrogate(c2)) { iterator.next(); return UCharacter.toCodePoint(c1, c2); } } return c1; }
public void append(String text, Color foreground) { AttributedString replacementText = new AttributedString(plainText + text); replacementText.addAttributes(paragraphText.getIterator().getAttributes(), 0, plainText.length()); AttributedCharacterIterator charIt = paragraphText.getIterator(); while(charIt.current() != AttributedCharacterIterator.DONE) { replacementText.addAttributes(charIt.getAttributes(), charIt.getIndex(), charIt.getEndIndex() + 1); charIt.next(); } replacementText.addAttribute(TextAttribute.FOREGROUND, foreground, plainText.length(), plainText.length() + text.length()); paragraphText = replacementText; computePlainString(); invalidateLayout(); }