public class EMSTextFormat
extends java.lang.Object
implements java.io.Serializable
Example:
EMSMessage msg = new EMSMessage(service); EMSTextFormat fmt = new EMSTextFormat(); fmt.setSize(EMSTextFormat.SIZE_LARGE); fmt.setBold(true); fmt.setColor(EMSTextFormat.BLUE, EMSTextFormat.YELLOW); EMSText txt = new EMSText("Large bold blue text on yellow background", fmt); msg.add(txt);
EMSText
,
EMSMessage
,
Serialized FormModifier and Type | Field and Description |
---|---|
static int |
ALIGN_CENTER
Align centered
|
static int |
ALIGN_DEFAULT |
static int |
ALIGN_LEFT
Align left
|
static int |
ALIGN_RIGHT
Align right
|
static int |
BLACK |
static int |
BLUE |
static EMSTextFormat |
BOLD
Predefined Format: Bold text.
|
static int |
CYAN |
static int |
DARK_BLUE |
static int |
DARK_CYAN |
static int |
DARK_GREEN |
static int |
DARK_GREY |
static int |
DARK_MAGENTA |
static int |
DARK_RED |
static int |
DARK_YELLOW |
static int |
GREEN |
static int |
GREY |
static EMSTextFormat |
ITALIC
Predefined Format: Italic text.
|
static EMSTextFormat |
LARGE
Predefined Format: Large text size.
|
static int |
MAGENTA |
static EMSTextFormat |
NORMAL
Predefined Format: Normal text size.
|
static int |
RED |
static int |
SIZE_LARGE
Font size large
|
static int |
SIZE_NORMAL
Font size normal
|
static int |
SIZE_SMALL
Font size small
|
static EMSTextFormat |
SMALL
Predefined Format: Small text size.
|
static EMSTextFormat |
UNDERLINE
Predefined Format: underlined text.
|
static int |
WHITE |
static int |
YELLOW |
Constructor and Description |
---|
EMSTextFormat()
Construct a new EMSTextFormat object.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj) |
int |
getAlignment() |
int |
getBgColor()
Returns the background color.
|
boolean |
getBold() |
int |
getFgColor()
Returns the foreground color.
|
boolean |
getItalic() |
int |
getSize() |
boolean |
getStrikethrough() |
boolean |
getUnderline() |
int |
hashCode() |
EMSTextFormat |
setAlignment(int alignment)
Set the alignment of the EMS text.
|
EMSTextFormat |
setBold(boolean state)
set the font face
|
EMSTextFormat |
setColor(int fg,
int bg)
Set the foreground and background text color.
|
EMSTextFormat |
setItalic(boolean state)
set the font type
|
EMSTextFormat |
setSize(int size)
Set the font size.
|
EMSTextFormat |
setStrikethrough(boolean state) |
EMSTextFormat |
setUnderline(boolean state) |
java.lang.String |
toString() |
public static final int ALIGN_LEFT
public static final int ALIGN_CENTER
public static final int ALIGN_RIGHT
public static final int ALIGN_DEFAULT
public static final int SIZE_NORMAL
public static final int SIZE_LARGE
public static final int SIZE_SMALL
public static final int BLACK
public static final int DARK_GREY
public static final int DARK_RED
public static final int DARK_YELLOW
public static final int DARK_GREEN
public static final int DARK_CYAN
public static final int DARK_BLUE
public static final int DARK_MAGENTA
public static final int GREY
public static final int WHITE
public static final int RED
public static final int YELLOW
public static final int GREEN
public static final int CYAN
public static final int BLUE
public static final int MAGENTA
public static final EMSTextFormat NORMAL
public static final EMSTextFormat LARGE
public static final EMSTextFormat SMALL
public static final EMSTextFormat BOLD
public static final EMSTextFormat ITALIC
public static final EMSTextFormat UNDERLINE
public EMSTextFormat setAlignment(int alignment)
alignment
- the desired alignment (ALIGN_DEFAULT
,
ALIGN_LEFT
, ALIGN_CENTER
, ALIGN_RIGHT
.public int getAlignment()
public EMSTextFormat setSize(int size)
size
- the desired size (SIZE_NORMAL
, SIZE_LARGE
,
SIZE_SMALL
.public int getSize()
SIZE_NORMAL
, SIZE_LARGE
,
SIZE_SMALL
)public EMSTextFormat setBold(boolean state)
state
- (true = bold, false = normal)public boolean getBold()
public EMSTextFormat setItalic(boolean state)
public boolean getItalic()
public EMSTextFormat setUnderline(boolean state)
public boolean getUnderline()
public EMSTextFormat setStrikethrough(boolean state)
public boolean getStrikethrough()
public EMSTextFormat setColor(int fg, int bg)
BLUE
) to specify the colors.fg
- the foreground colorbg
- the background colorpublic int getFgColor()
public int getBgColor()
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
object XP, Inc. © 2000-2013. All rights reserved object XP