Class BackgroundImage

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

public class BackgroundImage extends AbstractCssProperty<BackgroundImage> implements StateChangeInformer<Bean>
 The background-image property sets one or more background images for an element.

 The background of an element is the total size of the element, including padding and border (but not the margin).

 By default, a background-image is placed at the top-left corner of an element, and repeated both vertically and horizontally.

 Tip: Always set a background-color to be used if the image is unavailable.
 Default value:  none
 Inherited:      no
 Animatable:     no
 Version:        CSS1 + new values in CSS3
 JavaScript syntax:      object.style.backgroundImage="url(smiley.gif)"
 
Since:
1.0.0
See Also:
  • Field Details

  • Constructor Details

    • BackgroundImage

      public BackgroundImage()
      the default value is none
      Since:
      1.0.0
    • BackgroundImage

      public BackgroundImage(String cssValue)
      Parameters:
      cssValue - the cssValue to set. eg:- url(images/BackgroundDesign.png)
    • BackgroundImage

      public BackgroundImage(BackgroundImage backgroundImage)
      Parameters:
      backgroundImage - the BackgroundImage object from which the cssName and cssValue to set.
    • BackgroundImage

      public BackgroundImage(String... imageUrls)
      sample code :- new BackgroundImage("Test.gif", "TestImage.png") creates background-image: url("Test.gif"), url("TestImage.png"); . For css3 syntax method please use new BackgroundImage(UrlCss3Value... urlCss3Values) or setImageUrls(UrlCss3Value... urlCss3Values) method.
      Parameters:
      imageUrls - an array of backgroundImage urls, eg:- backgroundImage.setImageUrls("Test.gif", "TestImage.png") and the generated css will be background-image: url("Test.gif"), url("TestImage.png");
      Since:
      1.0.0
    • BackgroundImage

      public BackgroundImage(UrlCss3Value... urlCss3Values)
      Parameters:
      urlCss3Values - an array of UrlCss3Value objects.
  • Method Details

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

      public BackgroundImage setCssValue(String cssValue)
      Specified by:
      setCssValue in class AbstractCssProperty<BackgroundImage>
      Parameters:
      cssValue - null is considered as an invalid value.
      Returns:
      the current object.
      Since:
      1.0.0
    • setImageUrls

      public void setImageUrls(String... imageUrls)
      sample code :- backgroundImage.setImageUrls("Test.gif", "TestImage.png") creates background-image: url("Test.gif"), url("TestImage.png");. For css3 syntax method please use setImageUrls(UrlCss3Value... urlCss3Values) method.
      Parameters:
      imageUrls - an array of backgroundImage urls, eg:- backgroundImage.setImageUrls("Test.gif", "TestImage.png") and the generated css will be background-image: url("Test.gif"), url("TestImage.png");
      Since:
      1.0.0
    • setImageUrls

      public void setImageUrls(UrlCss3Value... urlCss3Values)
      Parameters:
      urlCss3Values - urlCss3Values an array of UrlCss3Value objects.
      Since:
      1.0.0
    • getUrlCss3Values

      public List<UrlCss3Value> getUrlCss3Values()
      Returns:
      a new object of unmodifiable List<UrlCss3Value> whenever this method is called. Or null.
      Since:
      1.0.0
    • setAsInitial

      public void setAsInitial()
      Since:
      1.0.0
    • setAsInherit

      public void setAsInherit()
      Since:
      1.0.0
    • stateChanged

      public void stateChanged(Bean stateChangedObject)
      Specified by:
      stateChanged in interface StateChangeInformer<Bean>