/** * * @return the string to be painted */ public String getString(){ if (str == null) return ""; AttributedCharacterIterator it = str.getIterator(); StringBuilder buf = new StringBuilder(); for (char c = it.first(); c != CharacterIterator.DONE; c = it.next()) { buf.append(c); } return buf.toString(); }
boolean doneMillis = false; for (char ch = it.first(); ch != CharacterIterator.DONE; ch = it.next()) {
charIterator.first();
/** * Sets the position to getBeginIndex() and returns the character at * that position. */ public char first() { return reorderedACI.first(); }
/** * Sets the position to getBeginIndex() and returns the character at * that position. */ public char first() { return reorderedACI.first(); }
/** * Sets the position to getBeginIndex() and returns the character at * that position. */ public char first() { return reorderedACI.first(); }
/** {@inheritDoc} */ public char first() { this.currentList = 0; return this.realIterators.get(this.currentList).first(); }
private static String uncommittedChars(@Nullable AttributedCharacterIterator text) { if (text == null) { return null; } StringBuilder sb = new StringBuilder(); for (char c = text.first(); c != CharacterIterator.DONE; c = text.next()) { if (c >= 0x20 && c != 0x7F) { // Hack just like in javax.swing.text.DefaultEditorKit.DefaultKeyTypedAction sb.append(c); } } return sb.toString(); }
/** * Returns true if the text direction in this layout is from left to right. */ public boolean isLeftToRight() { aci.first(); int bidiLevel = (Integer) aci.getAttribute (GVTAttributedCharacterIterator.TextAttribute.BIDI_LEVEL); // Check if low bit is set if not then we are left to right // (even bidi level). return ((bidiLevel&0x01) == 0); }
/** * Returns true if the text direction in this layout is from left to right. */ public boolean isLeftToRight() { aci.first(); int bidiLevel = (Integer) aci.getAttribute (GVTAttributedCharacterIterator.TextAttribute.BIDI_LEVEL); // Check if low bit is set if not then we are left to right // (even bidi level). return ((bidiLevel&0x01) == 0); }
/** {@inheritDoc} */ public char next() { char c = this.realIterators.get(this.currentList).next(); while ((c == CharacterIterator.DONE) && (this.currentList < this.realIterators.size() - 1)) { this.currentList++; c = this.realIterators.get(this.currentList).first(); } return c; }
@Override public void drawString(AttributedCharacterIterator iterator, float x, float y) { // TODO Draw styled text StringBuilder buf = new StringBuilder(); for (char c = iterator.first(); c != AttributedCharacterIterator.DONE; c = iterator.next()) { buf.append(c); } drawString(buf.toString(), x, y); }
private void put(AttributedCharacterIterator iterator) { if (iterator == null) { put((String) null); } else { StringBuilder sb = new StringBuilder(); for (char c = iterator.first(); c != CharacterIterator.DONE; c = iterator.next()) { sb.append(c); } put(sb.toString()); } }
/** * Returns whether or not the vertical glyph orientation value is "auto". */ protected boolean isGlyphOrientationAuto() { if (!isVertical()) return false; aci.first(); Integer vOrient = (Integer)aci.getAttribute(VERTICAL_ORIENTATION); if (vOrient != null) { return (vOrient == ORIENTATION_AUTO); } return true; }
/** * Returns whether or not the vertical glyph orientation value is "auto". */ protected boolean isGlyphOrientationAuto() { if (!isVertical()) return false; aci.first(); Integer vOrient = (Integer)aci.getAttribute(VERTICAL_ORIENTATION); if (vOrient != null) { return (vOrient == ORIENTATION_AUTO); } return true; }
/** * Returns whether or not the vertical glyph orientation value is "auto". */ protected boolean isGlyphOrientationAuto() { if (!isVertical()) return false; aci.first(); Integer vOrient = (Integer)aci.getAttribute(VERTICAL_ORIENTATION); if (vOrient != null) { return (vOrient == ORIENTATION_AUTO); } return true; }
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 List computeTextRuns(TextNode node, AttributedCharacterIterator nodeACI, AttributedCharacterIterator [] chunkACIs) { nodeACI.first(); int defaultBidiLevel = (((Integer) nodeACI.getAttribute(WRITING_MODE)).intValue() == WRITING_MODE_RTL) ? 1 : 0; for (int i = 0, n = chunkACIs.length; i < n; ++i) { chunkACIs[i] = new BidiAttributedCharacterIterator(chunkACIs[i], defaultBidiLevel); } return super.computeTextRuns(node, nodeACI, chunkACIs, null); }