net.sf.jasperreports.engine.util
Class JRStyledText

java.lang.Object
  extended by net.sf.jasperreports.engine.util.JRStyledText
All Implemented Interfaces:
Cloneable

public class JRStyledText
extends Object
implements Cloneable

Version:
$Id: JRStyledText.java 5180 2012-03-29 13:23:12Z teodord $
Author:
Teodor Danciu (teodord@users.sourceforge.net)

Nested Class Summary
static class JRStyledText.Run
           
 
Field Summary
static String PROPERTY_AWT_IGNORE_MISSING_FONT
           
 
Constructor Summary
JRStyledText()
           
JRStyledText(Locale locale)
           
 
Method Summary
 void addRun(JRStyledText.Run run)
           
 void append(String text)
           
protected  Object clone()
           
protected static Map<AttributedCharacterIterator.Attribute,Object> cloneAttributesMap(Map<AttributedCharacterIterator.Attribute,Object> attributes)
           
 JRStyledText cloneText()
          Clones this object.
 AttributedString getAttributedString()
           
 AttributedString getAwtAttributedString(boolean ignoreMissingFont)
          Returns an attributed string that contains the AWT font attribute, as the font is actually loaded.
 Map<AttributedCharacterIterator.Attribute,Object> getGlobalAttributes()
           
 Locale getLocale()
           
 List<JRStyledText.Run> getRuns()
           
 String getText()
           
 void insert(String str, short[] offsets)
          Inserts a string at specified positions in the styled text.
 int length()
           
 void setGlobalAttributes(Map<AttributedCharacterIterator.Attribute,Object> attributes)
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROPERTY_AWT_IGNORE_MISSING_FONT

public static final String PROPERTY_AWT_IGNORE_MISSING_FONT
See Also:
Constant Field Values
Constructor Detail

JRStyledText

public JRStyledText()

JRStyledText

public JRStyledText(Locale locale)
Method Detail

append

public void append(String text)

addRun

public void addRun(JRStyledText.Run run)

length

public int length()

getText

public String getText()

getLocale

public Locale getLocale()

getAttributedString

public AttributedString getAttributedString()

getAwtAttributedString

public AttributedString getAwtAttributedString(boolean ignoreMissingFont)
Returns an attributed string that contains the AWT font attribute, as the font is actually loaded.


getRuns

public List<JRStyledText.Run> getRuns()

setGlobalAttributes

public void setGlobalAttributes(Map<AttributedCharacterIterator.Attribute,Object> attributes)

getGlobalAttributes

public Map<AttributedCharacterIterator.Attribute,Object> getGlobalAttributes()

clone

protected Object clone()
                throws CloneNotSupportedException
Overrides:
clone in class Object
Throws:
CloneNotSupportedException

cloneAttributesMap

protected static Map<AttributedCharacterIterator.Attribute,Object> cloneAttributesMap(Map<AttributedCharacterIterator.Attribute,Object> attributes)

cloneText

public JRStyledText cloneText()
Clones this object.

Returns:
a clone of this object

insert

public void insert(String str,
                   short[] offsets)
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 insert
offsets - the incremental offsets of the positions at which to insert the string


Copyright © 2012. All Rights Reserved.