public interface Styled_Writer
This interface is used to write text that may have various text style attributes - font face, size, color, etc. - associated with it.
| Modifier and Type | Method and Description |
|---|---|
Styled_Writer |
Write(String text)
Write plain text.
|
Styled_Writer |
Write(String text,
AttributeSet style)
Write styled text.
|
Styled_Writer Write(String text, AttributeSet style) throws IOException
A style may be assembled using combinations of the numerous StyleConstants setXXX functions applied to a SimpleAttributeSet. For example:
SimpleAttributeSet bold_red_text = new SimpleAttributeSet ();
StyleConstants.setBold (bold_red_text, true);
StyleConstants.setForeground (bold_red_text, Color.RED);
StyleConstants.setFontFamily (bold_red_text, "Monospaced");
assembles a style that will produce text in a bold, red, monospaced font.
text - The text String to be written.style - The AttributeSet to be applied to the text. This
may be null if plain text is to be displayed.IOExceptionStyleConstants,
SimpleAttributeSetStyled_Writer Write(String text) throws IOException
This is the same as writing
text will a null style.
text - The text String to be written.IOException