Spec-Zone.ru › OpenJavaFX 8
javafx.scene.layout

Class BackgroundImage

java.lang.Object
  • javafx.scene.layout.BackgroundImage


public final class BackgroundImage
extends Object
Defines properties describing how to render an image as the background to some Region. A BackgroundImage must have an Image specified (it cannot be null). The repeatX and repeatY properties define how the image is to be repeated in each direction. The position property defines how to position the image on the Region while the size property defines the size of the image on the Region. For example, the size might be defined with cover = true, meaning the image should be stretched to cover the entire rendering surface of the Region. Because the BackgroundImage is immutable, it can safely be used in any cache, and can safely be reused among multiple Regions.

Since:

JavaFX 8.0

  • Constructor Summary

    Constructors
    Constructor and Description
    BackgroundImage(Image image, BackgroundRepeat repeatX, BackgroundRepeat repeatY, BackgroundPosition position, BackgroundSize size)
    Creates a new BackgroundImage.
  • Method Summary

    All MethodsInstance MethodsConcrete Methods
    Modifier and Type Method and Description
    boolean equals(Object o)
    Image getImage()
    The image to be used.
    BackgroundPosition getPosition()
    The position of this BackgroundImage relative to the Region.
    BackgroundRepeat getRepeatX()
    Indicates in what manner (if at all) the background image is to be repeated along the x-axis of the region.
    BackgroundRepeat getRepeatY()
    Indicates in what manner (if at all) the background image is to be repeated along the y-axis of the region.
    BackgroundSize getSize()
    The size of this image relative to the Region.
    int hashCode()
    • Methods inherited from class java.lang.Object

      clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
  • Constructor Detail

    • BackgroundImage

      public BackgroundImage(Image image,
                             BackgroundRepeat repeatX,
                             BackgroundRepeat repeatY,
                             BackgroundPosition position,
                             BackgroundSize size)
      Creates a new BackgroundImage. The image must be specified.

      Parameters:

      image - The image to use. This cannot be null.

  • Method Detail

    • getImage

      public final Image getImage()
      The image to be used. This will never be null. If this image fails to load, then the entire BackgroundImage will be skipped at rendering time.
    • getRepeatX

      public final BackgroundRepeat getRepeatX()
      Indicates in what manner (if at all) the background image is to be repeated along the x-axis of the region. This will never be null.
    • getRepeatY

      public final BackgroundRepeat getRepeatY()
      Indicates in what manner (if at all) the background image is to be repeated along the y-axis of the region. This will never be null.
    • getPosition

      public final BackgroundPosition getPosition()
      The position of this BackgroundImage relative to the Region. Note that any position outside the background area of the region will be clipped.
    • getSize

      public final BackgroundSize getSize()
      The size of this image relative to the Region.
    • equals

      public boolean equals(Object o)

      Overrides:

      equals in class Object

    • hashCode

      public int hashCode()

      Overrides:

      hashCode in class Object

© 2008, 2025, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from JavaFX API Documentation.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Java, JavaFX and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API