Class BackgroundSize
java.lang.Object
com.webfirmframework.wffweb.css.core.AbstractCssProperty<BackgroundSize>
com.webfirmframework.wffweb.css.css3.BackgroundSize
- All Implemented Interfaces:
CssProperty
,Serializable
,Cloneable
background-size: auto|length|cover|contain|initial|inherit; The background-size property specifies the size of the background images. Default value: auto Inherited: no Animatable: yes Version: CSS3 JavaScript syntax: object.style.backgroundSize="60px 120px"
- Since:
- 1.0.0
- See Also:
-
Field Summary
-
Constructor Summary
ConstructorDescriptionThe0px
will be set as the valueBackgroundSize
(float widthHeight, CssLengthUnit cssLengthUnit) BackgroundSize
(float width, CssLengthUnit widthLengthUnit, float height, CssLengthUnit heightLengthUnit) BackgroundSize
(BackgroundSize backgroundSize) BackgroundSize
(String cssValue) -
Method Summary
Modifier and TypeMethodDescriptiongets the vertical value in float value.getWidth()
gets the horizontal value in float value.static boolean
validates if the given cssValue is valid for this class.void
sets asinherit
void
sets asinitial
setCssValue
(String cssValue) setValue
(float widthHeight, CssLengthUnit cssLengthUnit) setValue
(float width, CssLengthUnit widthLengthUnit, float height, CssLengthUnit heightLengthUnit) 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:
-
AUTO
- See Also:
-
COVER
- See Also:
-
CONTAIN
- See Also:
-
-
Constructor Details
-
BackgroundSize
public BackgroundSize()The0px
will be set as the value -
BackgroundSize
- Parameters:
cssValue
- the css value to set.
-
BackgroundSize
- Parameters:
backgroundSize
- theBackgroundSize
object from which the cssValue to set.And,null
will throwNullValueException
-
BackgroundSize
- Parameters:
widthHeight
- the value to set.cssLengthUnit
- the value unit to set.- Since:
- 1.0.0
-
BackgroundSize
public BackgroundSize(float width, CssLengthUnit widthLengthUnit, float height, CssLengthUnit heightLengthUnit) - Parameters:
width
-widthLengthUnit
-height
-heightLengthUnit
-- Since:
- 1.0.0
-
-
Method Details
-
setValue
public BackgroundSize setValue(float width, CssLengthUnit widthLengthUnit, float height, CssLengthUnit heightLengthUnit) - Parameters:
width
-widthLengthUnit
-height
-heightLengthUnit
-- Returns:
- Since:
- 1.0.0
-
setValue
- Parameters:
widthHeight
-cssLengthUnit
-- Returns:
- the current object
- 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
-
getWidth
gets the horizontal value in float value.BackgroundSize#getWidthUnit()
should be used to get the cssLengthUnit for this value.- Returns:
- the horizontal value in float or
null
if the value is any inbuilt value likeinherit
. - Since:
- 1.0.0
-
getHeight
gets the vertical value in float value.BackgroundSize#getHeightUnit()
should be used to get the cssLengthUnit for this value.- Returns:
- the vertical value in float or
null
if the value is any inbuilt value likeinherit
. - Since:
- 1.0.0
-
getWidthUnit
- Returns:
- the cssLengthUnit
PX
/PER
, ornull
if the value is any inbuilt value likeinherit
. - Since:
- 1.0.0
-
getHeightUnit
- Returns:
- the cssLengthUnit
PX
/PER
, ornull
if the value is any inbuilt value likeinherit
. - Since:
- 1.0.0
-
setCssValue
- Specified by:
setCssValue
in classAbstractCssProperty<BackgroundSize>
- 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
-
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
-