public class JRStyledText extends Object implements Cloneable
Modifier and Type | Class and Description |
---|---|
static class |
JRStyledText.Run |
Modifier and Type | Field and Description |
---|---|
static String |
EXCEPTION_MESSAGE_KEY_CANNOT_COPY_CHARACTERS |
static String |
PROPERTY_AWT_IGNORE_MISSING_FONT |
static String |
PROPERTY_AWT_SUPERSCRIPT_FIX_ENABLED |
Constructor and Description |
---|
JRStyledText() |
JRStyledText(Locale locale) |
JRStyledText(Locale locale,
String text) |
JRStyledText(Locale locale,
String text,
Map<AttributedCharacterIterator.Attribute,Object> globalAttributes) |
JRStyledText(Locale locale,
String text,
Map<AttributedCharacterIterator.Attribute,Object> globalAttributes,
List<JRStyledText.Run> runs) |
public static final String EXCEPTION_MESSAGE_KEY_CANNOT_COPY_CHARACTERS
public static final String PROPERTY_AWT_IGNORE_MISSING_FONT
public static final String PROPERTY_AWT_SUPERSCRIPT_FIX_ENABLED
public JRStyledText()
public JRStyledText(Locale locale)
public JRStyledText(Locale locale, String text, Map<AttributedCharacterIterator.Attribute,Object> globalAttributes)
public JRStyledText(Locale locale, String text, Map<AttributedCharacterIterator.Attribute,Object> globalAttributes, List<JRStyledText.Run> runs)
public void append(String text)
public void addRun(JRStyledText.Run run)
public int length()
public String getText()
public Locale getLocale()
public AttributedString getAttributedString()
public void consumeText(StyledTextRunConsumer consumer)
public AttributedString getAwtAttributedString(JasperReportsContext jasperReportsContext, boolean ignoreMissingFont)
public List<JRStyledText.Run> getRuns()
public void setGlobalAttributes(Map<AttributedCharacterIterator.Attribute,Object> attributes)
public Map<AttributedCharacterIterator.Attribute,Object> getGlobalAttributes()
protected Object clone() throws CloneNotSupportedException
clone
in class Object
CloneNotSupportedException
protected static Map<AttributedCharacterIterator.Attribute,Object> cloneAttributesMap(Map<AttributedCharacterIterator.Attribute,Object> attributes)
public JRStyledText cloneText()
public void insert(String str, short[] offsets)
The string is inserted in the style runs located at the insertion positions. If a style run finished right before the insertion position, the string will be part of this run (but not of the runs that start right after the insertion position).
str
- the string to insertoffsets
- the incremental offsets of the positions at which to
insert the stringCopyright © 2023 Cloud Software Group, Inc.. All rights reserved.