Package org.uncommons.watchmaker.swing
Class NumericParameterControl<T extends Number & Comparable<T>>
- java.lang.Object
-
- org.uncommons.watchmaker.swing.NumericParameterControl<T>
-
- Type Parameters:
T
- The numeric type of this control (e.g. Integer, Double).
- All Implemented Interfaces:
EvolutionControl
public class NumericParameterControl<T extends Number & Comparable<T>> extends Object implements EvolutionControl
A GUI control that allows the user to set/update the value of a numeric parameter.
-
-
Constructor Summary
Constructors Constructor Description NumericParameterControl(T minimum, T maximum, T stepSize, T initialValue)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description JSpinner
getControl()
NumberGenerator<T>
getNumberGenerator()
Returns a number generator that simply returns the current value contained in the spinner field.void
reset()
Resets the control to its initial configuration.void
setDescription(String description)
Provides a textual description of the purpose of the control.
-
-
-
Method Detail
-
getControl
public JSpinner getControl()
- Specified by:
getControl
in interfaceEvolutionControl
- Returns:
- The GUI component used by this control.
-
reset
public void reset()
Resets the control to its initial configuration.- Specified by:
reset
in interfaceEvolutionControl
-
getNumberGenerator
public NumberGenerator<T> getNumberGenerator()
Returns a number generator that simply returns the current value contained in the spinner field.- Returns:
- A number generator that can be used to control an evolutionary program.
-
setDescription
public void setDescription(String description)
Provides a textual description of the purpose of the control. This may be displayed somewhere on the GUI component (typically as tooltip text).- Specified by:
setDescription
in interfaceEvolutionControl
- Parameters:
description
- The description of the control.
-
-