Enum Class Shape
- All Implemented Interfaces:
Serializable,Comparable<Shape>,Constable
UNCLASSIFIED, which the gallery's ratchet
refuses, so that a new widget cannot publish a combination nothing downstream has a name for.
Why derived and not a field. A field on the node would be one more thing for three platform tables to translate and for a reader on a guest to be shown, and it could disagree with the facets beside it. A derivation costs the bridges nothing, is exact by construction, and is tested in the model; what a field would have caught — a widget that declares one shape and publishes another — the shape's contract catches instead.
The order below is the rule. Each shape is claimed by a facet or by the closed family of roles that implies that facet, and a node with two candidates takes the first that matches, reading the constants top to bottom. The role families are there so that a shape does not change with state: a disabled button loses its verbs to the walk and an indeterminate progress bar has no value, and each is still what it was. Where a facet and a role disagree the earlier shape wins, which is how:
- a check menu item carrying a toggle, and a menu title carrying a popup, are
MENUrows (the family comes before any facet); - a table's row, a selection member without a cell, is a
ROWSmember under aGRIDcontainer, and a calendar's week row, which is in no selection, is aGRIDrow; - a widget hung under a synthetic row keeps its own shape: the
CellFacetthe table writes onto it is its position, which a grid adapter reads on any node, and not its shape — a switch in a cell is aTOGGLE; - a combo box, which carries a value (its index in its options), is the
POPUP_OWNERof its list, because the popup is decided ahead of the value; - a search field, which offers
PRESS, is aTEXT, because the text is decided ahead of the leaf.
A 1.x minor release may add constants to this enum: a switch over it needs a
default branch.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionA table and its grid: theTABLE(or any node carrying aTableFacet), itsCOLUMN_HEADERs andCELLs, and aROWthat is in no selection.A leaf that can be pressed and is nothing else: aBUTTON, or any node offeringPRESSthat no earlier shape claimed.A menu bar, a menu, or a row of one:MENU_BAR,MENU,MENU_ITEM,CHECK_MENU_ITEM,RADIO_MENU_ITEM.A container that holds a selection and the members that are in it: aLIST, aTREE, aTAB_LIST, aRADIO_GROUP, a table's or a calendar's rows; aLIST_ITEM, aTREE_ITEM, aTAB, aRADIO_BUTTON, a segment, a selectableROW; and any other node carrying aSelectionFacetor aSelectionItemFacet.A sentence a reader reads and cannot act on: aLABEL, aHEADING, anALERT.A surface with a role and none of the above: a window, a dialog, a group, a scroll pane, a tool bar, a tab panel, a split pane, a canvas, an image, a video, a chart, a separator, a colour chooser.No shape: only a node whose role isUNKNOWN, which the walk already refuses to publish.A node with aValueFacet, or aSLIDER, aSPIN_BUTTON, aPROGRESS_BAR(also while indeterminate, when it carries no value), aSCROLL_BAR, aSPLITTER: a date field's segment and a colour picker's rail are spin buttons and sliders. -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanisMenuRole(Accessible.Role role) Whether a role belongs to the menu family, which decidesMENUbefore any facet.static Shapeof(AccessibleNode node) Classifies a published node by the order the constants are declared in.static ShapeReturns the enum constant of this class with the specified name.static Shape[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
MENU
A menu bar, a menu, or a row of one:MENU_BAR,MENU,MENU_ITEM,CHECK_MENU_ITEM,RADIO_MENU_ITEM. Decided by the role family alone, because the family never appears outside a menu and its rows carry the facets of other shapes (a toggle, a popup, a selection membership) without being those shapes to a reader. -
GRID
A table and its grid: theTABLE(or any node carrying aTableFacet), itsCOLUMN_HEADERs andCELLs, and aROWthat is in no selection. A grid is rows whose members carry cells, so a table's selectable row is aROWSmember under aGRIDcontainer, and the grid's rules (a cell is found by its facet; a header sorts) are added on top of the rows' rules. A cell facet on a node of another role is that node's position in the grid, not its shape. -
ROWS
A container that holds a selection and the members that are in it: aLIST, aTREE, aTAB_LIST, aRADIO_GROUP, a table's or a calendar's rows; aLIST_ITEM, aTREE_ITEM, aTAB, aRADIO_BUTTON, a segment, a selectableROW; and any other node carrying aSelectionFacetor aSelectionItemFacet. What the reader does to a row — select, add, deselect, focus, press, expand, collapse, scroll into view — is one set of rules, whichever widget publishes the row. -
POPUP_OWNER
A node that opens something:HAS_POPUPon it, anExpandFacet, or theCOMBO_BOXrole. A combo box, a date field's or a date picker's group, a colour picker button, a context region, a tab strip's overflow button, and a button that discloses content in place (a calendar's month title). What it opens is described where it lives and gated by the layer it opens in. -
TOGGLE
-
VALUE
A node with aValueFacet, or aSLIDER, aSPIN_BUTTON, aPROGRESS_BAR(also while indeterminate, when it carries no value), aSCROLL_BAR, aSPLITTER: a date field's segment and a colour picker's rail are spin buttons and sliders. -
TEXT
-
LEAF_ACTION
A leaf that can be pressed and is nothing else: aBUTTON, or any node offeringPRESSthat no earlier shape claimed. -
STATIC
A sentence a reader reads and cannot act on: aLABEL, aHEADING, anALERT. -
SURFACE
A surface with a role and none of the above: a window, a dialog, a group, a scroll pane, a tool bar, a tab panel, a split pane, a canvas, an image, a video, a chart, a separator, a colour chooser. The walk's free verbs and, on a scroll pane, theScrollFacetare all it carries. -
UNCLASSIFIED
No shape: only a node whose role isUNKNOWN, which the walk already refuses to publish. Kept so that the classification is total and the gallery ratchet has something to refuse.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
of
Classifies a published node by the order the constants are declared in.- Parameters:
node- a node of a published tree- Returns:
- its shape;
UNCLASSIFIEDonly for anUNKNOWNrole
-
isMenuRole
Whether a role belongs to the menu family, which decidesMENUbefore any facet.- Parameters:
role- a role- Returns:
- true for
MENU_BAR,MENU,MENU_ITEM,CHECK_MENU_ITEMandRADIO_MENU_ITEM
-