Record Class ValueFacet
- Record Components:
value- the current value, or the minimum whenemptymin- the smallest value the node acceptsmax- the largest value the node acceptsstep- one increment, or0when the node has no steptext- the value as the node displays it, ornullwhen the number is the whole of itreadOnly- whether the value may be read and not setempty- whether the node holds no number at all, its range and text standing
It carries the number and the text, because a value can have two forms and both are
wanted at once: a spinner in time mode holds 450 and displays 07:30, and one platform
asks the same element for both through two different interfaces. The text is already resolved
under the node's own locale; nothing downstream formats anything.
A value can say it has no number: a date segment nobody has typed into has a range and
a text and nothing in between. Such a facet is empty(), keeps its min,
max, step and text, and carries the minimum as its
value, because two platforms have no way to answer "no number" where a number is
mandatory (UIA's RangeValue.Value, AT-SPI's CurrentValue) and the minimum is what
they answer there; the text and the events are what say empty. A bridge that can say it, says it
from this flag and not from the number.
A value that advances on its own — a playing video's position, a determinate progress bar — is published rounded to the resolution a user can act on, by the widget. The tree compares what it is given, so an unrounded position would make the comparison find a change on every frame of playback and copy the whole tree for an hour with nobody touching anything.
A value a user may read and not set — a progress bar — says so here, because the
facet's presence is what advertises a set on every platform and nothing else could take it back:
Accessible.State.READ_ONLY is derived from this field, never declared, so a widget that
publishes a range it refuses to accept is a range a bridge reports writable.
The tree raises AccessibleEvent.Type.VALUE_CHANGED when the number, the text
or the emptiness moved: a segment filled with a digit that happens to be its minimum
changes only its text and its emptiness, and a reader has to hear it.
-
Constructor Summary
ConstructorsConstructorDescriptionValueFacet(double value, double min, double max, double step, @Nullable String text, boolean readOnly) A value that has a number: the shape every widget but a blank segment publishes.ValueFacet(double value, double min, double max, double step, @Nullable String text, boolean readOnly, boolean empty) Creates an instance of aValueFacetrecord class. -
Method Summary
Modifier and TypeMethodDescriptionbooleanempty()Returns the value of theemptyrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.doublemax()Returns the value of themaxrecord component.doublemin()Returns the value of theminrecord component.booleanreadOnly()Returns the value of thereadOnlyrecord component.doublestep()Returns the value of thesteprecord component.@Nullable Stringtext()Returns the value of thetextrecord component.final StringtoString()Returns a string representation of this record class.doublevalue()Returns the value of thevaluerecord component.
-
Constructor Details
-
ValueFacet
public ValueFacet(double value, double min, double max, double step, @Nullable String text, boolean readOnly) A value that has a number: the shape every widget but a blank segment publishes.- Parameters:
value- the current valuemin- the smallest value the node acceptsmax- the largest value the node acceptsstep- one increment, or0when the node has no steptext- the value as displayed, ornullreadOnly- whether the value may be read and not set
-
ValueFacet
public ValueFacet(double value, double min, double max, double step, @Nullable String text, boolean readOnly, boolean empty) Creates an instance of aValueFacetrecord class.- Parameters:
value- the value for thevaluerecord componentmin- the value for theminrecord componentmax- the value for themaxrecord componentstep- the value for thesteprecord componenttext- the value for thetextrecord componentreadOnly- the value for thereadOnlyrecord componentempty- the value for theemptyrecord component
-
-
Method Details
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
value
public double value()Returns the value of thevaluerecord component.- Returns:
- the value of the
valuerecord component
-
min
public double min()Returns the value of theminrecord component.- Returns:
- the value of the
minrecord component
-
max
public double max()Returns the value of themaxrecord component.- Returns:
- the value of the
maxrecord component
-
step
public double step()Returns the value of thesteprecord component.- Returns:
- the value of the
steprecord component
-
text
Returns the value of thetextrecord component.- Returns:
- the value of the
textrecord component
-
readOnly
public boolean readOnly()Returns the value of thereadOnlyrecord component.- Returns:
- the value of the
readOnlyrecord component
-
empty
public boolean empty()Returns the value of theemptyrecord component.- Returns:
- the value of the
emptyrecord component
-