FloatControl
This class encapsulates the functionality of DynamicControl
classes of type ControlType.FLOAT
in a simple API
FloatControlSender
and other FloatControl
objects is that @link FloatControlSender} does not have a handler, however, you can still retrieve the current value using the FloatControl.getValue()
FloatControl
objects with the same name and ControlScope
will respond to a message send.
* FloatControlSender
and FloatTextControl
display the approximate value of the control in the HappyBrackets IDE.
* Within the IDE, the value of the value of the control can be changed by typing a new value in and pressing the ENTER or RETURN key.
FloatControlSender
is identical to the FloatTextControl
except that FloatControlSender
does not have a FloatControl.valueChanged(double)
) handler
FloatControl
for general information about FloatControl
classes and how to set the value within your codepublic class FloatControlSender extends FloatTextControl
Constructor and Description |
---|
FloatControlSender(java.lang.Object parent_sketch,
java.lang.String name,
double initial_value)
Deprecated.
use
FloatControl |
Modifier and Type | Method and Description |
---|---|
FloatTextControl |
setControlScope(ControlScope new_scope)
Deprecated.
Changed the scope that the control has.
|
void |
valueChanged(double control_val)
Deprecated.
When the control receives the value, it will be passed through to the FloatControl.valueChanged(double) listener that is implemented when the class is created. |
setDisplayType
getValue, setDisplayRange, setValue, setValue
addControlListener, addControlScopeListener, addControlTarget, addControlTarget, clearControlTargets, getDynamicControl, getSendingDevice, removeControlListener, removeControlScopeChangedListener, removeControlTarget, removeControlTarget, removeListeners, setControlTarget, setControlTarget
public FloatControlSender(java.lang.Object parent_sketch, java.lang.String name, double initial_value)
FloatControl
parent_sketch
- The parent object for controlname
- The name to Displayinitial_value
- Initial value of the objectpublic void valueChanged(double control_val)
FloatControl
FloatControl.valueChanged(double)
listener that is implemented when the class is created.
FloatControl control1 = new FloatControl(this, "Read", 1.0); FloatControl control2 = new FloatControl(this, "Read", 1.0){ @Override public void valueChanged(double new_value){ System.out.println("Read "+ new_value); } } // Setting the value of control1 will cause any objects listening to control1 or control2 to receive the action. EG control1.setValue(2.0); // This will also set the value of control2reflected in its
FloatControl.valueChanged(double)
function, causing Read 2.0 to be printed to standard output.
valueChanged
in class FloatControl
control_val
- the value receivedpublic FloatTextControl setControlScope(ControlScope new_scope)
setControlScope
in class FloatTextControl
new_scope
- The new Control Scope