Package limn.graphics

Enum Class ShapedText.Affinity

java.lang.Object
java.lang.Enum<ShapedText.Affinity>
limn.graphics.ShapedText.Affinity
All Implemented Interfaces:
Serializable, Comparable<ShapedText.Affinity>, Constable
Enclosing class:
ShapedText

public static enum ShapedText.Affinity extends Enum<ShapedText.Affinity>
Which side of a char index a caret sits on, and so which of the two points that index can occupy is meant.

A widget that stores this alongside the index is a widget whose caret survives a click on either side of a direction boundary and two arrow presses in a row. One that does not should draw both positions rather than pick one.

  • Enum Constant Details

    • UPSTREAM

      public static final ShapedText.Affinity UPSTREAM
      The caret belongs to the character before the index and draws at its trailing edge. This is the side a caret takes after typing: the text just inserted is what the caret trails, so the next character of the same script appears where the caret is.
    • DOWNSTREAM

      public static final ShapedText.Affinity DOWNSTREAM
      The caret belongs to the character at the index and draws at its leading edge. The side to take when there is nothing better to go on — a caret placed programmatically, or restored with the text.
  • Method Details

    • values

      public static ShapedText.Affinity[] 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 ShapedText.Affinity 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