Package com.webfirmframework.wffweb.css
Class Font
- All Implemented Interfaces:
CssProperty
,StateChangeInformer<CssProperty>
,Serializable
,Cloneable
font: font-style font-variant font-weight font-size/line-height font-family|caption|icon|menu|message-box|small-caption|status-bar|initial|inherit; The font shorthand property sets all the font properties in one declaration. The properties that can be set, are (in order): "font-style font-variant font-weight font-size/line-height font-family" The font-size and font-family values are required. If one of the other values are missing, the default values will be inserted, if any. Note: The line-height property sets the space between lines. Default value: The default value of all the font properties Inherited: yes Animatable: yes, see individual properties. Read about animatable Version: CSS1 JavaScript syntax: object.style.font="italic small-caps bold 12px/1.4 arial,sans-serif"
- Since:
- 1.0.0
- See Also:
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
addPredefinedConstant
(String constant) protected static String[]
getExtractedSubCssValues
(String cssValue) static boolean
checks the given css value is valid for this class.void
sets as captionvoid
sets as iconvoid
sets as inheritvoid
sets as initialvoid
sets as menuvoid
sets as message-boxvoid
sets as small-captionvoid
sets as status-barsetCssValue
(String cssValue) setFontFamily
(FontFamily fontFamily) setFontSize
(FontSize fontSize) setFontStyle
(FontStyle fontStyle) setFontVariant
(FontVariant fontVariant) setFontWeight
(FontWeight fontWeight) setLineHeight
(LineHeight lineHeight) void
stateChanged
(CssProperty stateChangedObject) toString()
Methods inherited from class com.webfirmframework.wffweb.css.core.AbstractCssProperty
clone, getStateChangeInformer, isAlreadyInUse, setAlreadyInUse, setStateChangeInformer, toCssString
-
Field Details
-
INITIAL
- See Also:
-
INHERIT
- See Also:
-
CAPTION
- See Also:
-
ICON
- See Also:
-
MENU
- See Also:
-
MESSAGE_BOX
- See Also:
-
SMALL_CAPTION
- See Also:
-
STATUS_BAR
- See Also:
-
-
Constructor Details
-
Font
public Font()The valueinitial
will be assigned as the cssValue.- Since:
- 1.0.0
-
Font
- Parameters:
cssValue
- the css value to set.
-
Font
- Parameters:
font
- theFont
object from which the cssValue to set.And,null
will throwNullValueException
-
-
Method Details
-
getCssName
- Specified by:
getCssName
in interfaceCssProperty
- Returns:
- the name portion in style, eg
align-content
for stylealign-content: center
.
-
getCssValue
- Specified by:
getCssValue
in interfaceCssProperty
- Returns:
- the value portion in style, eg
center
for stylealign-content: center
.
-
toString
-
setCssValue
- Specified by:
setCssValue
in classAbstractCssProperty<Font>
- Parameters:
cssValue
- the value should be in the format ofitalic small-caps bold 12px arial,sans-serif
orinitial/inherit
.null
is considered as an invalid value and it will throwNullValueException
.- Returns:
- the current object.
- Since:
- 1.0.0
-
getExtractedSubCssValues
- Parameters:
cssValue
-- Returns:
- the sub properties
- Since:
- 1.0.0
-
isValid
checks the given css value is valid for this class. It does't do a strict validation.- Parameters:
cssValue
-- Returns:
- Since:
- 1.0.0
-
setAsInitial
public void setAsInitial()sets as initial- Since:
- 1.0.0
-
setAsInherit
public void setAsInherit()sets as inherit- Since:
- 1.0.0
-
setAsCaption
public void setAsCaption()sets as caption- Since:
- 1.0.0
-
setAsIcon
public void setAsIcon()sets as icon- Since:
- 1.0.0
-
setAsMenu
public void setAsMenu()sets as menu- Since:
- 1.0.0
-
setAsMessageBox
public void setAsMessageBox()sets as message-box- Since:
- 1.0.0
-
setAsSmallCaption
public void setAsSmallCaption()sets as small-caption- Since:
- 1.0.0
-
setAsStatusBar
public void setAsStatusBar()sets as status-bar- Since:
- 1.0.0
-
getFontSize
-
getLineHeight
- Returns:
- the lineHeight
- Since:
- 1.0.0
-
getFontFamily
- Returns:
- the fontFamily
- Since:
- 1.0.0
-
getFontVariant
-
getFontWeight
- Returns:
- the fontWeight
- Since:
- 1.0.0
-
getFontStyle
-
setFontStyle
-
setFontVariant
-
setFontWeight
-
setFontSize
-
setLineHeight
-
setFontFamily
-
stateChanged
- Specified by:
stateChanged
in interfaceStateChangeInformer<CssProperty>
-
addPredefinedConstant
- Since:
- 1.0.0
-