Class 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 Detail

      • values

        T[] values
      • positions

        float[] positions
      • selectedThumb

        int selectedThumb
    • Method Detail

      • 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.