Class MultiThumbSliderUi.State

java.lang.Object
com.bric.multislider.MultiThumbSliderUi.State
Enclosing class:
MultiThumbSliderUi<T>

class MultiThumbSliderUi.State extends Object
This records the positions/values of each thumb. This is used when the mouse is pressed, so as the mouse is dragged values can get replaced and rearranged freely. (Including removing and adding thumbs)
  • Field Details

    • values

      T[] values
    • positions

      float[] positions
    • selectedThumb

      int selectedThumb
  • Constructor Details

  • Method Details

    • install

      public void install()
      Make the slider reflect this object
    • removeThumb

      public void removeThumb(int index)
    • setPosition

      public boolean setPosition(int thumbIndex, float newPosition)
    • getNeighbors

      int[] getNeighbors(int thumbIndex)
      Return the left (lesser) neighbor and the right (greater) neighbor. Either index may be -1 if it is not available.
      Parameters:
      thumbIndex - the index of the thumb to examine.
      Returns:
      the left (lesser) neighbor and the right (greater) neighbor.