Package limn.scene

Enum Class Change.Origin

java.lang.Object
java.lang.Enum<Change.Origin>
limn.scene.Change.Origin
All Implemented Interfaces:
Serializable, Comparable<Change.Origin>, Constable
Enclosing interface:
Change

public static enum Change.Origin extends Enum<Change.Origin>
What moved the change, and the whole of this record's rule:
The handler runs when, and only when, the user operated this widget. The watchers run for every change, whatever moved it.

A component decides the origin at the seam that announces, without any judgement about what a method is called: it knows whether it is inside onMouseEvent, onKeyEvent, onCharTyped or onPreedit, or inside a public setter.

Three consequences, and all three are subtractions. Termination is structural: a handler's writes are not user input, so they reach no second handler and two controls bound to each other through their handlers cannot recurse at all. The echo guards delete: a caller writing a widget to keep it in step with another can no longer be heard by that widget's application handler, so there is nothing to guard against. And a poll that writes a widget ten times a second — a transport bar following a film — is a caller's write, so it moves the bar and scrubs nothing.

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 Constants
    Enum Constant
    Description
    The widget moved this itself, because something else changed: a step grid re-snapping a value, a list refreshing past its selection, a tab pane taking its first tab, focus revoked because the widget holding it was hidden.
    A caller wrote the state this mutator names: setValue, setChecked, setText, setSelectedIndex, setVisible, and a verb invoked from code.
    A person operated this control: a pointer, a key, an IME commit, or an assistive technology performing the control's action on the person's behalf.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the enum constant of this class with the specified name.
    static Change.Origin[]
    Returns an array containing the constants of this enum class, in the order they are declared.

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • Enum Constant Details

    • USER

      public static final Change.Origin USER
      A person operated this control: a pointer, a key, an IME commit, or an assistive technology performing the control's action on the person's behalf. This is the only origin that reaches the handler.
    • CODE

      public static final Change.Origin CODE
      A caller wrote the state this mutator names: setValue, setChecked, setText, setSelectedIndex, setVisible, and a verb invoked from code.

      A change is CODE when its aspect is the one the call's own contract names and the call is one an application can make. A mutator that is not public has no CODE reading to default to: its origin is the origin its callers hand it, and if every caller is an input handler it takes USER and nothing else.

    • ADJUSTMENT

      public static final Change.Origin ADJUSTMENT
      The widget moved this itself, because something else changed: a step grid re-snapping a value, a list refreshing past its selection, a tab pane taking its first tab, focus revoked because the widget holding it was hidden.

      CODE and ADJUSTMENT are treated identically by the rule — neither reaches the handler. The distinction earns its keep by naming what a bridge announces as a state update rather than an interaction, and by letting a two-way binding break an echo.

  • Method Details

    • values

      public static Change.Origin[] 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

      public static Change.Origin valueOf(String name)
      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 name
      NullPointerException - if the argument is null