com.threerings.opengl.gui
Class BoundedSnappingRangeModel

java.lang.Object
  extended by com.threerings.opengl.gui.BoundedRangeModel
      extended by com.threerings.opengl.gui.BoundedSnappingRangeModel

public class BoundedSnappingRangeModel
extends BoundedRangeModel

Provides a Bounded range model where values snap to a period.


Constructor Summary
BoundedSnappingRangeModel(int min, int value, int extent, int max, int snap)
          Creates a bounded range model with the specified minimum, current, extent and maximum values, and a snap period.
 
Method Summary
 int getScrollIncrement()
          Returns the increment by which this model should be scrolled when the user presses one of the buttons at the end of the scrollbar.
 void setValue(int value)
          Configures the value of this model.
 
Methods inherited from class com.threerings.opengl.gui.BoundedRangeModel
addChangeListener, createWheelListener, getExtent, getMaximum, getMinimum, getRange, getRatio, getValue, removeChangeListener, setExtent, setMaximum, setMinimum, setRange, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BoundedSnappingRangeModel

public BoundedSnappingRangeModel(int min,
                                 int value,
                                 int extent,
                                 int max,
                                 int snap)
Creates a bounded range model with the specified minimum, current, extent and maximum values, and a snap period.

Method Detail

setValue

public void setValue(int value)
Configures the value of this model. The new value will be adjusted if it does not fall within the range of min <= value <= max - extent or if value is not a modulus of snap.

Overrides:
setValue in class BoundedRangeModel

getScrollIncrement

public int getScrollIncrement()
Description copied from class: BoundedRangeModel
Returns the increment by which this model should be scrolled when the user presses one of the buttons at the end of the scrollbar.

Overrides:
getScrollIncrement in class BoundedRangeModel


Copyright © 2011. All Rights Reserved.