Enum Class Scaling

java.lang.Object
java.lang.Enum<Scaling>
io.leandev.appfuse.image.Scaling
All Implemented Interfaces:
Serializable, Comparable<Scaling>, Constable

public enum Scaling extends Enum<Scaling>

scaling can be set with one of these five values:

  • fill: this is the default value which stretches the image to fit the content box, regardless of its aspect-ratio.
  • contain: increases or decreases the size of the image to fill the box whilst preserving its aspect-ratio.
  • cover: the image will fill the height and width of its box, once again maintaining its aspect ratio but often cropping the image in the process.
  • none: image will ignore the height and width of the parent and retain its original size.
  • scale-down: the image will compare the difference between none and contain in order to find the smallest concrete object size.
  • Enum Constant Details

    • FIT

      public static final Scaling FIT
    • CONTAIN

      public static final Scaling CONTAIN
    • COVER

      public static final Scaling COVER
    • NONE

      public static final Scaling NONE
    • SCALE_DOWN

      public static final Scaling SCALE_DOWN
  • Method Details

    • values

      public static Scaling[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static Scaling valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • getName

      public String getName()
    • toString

      public String toString()
      Overrides:
      toString in class Enum<Scaling>