public class XMLSpan extends java.lang.Object implements StylableText, SpanTextElement, FontType
TYPE_NONE
BOLD, ITALIC, REGULAR, STRIKETHROUGH, SUBSCRIPT, SUPERSCRIPT, UNDERLINE
Constructor and Description |
---|
XMLSpan(java.lang.String text)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addTextAfter(java.lang.String suffix)
Add characters after the sentence text.
|
void |
addTextBefore(java.lang.String prefix)
Add characters before the sentence text.
|
void |
endsWithNewLine(boolean endsWithNewLine)
Sets if the sentence ends with a new line.
|
java.lang.String |
getBackgroundColor()
Return the html background color of the text.
|
java.lang.String |
getColor()
Return the html color of the text.
|
java.lang.String |
getDeclaration()
Return the declaration ID of the element.
|
java.lang.String |
getFontFace()
Return the font face of the text.
|
java.lang.String |
getNamedSize()
Return the HTML named size of the text.
|
int |
getNumericSize()
Return the numeric size of the text.
|
XMLTextStyle |
getParentStyle()
Return null.
|
java.lang.String |
getSize()
Return the size of the text.
|
java.lang.String |
getStyle()
Return the style class of the element.
|
java.lang.String |
getText()
Return the text.
|
int |
getType()
Return the font type of the text.
|
boolean |
hasDecoration()
Return true if the text has a decoration.
|
boolean |
hasFontFace()
Return true if the text has a font face.
|
boolean |
hasSize()
Return true if the text has a size.
|
boolean |
isEmpty()
Return true if the sentence is empty.
|
boolean |
isEndingWithNewLine()
Return true if the sentence ends with a new line.
|
void |
setBackgroundColor(java.lang.String background)
Set the html background color of the text.
|
void |
setColor(java.lang.String color)
Set the html color of the text.
|
void |
setFontFace(java.lang.String fontFace)
Set the font face of the text.
|
void |
setParentStyle(XMLTextStyle parentStyle)
Do nothing.
|
void |
setSize(int size)
Set the size of the text.
|
void |
setSize(java.lang.String namedSize)
Set the HTML named size of the text.
|
void |
setStyle(java.lang.String style)
Set the style class of the element.
|
void |
setText(java.lang.String text)
Set the text.
|
void |
setType(int type)
Set the font type of the text.
|
java.lang.String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getCustomStyles, getInlinedStyle, hasInlinedStyle, setCustomStyles, setCustomStyles, setInlinedStyle
public XMLSpan(java.lang.String text)
text
- the textpublic XMLTextStyle getParentStyle()
getParentStyle
in interface StylableText
public java.lang.String getDeclaration()
getDeclaration
in interface StyledElement
public java.lang.String toString()
toString
in class java.lang.Object
public void setStyle(java.lang.String style)
style
- the style classpublic java.lang.String getStyle()
getStyle
in interface StylableText
getStyle
in interface StyledElement
public void endsWithNewLine(boolean endsWithNewLine)
endsWithNewLine
in interface SpanTextElement
endsWithNewLine
- true if the sentence ends with a new linepublic boolean isEndingWithNewLine()
isEndingWithNewLine
in interface SpanTextElement
public void setType(int type)
type
- the font typeFontType
public int getType()
getType
in interface StylableText
FontType
public void setSize(java.lang.String namedSize)
namedSize
- the HTML named sizepublic void setSize(int size)
size
- the size of the textpublic java.lang.String getNamedSize()
getNamedSize
in interface StylableText
public boolean hasSize()
hasSize
in interface StylableText
public java.lang.String getSize()
getSize
in interface StylableText
public int getNumericSize()
getNumericSize
in interface StylableText
public void setFontFace(java.lang.String fontFace)
fontFace
- the font face of the textpublic java.lang.String getFontFace()
getFontFace
in interface StylableText
public boolean hasFontFace()
hasFontFace
in interface StylableText
public boolean hasDecoration()
hasDecoration
in interface StylableText
public void setColor(java.lang.String color)
color
- the html color of the textpublic java.lang.String getColor()
getColor
in interface StylableText
public void setBackgroundColor(java.lang.String background)
background
- the html background color of the textpublic java.lang.String getBackgroundColor()
getBackgroundColor
in interface StylableText
public void setText(java.lang.String text)
text
- the textpublic java.lang.String getText()
getText
in interface StylableText
public void addTextBefore(java.lang.String prefix)
prefix
- the prefix characterspublic void addTextAfter(java.lang.String suffix)
suffix
- the suffix characterspublic boolean isEmpty()
public void setParentStyle(XMLTextStyle parentStyle)
setParentStyle
in interface StylableText
parentStyle
- the parent styleCopyright © 2016-2024 Herve Girod. All Rights Reserved. Documentation and source under the BSD licence