Class BorderColor

All Implemented Interfaces:
CssProperty, StateChangeInformer<CssProperty>, Serializable, Cloneable

public class BorderColor extends AbstractCssProperty<BorderColor> implements StateChangeInformer<CssProperty>
 border-color: color|transparent|initial|inherit;

 The border-color property sets the color of an element's four borders. This property can have from one to four values.

 Examples:

     border-color:red green blue pink;
         top border is red
         right border is green
         bottom border is blue
         left border is pink

     border-color:red green blue;
         top border is red
         right and left borders are green
         bottom border is blue

     border-color:red green;
         top and bottom borders are red
         right and left borders are green

     border-color:red;
         all four borders are red

 Note: Always declare the border-style property before the border-color property. An element must have borders before you can change the color.
 Default value:  The current color of the element
 Inherited:      no
 Animatable:     yes
 Version:        CSS1
 JavaScript syntax:      object.style.borderColor="#FF0000 blue"
 
Since:
1.0.0
See Also:
  • Field Details

  • Constructor Details

    • BorderColor

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

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

      public BorderColor(BorderColor borderBottomColor)
      Parameters:
      borderBottomColor - the BorderBottomColor object from which the cssValue to set.And, null will throw NullValueException
  • Method Details

    • setValue

      public BorderColor setValue(String value)
      the color/color code to set. The alternative method setCssValue can also be used.
      Parameters:
      value -
      Returns:
      the current object
      Since:
      1.0.0
    • getCssName

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

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

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

      public String getValue()
      gets the value, getCssValue method can also be used to get the same value.
      Returns:
      the value in String.
      Since:
      1.0.0
    • setCssValue

      public BorderColor setCssValue(String cssValue)
      Specified by:
      setCssValue in class AbstractCssProperty<BorderColor>
      Parameters:
      cssValue - the value should be a color/color code, for example #0000ff. null is considered as an invalid value and it will throw NullValueException.And an empty string is also considered as an invalid value and it will throw InvalidValueException.
      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
    • setAsTransparent

      public void setAsTransparent()
      sets as transparent
      Since:
      1.0.0
    • getBorderTopColor

      public BorderTopColor getBorderTopColor()
      Returns:
      the borderTopColor
      Since:
      1.0.0
    • setBorderColor

      public void setBorderColor(BorderTopColor borderTopColor, BorderRightColor borderRightColor, BorderBottomColor borderBottomColor, BorderLeftColor borderLeftColor)
      Parameters:
      borderTopColor -
      borderRightColor -
      borderBottomColor -
      borderLeftColor -
      Since:
      1.0.0
    • getBorderRightColor

      public BorderRightColor getBorderRightColor()
      Returns:
      the borderRightColor
      Since:
      1.0.0
    • getBorderBottomColor

      public BorderBottomColor getBorderBottomColor()
      Returns:
      the borderBottomColor
      Since:
      1.0.0
    • getBorderLeftColor

      public BorderLeftColor getBorderLeftColor()
      Returns:
      the borderLeftColor
      Since:
      1.0.0
    • stateChanged

      public void stateChanged(CssProperty stateChangedObject)
      Specified by:
      stateChanged in interface StateChangeInformer<CssProperty>
    • hasPredefinedConstantValue

      public boolean hasPredefinedConstantValue()
      Returns:
      true if its cssValue is any of the values initial, inherit or transparent.
      Since:
      1.0.0
    • isValid

      public static boolean isValid(String cssValue)
      Since:
      1.0.0