Package docking.widgets.values
Class BooleanValue
Value class for
Boolean
types. Boolean types use a JCheckBox
for displaying and
modifying values. Because the checkBox is always either checked or unchecked,
BooleanValues don't support the concept of having no value.
This class and other subclasses of AbstractValue
are part of a subsystem for easily
defining a set of values that can be displayed in an input dialog (ValuesMapDialog
).
Typically, these values are created indirectly using a GValuesMap
which is then
given to the constructor of the dialog. However, an alternate approach is to create the
dialog without a ValuesMap and then use its ValuesMapDialog.addValue(AbstractValue)
method directly.
-
Method Summary
Modifier and TypeMethodDescriptionprotected Boolean
fromString
(String valueString) Parses the given string into a value of type TReturns a JComponent for entering or editing a value of this type.protected void
Updates the JComponent returned fromAbstractValue.getComponent()
to represent the current value of this object.protected void
Causes the stored value for this object to be updated based on the state of the JComponent returned fromAbstractValue.getComponent()
-
Method Details
-
getComponent
Description copied from class:AbstractValue
Returns a JComponent for entering or editing a value of this type.- Specified by:
getComponent
in classAbstractValue<Boolean>
- Returns:
- a JComponent for entering or editing a value of this type.
-
updateValueFromComponent
protected void updateValueFromComponent()Description copied from class:AbstractValue
Causes the stored value for this object to be updated based on the state of the JComponent returned fromAbstractValue.getComponent()
- Specified by:
updateValueFromComponent
in classAbstractValue<Boolean>
-
updateComponentFromValue
protected void updateComponentFromValue()Description copied from class:AbstractValue
Updates the JComponent returned fromAbstractValue.getComponent()
to represent the current value of this object.- Specified by:
updateComponentFromValue
in classAbstractValue<Boolean>
-
fromString
Description copied from class:AbstractValue
Parses the given string into a value of type T- Specified by:
fromString
in classAbstractValue<Boolean>
- Parameters:
valueString
- the string to parse- Returns:
- a value of type T
-