/** * 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); } }
/** * Returns a map with the attributes defined on the current * character. */ public Map getAttributes() { return reorderedACI.getAttributes(); }
/** * Returns a map with the attributes defined on the current * character. */ public Map getAttributes() { return aci.getAttributes(); }
/** * Returns a map with the attributes defined on the current * character. */ public Map getAttributes() { return reorderedACI.getAttributes(); }
/** * Returns a map with the attributes defined on the current * character. */ public Map getAttributes() { return aci.getAttributes(); }
/** * Returns a map with the attributes defined on the current * character. */ public Map getAttributes() { return aci.getAttributes(); }
/** * Returns a map with the attributes defined on the current * character. */ public Map getAttributes() { return reorderedACI.getAttributes(); }
public Map<AttributedCharacterIterator.Attribute, Object> getAttributes() { return aci.getAttributes(); }
/** {@inheritDoc} */ public Map<Attribute, Object> getAttributes() { return this.realIterators.get(this.currentList).getAttributes(); }
/** * Derives a GVTFont object of the correct size. * * @param size The required size of the derived font. * @param aci The character iterator containing the text to be rendered * using the derived font. * * @return The derived font. */ public GVTFont deriveFont(float size, AttributedCharacterIterator aci) { return deriveFont(size, aci.getAttributes()); }
@Override public GVTFont deriveFont(float sz, AttributedCharacterIterator arg1) { return deriveFont(sz, arg1.getAttributes()); }
/** * Derives a GVTFont object of the correct size. * * @param size The required size of the derived font. * @param aci The character iterator containing the text to be rendered * using the derived font. * * @return The derived font. */ public GVTFont deriveFont(float size, AttributedCharacterIterator aci) { return deriveFont(size, aci.getAttributes()); }
/** * Derives a GVTFont object of the correct size. * * @param size The required size of the derived font. * @param aci The character iterator containing the text to be rendered * using the derived font. * * @return The derived font. */ public GVTFont deriveFont(float size, AttributedCharacterIterator aci) { return deriveFont(size, aci.getAttributes()); }
/** * Derives a GVTFont object of the correct size. * * @param size The required size of the derived font. * @param aci The character iterator that will be rendered using * the derived font. */ public GVTFont deriveFont(float size, AttributedCharacterIterator aci) { if (font != null) return new AWTGVTFont(font, size); return deriveFont(size, aci.getAttributes()); }
/** * Derives a GVTFont object of the correct size. * * @param size The required size of the derived font. * @param aci The character iterator that will be rendered using * the derived font. */ public GVTFont deriveFont(float size, AttributedCharacterIterator aci) { if (font != null) return new AWTGVTFont(font, size); return deriveFont(size, aci.getAttributes()); }
/** * Derives a GVTFont object of the correct size. * * @param size The required size of the derived font. * @param aci The character iterator that will be rendered using * the derived font. */ public GVTFont deriveFont(float size, AttributedCharacterIterator aci) { if (font != null) return new AWTGVTFont(font, size); return deriveFont(size, aci.getAttributes()); }
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(); }
/** * */ protected void exportStyledText(JRStyledText styledText) throws IOException { String text = styledText.getText(); int runLimit = 0; AttributedCharacterIterator iterator = styledText.getAttributedString().getIterator(); while(runLimit < styledText.length() && (runLimit = iterator.getRunLimit()) <= styledText.length()) { exportStyledTextRun(iterator.getAttributes(), text.substring(iterator.getIndex(), runLimit)); iterator.setIndex(runLimit); } }
/** * */ protected void exportStyledText(JRStyledText styledText) throws IOException { String text = styledText.getText(); int runLimit = 0; AttributedCharacterIterator iterator = styledText.getAttributedString().getIterator(); while(runLimit < styledText.length() && (runLimit = iterator.getRunLimit()) <= styledText.length()) { exportStyledTextRun(iterator.getAttributes(), text.substring(iterator.getIndex(), runLimit)); iterator.setIndex(runLimit); } }
/** * */ protected void exportStyledText(JRStyle style, JRStyledText styledText) throws IOException { String text = styledText.getText(); int runLimit = 0; AttributedCharacterIterator iterator = styledText.getAttributedString().getIterator(); while(runLimit < styledText.length() && (runLimit = iterator.getRunLimit()) <= styledText.length()) { runHelper.export(style, iterator.getAttributes(), text.substring(iterator.getIndex(), runLimit)); iterator.setIndex(runLimit); } }