public class JRStyledText
extends java.lang.Object
implements java.lang.Cloneable
Modifier and Type | Class and Description |
---|---|
static class |
JRStyledText.Run |
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
EXCEPTION_MESSAGE_KEY_CANNOT_COPY_CHARACTERS |
static java.lang.String |
PROPERTY_AWT_IGNORE_MISSING_FONT |
Constructor and Description |
---|
JRStyledText() |
JRStyledText(java.util.Locale locale) |
JRStyledText(java.util.Locale locale,
java.lang.String text,
java.util.Map<java.text.AttributedCharacterIterator.Attribute,java.lang.Object> globalAttributes) |
Modifier and Type | Method and Description |
---|---|
void |
addRun(JRStyledText.Run run) |
void |
append(java.lang.String text) |
protected java.lang.Object |
clone() |
protected static java.util.Map<java.text.AttributedCharacterIterator.Attribute,java.lang.Object> |
cloneAttributesMap(java.util.Map<java.text.AttributedCharacterIterator.Attribute,java.lang.Object> attributes) |
JRStyledText |
cloneText()
Clones this object.
|
java.text.AttributedString |
getAttributedString() |
java.text.AttributedString |
getAwtAttributedString(boolean ignoreMissingFont)
Deprecated.
|
java.text.AttributedString |
getAwtAttributedString(JasperReportsContext jasperReportsContext,
boolean ignoreMissingFont)
Returns an attributed string that contains the AWT font attribute, as the font is actually loaded.
|
java.util.Map<java.text.AttributedCharacterIterator.Attribute,java.lang.Object> |
getGlobalAttributes() |
java.util.Locale |
getLocale() |
java.util.List<JRStyledText.Run> |
getRuns() |
java.lang.String |
getText() |
void |
insert(java.lang.String str,
short[] offsets)
Inserts a string at specified positions in the styled text.
|
int |
length() |
void |
setGlobalAttributes(java.util.Map<java.text.AttributedCharacterIterator.Attribute,java.lang.Object> attributes) |
public static final java.lang.String EXCEPTION_MESSAGE_KEY_CANNOT_COPY_CHARACTERS
public static final java.lang.String PROPERTY_AWT_IGNORE_MISSING_FONT
public JRStyledText()
public JRStyledText(java.util.Locale locale)
public JRStyledText(java.util.Locale locale, java.lang.String text, java.util.Map<java.text.AttributedCharacterIterator.Attribute,java.lang.Object> globalAttributes)
public void append(java.lang.String text)
public void addRun(JRStyledText.Run run)
public int length()
public java.lang.String getText()
public java.util.Locale getLocale()
public java.text.AttributedString getAttributedString()
public java.text.AttributedString getAwtAttributedString(boolean ignoreMissingFont)
getAwtAttributedString(JasperReportsContext, boolean)
.public java.text.AttributedString getAwtAttributedString(JasperReportsContext jasperReportsContext, boolean ignoreMissingFont)
public java.util.List<JRStyledText.Run> getRuns()
public void setGlobalAttributes(java.util.Map<java.text.AttributedCharacterIterator.Attribute,java.lang.Object> attributes)
public java.util.Map<java.text.AttributedCharacterIterator.Attribute,java.lang.Object> getGlobalAttributes()
protected java.lang.Object clone() throws java.lang.CloneNotSupportedException
clone
in class java.lang.Object
java.lang.CloneNotSupportedException
protected static java.util.Map<java.text.AttributedCharacterIterator.Attribute,java.lang.Object> cloneAttributesMap(java.util.Map<java.text.AttributedCharacterIterator.Attribute,java.lang.Object> attributes)
public JRStyledText cloneText()
public void insert(java.lang.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 string© 2001-2014 TIBCO Software Inc. www.jaspersoft.com