Enum TextAttribute

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<TextAttribute>

    @API(type=EXTENDABLE,
         src=PRIVATE)
    public enum TextAttribute
    extends java.lang.Enum<TextAttribute>
    Constants for the AttributedString attributes. Similar to the TextAttribute class.
    • Enum Constant Detail

      • WEIGHT_BOLD

        public static final TextAttribute WEIGHT_BOLD
        Value for the weight.
      • POSTURE

        public static final TextAttribute POSTURE
        The font posture (like italic, regular)
      • POSTURE_REGULAR

        public static final TextAttribute POSTURE_REGULAR
        The standard posture value, upright. This is the default value for POSTURE.
        See Also:
        POSTURE
      • POSTURE_OBLIQUE

        public static final TextAttribute POSTURE_OBLIQUE
        The standard italic posture value.
        See Also:
        POSTURE
      • RELATIVE_SIZE

        public static final TextAttribute RELATIVE_SIZE
        The relative size of the font
      • RELATIVE_SIZE_SMALL

        public static final TextAttribute RELATIVE_SIZE_SMALL
        A value for the relative size. Imposes a smaller size for the font.
        See Also:
        RELATIVE_SIZE
      • RUN_DIRECTION

        public static final TextAttribute RUN_DIRECTION
        Attribute key for the run direction of the line. Values are instances of Boolean. The default value is null, which indicates that the standard Bidi algorithm for determining run direction should be used with the value Bidi.DIRECTION_DEFAULT_LEFT_TO_RIGHT.

        The constants RUN_DIRECTION_RTL and RUN_DIRECTION_LTR are provided.

        This determines the value passed to the Bidi constructor to select the primary direction of the text in the paragraph.

        Note: This attribute should have the same value for all the text in a paragraph, otherwise the behavior is undetermined.

        See Also:
        Bidi
      • FONT

        public static final TextAttribute FONT
        Specifies a font for a text interval. The value should be an instance of Font.
      • STRIKETHROUGH

        public static final TextAttribute STRIKETHROUGH
        Strike through
      • UNDERLINE

        public static final TextAttribute UNDERLINE
        Underline. The value should be an instance of Boolean.
    • Method Detail

      • values

        public static TextAttribute[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (TextAttribute c : TextAttribute.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static TextAttribute valueOf​(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null