Class MozBackgroundSize

All Implemented Interfaces:
CssProperty, Serializable, Cloneable

public class MozBackgroundSize extends AbstractCssProperty<MozBackgroundSize>
 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.mozBackgroundSize="60px 120px"
 
Since:
1.0.0
See Also:
  • Field Details

  • Constructor Details

    • MozBackgroundSize

      public MozBackgroundSize()
      The 0px will be set as the value
    • MozBackgroundSize

      public MozBackgroundSize(String cssValue)
      Parameters:
      cssValue - the css value to set.
    • MozBackgroundSize

      public MozBackgroundSize(MozBackgroundSize backgroundSize)
      Parameters:
      backgroundSize - the backgroundSize object from which the cssValue to set.And, null will throw NullValueException
    • MozBackgroundSize

      public MozBackgroundSize(float horizontalHeight, CssLengthUnit cssLengthUnit)
      Parameters:
      horizontalHeight - the value to set.
      cssLengthUnit - the value unit to set.
      Since:
      1.0.0
    • MozBackgroundSize

      public MozBackgroundSize(float width, CssLengthUnit widthCssLengthUnit, float height, CssLengthUnit heightCssLengthUnit)
      Parameters:
      width -
      widthCssLengthUnit -
      height -
      heightCssLengthUnit -
      Since:
      1.0.0
  • Method Details

    • setValue

      public MozBackgroundSize setValue(float width, CssLengthUnit widthCssLengthUnit, float height, CssLengthUnit heightCssLengthUnit)
      Parameters:
      width -
      widthCssLengthUnit -
      height -
      heightCssLengthUnit -
      Returns:
      Since:
      1.0.0
    • setValue

      public MozBackgroundSize setValue(float widthHeight, CssLengthUnit cssLengthUnit)
      Parameters:
      widthHeight -
      cssLengthUnit -
      Returns:
      the current object
      Since:
      1.0.0
    • getCssName

      public String getCssName()
      Returns:
      the name portion in style, eg align-content for style align-content: center.
    • getCssValue

      public String getCssValue()
      Returns:
      the value portion in style, eg center for style align-content: center.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getWidth

      public Float 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 like inherit.
      Since:
      1.0.0
    • getHeight

      public Float 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 like inherit.
      Since:
      1.0.0
    • getWidthUnit

      public CssLengthUnit getWidthUnit()
      Returns:
      the cssLengthUnit PX/PER, or null if the value is any inbuilt value like inherit.
      Since:
      1.0.0
    • getHeightUnit

      public CssLengthUnit getHeightUnit()
      Returns:
      the cssLengthUnit PX/PER, or null if the value is any inbuilt value like inherit.
      Since:
      1.0.0
    • setCssValue

      public MozBackgroundSize setCssValue(String cssValue)
      Specified by:
      setCssValue in class AbstractCssProperty<MozBackgroundSize>
      Parameters:
      cssValue - the value should be in the format of 55px or 95%. null is considered as an invalid value and it will throw NullValueException.
      Returns:
      the current object.
      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
    • isValid

      public static boolean isValid(String cssValue)
      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