Package swingtree

Enum Class UI.NoiseType

All Implemented Interfaces:
Serializable, Comparable<UI.NoiseType>, Constable, NoiseFunction, UIEnum<UI.NoiseType>
Enclosing class:
UI

@Immutable public static enum UI.NoiseType extends Enum<UI.NoiseType> implements UIEnum<UI.NoiseType>, NoiseFunction
Defines the different types of noise functions that can be used to render a NoiseConf style.
Pass instances of this to NoiseConf.function(NoiseFunction) to configure the noise behaviour as part of the style API (see UIForAnySwing.withStyle(Styler)).
  • Enum Constant Details

  • Method Details

    • values

      public static UI.NoiseType[] 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 UI.NoiseType 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
    • getFractionAt

      public float getFractionAt(float x, float y)
      Description copied from interface: NoiseFunction
      Get the noise value at the given coordinate.
      Specified by:
      getFractionAt in interface NoiseFunction
      Parameters:
      x - The x coordinate in translated, scaled and rotated virtual space.
      y - The y coordinate in translated, scaled and rotated virtual space.
      Returns:
      The gradient value between 0 and 1 used to determine the color of a pixel in the color space / view space of the screen.