RePast
v. 2.0

uchicago.src.reflector
Class RangePropertyDescriptor

java.lang.Object
  |
  +--uchicago.src.reflector.PropertyDescriptor
        |
        +--uchicago.src.reflector.RangePropertyDescriptor

public class RangePropertyDescriptor
extends PropertyDescriptor

A property descriptor for limiting an integer value to a specified range. A RangePropertyDescriptor is a descriptor for a parameter / property whose value can be expressed as falling within a range of integer values. It is useful when you want to restrict user input to some value within a range of integers. The range is represented in the gui by a slider with minimum and maximum values and a text box into which you can type some specific value. If the value you enter is greater than the maximum allowable value or less than the minimum value the actual value will be set to the maximum or minimum respectively. Similarly, if you enter a non-numerical value into the text box the value will default to the most recent valid value. Selecting an integer from within the range either via the slider or the text box calls the appropriate set method in your model.


Constructor Summary
RangePropertyDescriptor(String name, int min, int max, int tickSpacing)
          Constructs this RangePropertyDescriptor for the named property with the specified range and tick spacing.
 
Method Summary
 PropertyWidget getWidget()
          Returns the PropertyWidget associated with this PropertyDescriptor.
 
Methods inherited from class uchicago.src.reflector.PropertyDescriptor
getName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RangePropertyDescriptor

public RangePropertyDescriptor(String name,
                               int min,
                               int max,
                               int tickSpacing)
Constructs this RangePropertyDescriptor for the named property with the specified range and tick spacing. The tick spacing parameter determines the display of intermediate values in the slider. For example, a range of 10 - 100 and a tick spacing of 10 will display ticks on the slider for 20, 30, 40 and so on up to 90. Note that this only determines the display, any integer value between 10 - 100, in this case, can be selected.

Parameters:
name - the of the property
min - the minimum valueq
max - the maximum value
tickSpacing - an int value that determines how often the ticks are labeled in the slider
Method Detail

getWidget

public PropertyWidget getWidget()
Returns the PropertyWidget associated with this PropertyDescriptor.

Specified by:
getWidget in class PropertyDescriptor

RePast
v. 2.0

Bug reports and feature requests to RePast