| java.lang.Object java.awt.font.StyledParagraph
StyledParagraph | final class StyledParagraph (Code) | | This class stores Font, GraphicAttribute, and Decoration intervals
on a paragraph of styled text.
Currently, this class is optimized for a small number of intervals
(preferrably 1).
|
Method Summary | |
static Map | addInputMethodAttrs(Map oldStyles) Return a Map with entries from oldStyles, as well as input
method entries, if any. | public static StyledParagraph | deleteChar(AttributedCharacterIterator aci, char[] chars, int deletePos, StyledParagraph oldParagraph) Return a StyledParagraph reflecting the insertion of a single character
into the text. | public Decoration | getDecorationAt(int index) Return the Decoration in effect at the given index. | public Object | getFontOrGraphicAt(int index) Return the Font or GraphicAttribute in effect at the given index. | public int | getRunLimit(int index) Return the index at which there is a different Font, GraphicAttribute, or
Dcoration than at the given index. | public static StyledParagraph | insertChar(AttributedCharacterIterator aci, char[] chars, int insertPos, StyledParagraph oldParagraph) Return a StyledParagraph reflecting the insertion of a single character
into the text. |
decorationStarts | int[] decorationStarts(Code) | | |
fontStarts | int[] fontStarts(Code) | | |
StyledParagraph | public StyledParagraph(AttributedCharacterIterator aci, char[] chars)(Code) | | Create a new StyledParagraph over the given styled text.
Parameters: aci - an iterator over the text Parameters: chars - the characters extracted from aci |
addInputMethodAttrs | static Map addInputMethodAttrs(Map oldStyles)(Code) | | Return a Map with entries from oldStyles, as well as input
method entries, if any.
|
deleteChar | public static StyledParagraph deleteChar(AttributedCharacterIterator aci, char[] chars, int deletePos, StyledParagraph oldParagraph)(Code) | | Return a StyledParagraph reflecting the insertion of a single character
into the text. This method will attempt to reuse the given paragraph,
but may create a new paragraph.
Parameters: aci - an iterator over the text. The text should be the same as thetext used to create (or most recently update) oldParagraph, withthe exception of deleting a single character at deletePos. Parameters: chars - the characters in aci Parameters: deletePos - the index where a character was removed Parameters: oldParagraph - a StyledParagraph for the text in aci before theinsertion |
getDecorationAt | public Decoration getDecorationAt(int index)(Code) | | Return the Decoration in effect at the given index.
Parameters: index - a valid index in the paragraph the Decoration at index. |
getFontOrGraphicAt | public Object getFontOrGraphicAt(int index)(Code) | | Return the Font or GraphicAttribute in effect at the given index.
The client must test the type of the return value to determine what
it is.
Parameters: index - a valid index in the paragraph the Font or GraphicAttribute at index. |
getRunLimit | public int getRunLimit(int index)(Code) | | Return the index at which there is a different Font, GraphicAttribute, or
Dcoration than at the given index.
Parameters: index - a valid index in the paragraph the first index where there is a change in attributes fromthose at index |
insertChar | public static StyledParagraph insertChar(AttributedCharacterIterator aci, char[] chars, int insertPos, StyledParagraph oldParagraph)(Code) | | Return a StyledParagraph reflecting the insertion of a single character
into the text. This method will attempt to reuse the given paragraph,
but may create a new paragraph.
Parameters: aci - an iterator over the text. The text should be the same as thetext used to create (or most recently update) oldParagraph, withthe exception of inserting a single character at insertPos. Parameters: chars - the characters in aci Parameters: insertPos - the index of the new character in aci Parameters: oldParagraph - a StyledParagraph for the text in aci before theinsertion |
|
|