Watchmaker Framework for Evolutionary Computation API
(Version 0.7.1)

org.uncommons.watchmaker.swing
Class NumericParameterControl<T extends Number & Comparable<T>>

java.lang.Object
  extended by 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.

Author:
Daniel Dyer

Constructor Summary
NumericParameterControl(T minimum, T maximum, T stepSize, T initialValue)
           
 
Method Summary
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NumericParameterControl

public NumericParameterControl(T minimum,
                               T maximum,
                               T stepSize,
                               T initialValue)
Method Detail

getControl

public JSpinner getControl()

Specified by:
getControl in interface EvolutionControl
Returns:
The GUI component used by this control.

reset

public void reset()
Resets the control to its initial configuration.

Specified by:
reset in interface EvolutionControl

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 interface EvolutionControl
Parameters:
description - The description of the control.

Watchmaker Framework for Evolutionary Computation API
(Version 0.7.1)