/** * If fields list is not null, find and add the fields of this format to * the fields list by iterating through its AttributedCharacterIterator * * @param format * the format to find fields for * @param arg * object to format * @param begin * the index where the string this format has formatted begins */ private void handleFormat(Format format, Object arg, int begin, List<FieldContainer> fields) { if (fields == null) { return; } AttributedCharacterIterator iterator = format.formatToCharacterIterator(arg); while (iterator.getIndex() != iterator.getEndIndex()) { int start = iterator.getRunStart(); int end = iterator.getRunLimit(); Iterator<?> it = iterator.getAttributes().keySet().iterator(); while (it.hasNext()) { AttributedCharacterIterator.Attribute attribute = (AttributedCharacterIterator.Attribute) it.next(); Object value = iterator.getAttribute(attribute); fields.add(new FieldContainer(begin + start, begin + end, attribute, value)); } iterator.setIndex(end); } }
Object value = iterator.getAttribute(attribute); int runStart = iterator.getRunStart(attribute); int limit = iterator.getRunLimit(attribute); if ((value instanceof Annotation && runStart >= start && limit <= end) || (value != null && !(value instanceof Annotation))) {
while (iterator.current() != CharacterIterator.DONE) { int start = iterator.getRunStart(attribute); int limit = iterator.getRunLimit(attribute); Object value = iterator.getAttribute(attribute); if (value != null) {
.getRunLimit(TextAttribute.BIDI_EMBEDDING) - begin + 1) { Object embedding = paragraph.getAttribute(TextAttribute.BIDI_EMBEDDING);
/** * Get the index of the first character following the * run with respect to all attributes containing the current * character. */ public int getRunLimit() { return reorderedACI.getRunLimit(); }
/** * Get the index of the first character following the * run with respect to the given attributes containing the current * character. */ public int getRunLimit(Set attributes) { return reorderedACI.getRunLimit(attributes); }
/** * Get the index of the first character following the * run with respect to all attributes containing the current * character. */ public int getRunLimit() { return reorderedACI.getRunLimit(); }
/** * Get the index of the first character following the * run with respect to the given attributes containing the current * character. */ public int getRunLimit(Set attributes) { return reorderedACI.getRunLimit(attributes); }
/** * Get the index of the first character following the * run with respect to the given attribute containing the current * character. */ public int getRunLimit(AttributedCharacterIterator.Attribute attribute) { return reorderedACI.getRunLimit(attribute); }
/** * Get the index of the first character following the * run with respect to the given attribute containing the current * character. */ public int getRunLimit(AttributedCharacterIterator.Attribute attribute) { return reorderedACI.getRunLimit(attribute); }
/** * Get the index of the first character following the * run with respect to all attributes containing the current * character. */ public int getRunLimit() { return Math.min(aci.getRunLimit(), end); }
/** * Get the index of the first character following the * run with respect to the given attributes containing the current * character. */ public int getRunLimit(Set attributes) { return Math.min(aci.getRunLimit(attributes), end); }
/** * Get the index of the first character following the * run with respect to the given attributes containing the current * character. */ public int getRunLimit(Set attributes) { return Math.min(aci.getRunLimit(attributes), end); }
/** * Get the index of the first character following the * run with respect to all attributes containing the current * character. */ public int getRunLimit() { return Math.min(aci.getRunLimit(), end); }
/** * Get the index of the first character following the * run with respect to the given attributes containing the current * character. */ public int getRunLimit(Set attributes) { return Math.min(aci.getRunLimit(attributes), end); }
/** {@inheritDoc} */ public int getRunLimit(final Set<? extends Attribute> attributes) { return this.realIterators.get(this.currentList).getRunLimit(attributes) + this.currentOffset(); }
/** {@inheritDoc} */ public int getRunLimit() { return this.realIterators.get(this.currentList).getRunLimit() + this.currentOffset(); }
/** {@inheritDoc} */ public int getRunLimit(final Attribute attribute) { return this.realIterators.get(this.currentList).getRunLimit(attribute) + this.currentOffset(); }
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(""); }