Class WordSpacing

All Implemented Interfaces:
CssProperty, Serializable, Cloneable

public class WordSpacing extends AbstractCssProperty<WordSpacing>
 word-spacing: normal|length|initial|inherit;

 The word-spacing property increases or decreases the white space between words.
 Note: Negative values are allowed.
 Default value:  normal
 Inherited:      yes
 Animatable:     yes
 Version:        CSS1
 JavaScript syntax:      object.style.wordSpacing="20px"
 
Since:
1.0.0
See Also:
  • Field Details

  • Constructor Details

    • WordSpacing

      public WordSpacing()
      The normal will be set as the value
    • WordSpacing

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

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

      public WordSpacing(float percent)
      Parameters:
      percent - the percentage value to set. The cssLengthUnit will automatically set to %.
      Since:
      1.0.0
    • WordSpacing

      public WordSpacing(float value, CssLengthUnit cssLengthUnit)
      Parameters:
      value -
      cssLengthUnit -
  • Method Details

    • setValue

      public WordSpacing setValue(float value, CssLengthUnit cssLengthUnit)
      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

      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
    • getValue

      public Float getValue()
      gets the word-spacing in float value. WordSpacing#getUnit() should be used to get the cssLengthUnit for this value.
      Returns:
      the value in float or null if the cssValue is initial or inherit.
      Since:
      1.0.0
    • getUnit

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

      public WordSpacing setCssValue(String cssValue)
      Specified by:
      setCssValue in class AbstractCssProperty<WordSpacing>
      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
    • setAsNormal

      public void setAsNormal()
      sets as normal.
      Since:
      1.0.0