public class MessageStyleFactory
extends java.lang.Object
Title:
Description:
Copyright: Copyright (c) 2004
Company:
Modifier and Type | Field and Description |
---|---|
static int |
BOLD
Attribute: bold font
|
private static MessageStyleFactory |
factory
The factory instance - Singleton
|
static int |
ITALIC
Attribute: italic font
|
static int |
UNDERLINE
Attribute: underline font
|
Modifier | Constructor and Description |
---|---|
private |
MessageStyleFactory()
private constructor for Singleton
|
Modifier and Type | Method and Description |
---|---|
javax.swing.text.AttributeSet |
createStyle(java.awt.Color textColor)
Create the attribute set with the supplied color
|
private javax.swing.text.AttributeSet |
createStyle(java.awt.Color textColor,
java.awt.Color backgroundColor,
boolean bold,
boolean italic,
boolean underline)
Create the attribute set with the supplied forground color, background
color and style features
|
javax.swing.text.AttributeSet |
createStyle(java.awt.Color textColor,
java.awt.Color backgroundColor,
int style)
Create the attribute set with the supplied forground color, background
color and style
|
javax.swing.text.AttributeSet |
createStyle(java.awt.Color textColor,
int style)
Create the attribute set with the supplied color and style
|
javax.swing.text.AttributeSet |
createStyle(int styleId)
Create the attribute set with the supplied style
|
static MessageStyleFactory |
instance()
Get the instance of the factory
|
private boolean |
isTrue(int style,
int attribute)
Check whether a given style is part of the attributes
|
private static MessageStyleFactory factory
public static final int BOLD
public static final int ITALIC
public static final int UNDERLINE
private MessageStyleFactory()
public static MessageStyleFactory instance()
public javax.swing.text.AttributeSet createStyle(java.awt.Color textColor)
textColor
- The font foreground colorpublic javax.swing.text.AttributeSet createStyle(int styleId)
styleId
- The style identifierpublic javax.swing.text.AttributeSet createStyle(java.awt.Color textColor, int style)
textColor
- The font foreground colorstyle
- The style identifierpublic javax.swing.text.AttributeSet createStyle(java.awt.Color textColor, java.awt.Color backgroundColor, int style)
textColor
- The font foreground colorbackgroundColor
- The background colorstyle
- The style identifierprivate javax.swing.text.AttributeSet createStyle(java.awt.Color textColor, java.awt.Color backgroundColor, boolean bold, boolean italic, boolean underline)
textColor
- The font foreground colorbackgroundColor
- The background colorbold
- Bold style on/offitalic
- Italic setting on/offunderline
- Underlined setting on/offprivate boolean isTrue(int style, int attribute)
style
- The style idattribute
- The attribute setting