Package com.bric.multislider
Class MultiThumbSliderUi.State
java.lang.Object
com.bric.multislider.MultiThumbSliderUi.State
- Enclosing class:
- MultiThumbSliderUi<T>
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 Summary
Modifier and TypeFieldDescription(package private) float[]
(package private) int
(package private) T[]
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription(package private) int[]
getNeighbors
(int thumbIndex) Return the left (lesser) neighbor and the right (greater) neighbor.void
install()
Make the slider reflect this objectvoid
removeThumb
(int index) boolean
setPosition
(int thumbIndex, float newPosition)
-
Field Details
-
values
T[] values -
positions
float[] positions -
selectedThumb
int selectedThumb
-
-
Constructor Details
-
State
public State() -
State
-
-
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.
-