Package net.sf.jasperreports.engine.util
Class JRStyledText
java.lang.Object
net.sf.jasperreports.engine.util.JRStyledText
- All Implemented Interfaces:
Cloneable
- Author:
- Teodor Danciu (teodord@users.sourceforge.net)
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionJRStyledText
(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) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addRun
(JRStyledText.Run run) void
protected Object
clone()
protected static Map
<AttributedCharacterIterator.Attribute, Object> cloneAttributesMap
(Map<AttributedCharacterIterator.Attribute, Object> attributes) Clones this object.void
consumeText
(StyledTextRunConsumer consumer) protected AttributedString
getAwtAttributedString
(Supplier<FontUtil> fontUtilSupplier, boolean ignoreMissingFont) getAwtAttributedString
(FontUtil fontUtil, boolean ignoreMissingFont) Returns an attributed string that contains the AWT font attribute, as the font is actually loaded.getAwtAttributedString
(JasperReportsContext jasperReportsContext, boolean ignoreMissingFont) Returns an attributed string that contains the AWT font attribute, as the font is actually loaded.getRuns()
getText()
void
Inserts a string at specified positions in the styled text.int
length()
void
-
Field Details
-
EXCEPTION_MESSAGE_KEY_CANNOT_COPY_CHARACTERS
- See Also:
-
PROPERTY_AWT_IGNORE_MISSING_FONT
- See Also:
-
PROPERTY_AWT_SUPERSCRIPT_FIX_ENABLED
- See Also:
-
-
Constructor Details
-
JRStyledText
public JRStyledText() -
JRStyledText
-
JRStyledText
-
JRStyledText
public JRStyledText(Locale locale, String text, Map<AttributedCharacterIterator.Attribute, Object> globalAttributes) -
JRStyledText
public JRStyledText(Locale locale, String text, Map<AttributedCharacterIterator.Attribute, Object> globalAttributes, List<JRStyledText.Run> runs)
-
-
Method Details
-
append
-
addRun
-
length
public int length() -
getText
-
getLocale
-
getAttributedString
-
consumeText
-
getAwtAttributedString
Returns an attributed string that contains the AWT font attribute, as the font is actually loaded. -
getAwtAttributedString
public AttributedString getAwtAttributedString(JasperReportsContext jasperReportsContext, boolean ignoreMissingFont) Returns an attributed string that contains the AWT font attribute, as the font is actually loaded. -
getAwtAttributedString
protected AttributedString getAwtAttributedString(Supplier<FontUtil> fontUtilSupplier, boolean ignoreMissingFont) -
getRuns
-
setGlobalAttributes
-
getGlobalAttributes
-
clone
- Overrides:
clone
in classObject
- Throws:
CloneNotSupportedException
-
cloneAttributesMap
protected static Map<AttributedCharacterIterator.Attribute,Object> cloneAttributesMap(Map<AttributedCharacterIterator.Attribute, Object> attributes) -
cloneText
Clones this object.- Returns:
- a clone of this object
-
insert
Inserts a string at specified positions in the styled text.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).
- Parameters:
str
- the string to insertoffsets
- the incremental offsets of the positions at which to insert the string
-