BooleanControl
instead
This class encapsulates the functionality of DynamicControl
classes of type ControlType.BOOLEAN
in a simple API.
BooleanControlSender
and BooleanControl
is that BooleanControlSender
does not have a BooleanControl.valueChanged(Boolean)
handler, however, you can still retrieve the current value using the BooleanControl.getValue()
BooleanControl
for more detail.public class BooleanControlSender extends BooleanControl
Constructor and Description |
---|
BooleanControlSender(java.lang.Object parent_sketch,
java.lang.String name,
java.lang.Boolean initial_value)
Deprecated.
use
BooleanControl instead |
Modifier and Type | Method and Description |
---|---|
BooleanControlSender |
setControlScope(ControlScope new_scope)
Deprecated.
Changed the
ControlScope that the control has. |
void |
valueChanged(java.lang.Boolean control_val)
Deprecated.
Fired event that occurs when the value for the control has been set.
|
getValue, setDisplayType, setValue, setValue
addControlListener, addControlScopeListener, addControlTarget, addControlTarget, clearControlTargets, getDynamicControl, getSendingDevice, removeControlListener, removeControlScopeChangedListener, removeControlTarget, removeControlTarget, removeListeners, setControlTarget, setControlTarget
public BooleanControlSender(java.lang.Object parent_sketch, java.lang.String name, java.lang.Boolean initial_value)
BooleanControl
insteadparent_sketch
- The parent object for controlname
- The name to Displayinitial_value
- Initial value of the objectpublic void valueChanged(java.lang.Boolean control_val)
BooleanControl
DynamicControl
with matching name, type and ControlScope
and call BooleanControl.valueChanged(Boolean)
.
The function must be implemented when creating objects
BooleanControl control1 = new BooleanControl(this, "Read", false); BooleanControl control2 = new BooleanControl(this, "Read", false) { @Override public void valueChanged(Boolean control_val) { System.out.println("Read " + control_val); } };// End DynamicControl control2 code control1.setValue(true);// Setting control1 will also set control2
BooleanControl.valueChanged(Boolean)
function to be called with the new value, causing Read true to be printed to standard outputvalueChanged
in class BooleanControl
control_val
- The new value of the controlpublic BooleanControlSender setControlScope(ControlScope new_scope)
ControlScope
that the control has. It will update control map so the correct events will be generated based on its scopesetControlScope
in class BooleanControl
new_scope
- The new ControlScope