Package tripleplay.ui

Class Slider


public class Slider extends Widget<Slider>
Displays a bar and a thumb that can be slid along the bar, representing a floating point value between some minimum and maximum.
  • Field Details

    • BAR_WIDTH

      public static Style<Float> BAR_WIDTH
      The width of the bar of an unstretched slider. The slider's preferred width will be this width plus the width of the thumb image (which can extend past the left edge of the bar by half its width and the right edge of the bar by half its width). Inherited.
    • BAR_HEIGHT

      public static Style<Float> BAR_HEIGHT
      The height of the bar. The slider's preferred height will be the larger of this height and the height of the thumb image. Inherited.
    • BAR_BACKGROUND

      public static Style<Background> BAR_BACKGROUND
      The background that renders the bar (defaults to a black rectangle). Inherited.
    • BAR_ON_BACKGROUND

      public static Style<Background> BAR_ON_BACKGROUND
      The background that renders the "on" part of the bar, if it should be different from the default bar background. If this is defined, the background will be instantiated at the full bar size, and clipped to the visible "on" region. Inherited.
    • THUMB_IMAGE

      public static Style<Icon> THUMB_IMAGE
      The image to use for the slider thumb. Inherited.
    • THUMB_ORIGIN

      public static Style<pythagoras.f.IPoint> THUMB_ORIGIN
      The origin of the thumb image (used to center the thumb image over the tray). If left as the default (null), the center of the thumb image will be used as its origin. Inherited.
    • value

      public final react.Value<Float> value
      The value of the slider.
    • range

      public final react.Value<Slider.Range> range
      The range of the slider.
  • Constructor Details

    • Slider

      public Slider()
      Constructs a new slider with empty range and zero value.
    • Slider

      public Slider(float value, float min, float max)
  • Method Details

    • setIncrement

      public Slider setIncrement(float increment)
      Constrains the possible slider values to the given increment. For example, an increment of 1 would mean the possible sliders values are min(), min() + 1, etc, up to max(). Note this only affects internal updates from pointer or mouse handling. The underlying value may be updated arbitrarily.
    • increment

      public Float increment()
      Getter for the slider increment value. Note that it is a Float object and may be null.
    • clicked

      public react.SignalView<Slider> clicked()
      A signal that is emitted when the user has released their finger/pointer after having started adjusting the slider. value will contain the correct current value at the time this signal is emitted.
    • max

      public float max()
      Returns our maximum allowed value.
    • min

      public float min()
      Returns our minimum allowed value.