Package com.webfirmframework.wffweb.css
Class FontSize
java.lang.Object
com.webfirmframework.wffweb.css.core.AbstractCssProperty<FontSize>
com.webfirmframework.wffweb.css.FontSize
- All Implemented Interfaces:
CssProperty
,Serializable
,Cloneable
font-size: medium | xx-small | x-small | small | large | x-large | xx-large | smaller | larger | length | initial | inherit; Initial: medium Applies to: all elements Inherited: yes Percentages: refer to inherited font size Media: visual Computed value: absolute length
- Since:
- 1.0.0
- See Also:
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetUnit()
getValue()
gets the fontSize in float value.static boolean
validates if the given cssValue is valid for this class.void
sets asinherit
void
sets asinitial
void
sets aslarge
.void
sets aslarger
.void
sets asmedium
.void
sets assmall
.void
sets assmaller
.void
sets asx-large
.void
sets asx-small
.void
sets asxx-large
.void
sets asxx-small
.setCssValue
(String cssValue) void
setPercent
(float percent) setValue
(float value, CssLengthUnit cssLengthUnit) 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:
-
MEDIUM
- See Also:
-
XX_SMALL
- See Also:
-
X_SMALL
- See Also:
-
SMALL
- See Also:
-
LARGE
- See Also:
-
X_LARGE
- See Also:
-
XX_LARGE
- See Also:
-
SMALLER
- See Also:
-
LARGER
- See Also:
-
-
Constructor Details
-
FontSize
public FontSize()Theauto
will be set as the value -
FontSize
- Parameters:
cssValue
- the css value to set.
-
FontSize
- Parameters:
fontSizeCss
- theFontSize
object from which the cssValue to set.And,null
will throwNullValueException
-
FontSize
public FontSize(float percent) - Parameters:
percent
- the percentage value to set. The cssLengthUnit will automatically set to %.- Since:
- 1.0.0
-
FontSize
- Parameters:
value
-cssLengthUnit
-
-
-
Method Details
-
setValue
- Parameters:
value
-cssLengthUnit
-- Returns:
- the current object
- Since:
- 1.0.0
-
setPercent
public void setPercent(float percent) - Parameters:
percent
- the percent to set- Since:
- 1.0.0
-
getCssName
- Returns:
- the name portion in style, eg
align-content
for stylealign-content: center
.
-
getCssValue
- Returns:
- the value portion in style, eg
center
for stylealign-content: center
.
-
toString
-
getValue
gets the fontSize in float value.FontSize#getUnit()
should be used to get the cssLengthUnit for this value.- Returns:
- the value in float or null if the cssValue is
initial
orinherit
. - Since:
- 1.0.0
-
getUnit
- Returns:
- the cssLengthUnit
PX
/PER
, ornull
if the value is any inbuilt value likeinherit
. - Since:
- 1.0.0
-
setCssValue
- Specified by:
setCssValue
in classAbstractCssProperty<FontSize>
- Parameters:
cssValue
- the value should be in the format of55px
or95%
.null
is considered as an invalid value and it will throwNullValueException
.- Returns:
- the current object.
- Since:
- 1.0.0
-
setAsInitial
public void setAsInitial()sets asinitial
- Since:
- 1.0.0
-
setAsInherit
public void setAsInherit()sets asinherit
- Since:
- 1.0.0
-
setAsMedium
public void setAsMedium()sets asmedium
.- Since:
- 1.0.0
-
setAsXxSmall
public void setAsXxSmall()sets asxx-small
.- Since:
- 1.0.0
-
setAsXSmall
public void setAsXSmall()sets asx-small
.- Since:
- 1.0.0
-
setAsSmall
public void setAsSmall()sets assmall
.- Since:
- 1.0.0
-
setAsLarge
public void setAsLarge()sets aslarge
.- Since:
- 1.0.0
-
setAsXLarge
public void setAsXLarge()sets asx-large
.- Since:
- 1.0.0
-
setAsXxLarge
public void setAsXxLarge()sets asxx-large
.- Since:
- 1.0.0
-
setAsSmaller
public void setAsSmaller()sets assmaller
.- Since:
- 1.0.0
-
setAsLarger
public void setAsLarger()sets aslarger
.- Since:
- 1.0.0
-
isValid
validates if the given cssValue is valid for this class.- Parameters:
cssValue
- the value to check.- Returns:
- true if valid and false if invalid.
- Since:
- 1.0.0
-