Class OutlineWidth

All Implemented Interfaces:
CssProperty, Serializable, Cloneable

public class OutlineWidth extends AbstractCssProperty<OutlineWidth>
 outline-width: medium|thin|thick|length|initial|inherit;

 An outline is a line that is drawn around elements (outside the borders) to make the element "stand out".

 The outline-width specifies the width of an outline.

 Note: Always declare the outline-style property before the outline-width property. An element must have an outline before you change the width of it.
 Default value:  medium
 Inherited:      no
 Animatable:     yes, see individual properties
 Version:        CSS2
 JavaScript syntax:      object.style.outlineWidth="2px"
 
Since:
1.0.0
See Also:
  • Field Details

  • Constructor Details

    • OutlineWidth

      public OutlineWidth()
      The initial will be set as the value
    • OutlineWidth

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

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

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

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

    • setValue

      public OutlineWidth 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 outline-width in float value. OutlineWidth#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 OutlineWidth setCssValue(String cssValue)
      Specified by:
      setCssValue in class AbstractCssProperty<OutlineWidth>
      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
    • setAsMedium

      public void setAsMedium()
      sets as medium.
      Since:
      1.0.0
    • setAsThin

      public void setAsThin()
      sets as thin.
      Since:
      1.0.0
    • setAsThick

      public void setAsThick()
      sets as thick.
      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