Package com.bric.multislider
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 Summary
Fields Modifier and Type Field Description (package private) float[]
positions
(package private) int
selectedThumb
(package private) T[]
values
-
Constructor Summary
Constructors Constructor Description State()
State(MultiThumbSliderUI.State s)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (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 Detail
-
values
T[] values
-
positions
float[] positions
-
selectedThumb
int selectedThumb
-
-
Constructor Detail
-
State
public State()
-
State
public State(MultiThumbSliderUI.State s)
-
-
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.
-
-