com.ibm.textlayout.attributes
Class TextAttribute

java.lang.Object
  |
  +--java.text.AttributedCharacterIterator.Attribute
        |
        +--com.ibm.textlayout.attributes.TextAttribute
All Implemented Interfaces:
java.io.Serializable

public class TextAttribute
extends java.text.AttributedCharacterIterator.Attribute

This class contains a number of keys (or attributes) for specifying text styles in a Map. A text style is a collection of key-value pairs, where the key represents a certain characteristic (such as size) and the value tells how that characteristic is realized (ie what the size is).

All of the attributes in TextAttribute specify a class for their value. Map does not enforce these class specifications; however, text rendering code will tend to fail with a ClassCastException if a key's value has an unexpected class.

Some attributes are meaningful for entire paragraphs, not individual characters. These attributes are documented as applying to paragraphs. All other attributes apply to characters.

Many of the field names and values in this class are taken from the JDK 1.2 java.awt.font.TextAttribute class.

See Also:
Map, Serialized Form

Field Summary
static java.lang.Object BACKGROUND
           
static java.lang.Object BIDI_EMBEDDING
          Attribute key for the embedding level for nested bidirectional runs.
static java.lang.Object CHAR_REPLACEMENT
           
static java.lang.Object EXTRA_FIRST_LINE_SPACING
           
static java.lang.Object EXTRA_LINE_SPACING
           
static java.lang.Object FAMILY
           
static java.lang.Object FIRST_LINE_INDENT
          Amount beyond leading margin to indent the first line of a paragraph.
static java.lang.Integer FLUSH_CENTER
           
static java.lang.Integer FLUSH_LEADING
           
static java.lang.Integer FLUSH_TRAILING
           
static java.lang.Object FONT
           
static java.lang.Object FOREGROUND
          Attribute key for the foreground and background color adornment.
static java.lang.Integer FULLY_JUSTIFIED
          Value of LINE_FLUSH for full justification.
static java.lang.Object JUSTIFICATION
          Attribute key for the justification of a paragraph.
static java.lang.Float JUSTIFICATION_FULL
          Justify the line to the full requested width.
static java.lang.Float JUSTIFICATION_NONE
          Do not allow the line to be justified.
static java.lang.Object LEADING_MARGIN
          Leading and trailing margin in paragraph.
static java.lang.Object LINE_FLUSH
          Flush lines left, right, or center.
static java.lang.Object MIN_FIRST_LINE_SPACING
           
static java.lang.Object MIN_LINE_SPACING
           
static java.lang.Object OFFSET
           
static java.lang.Object POSTURE
           
static java.lang.Float POSTURE_OBLIQUE
           
static java.lang.Object RUN_DIRECTION
          Attribute key for the run direction of the line.
static java.lang.Boolean RUN_DIRECTION_LTR
          Left-to-right run direction.
static java.lang.Boolean RUN_DIRECTION_RTL
          Right-to-left run direction.
static java.lang.Object SIZE
           
static java.lang.Object STRIKETHROUGH
           
static java.lang.Boolean STRIKETHROUGH_ON
           
static java.lang.Object SUPERSCRIPT
           
static java.lang.Integer SUPERSCRIPT_SUB
           
static java.lang.Integer SUPERSCRIPT_SUPER
           
static java.lang.Object TAB_RULER
          Tab ruler.
static java.lang.Object TRAILING_MARGIN
           
static java.lang.Object UNDERLINE
           
static java.lang.Integer UNDERLINE_ON
           
static java.lang.Object WEIGHT
           
static java.lang.Float WEIGHT_BOLD
           
 
Fields inherited from class java.text.AttributedCharacterIterator.Attribute
INPUT_METHOD_SEGMENT, LANGUAGE, READING
 
Constructor Summary
protected TextAttribute(java.lang.String name)
           
 
Method Summary
protected  java.lang.Object readResolve()
           
 
Methods inherited from class java.text.AttributedCharacterIterator.Attribute
equals, getName, hashCode, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

FONT

public static final java.lang.Object FONT

FAMILY

public static final java.lang.Object FAMILY

WEIGHT

public static final java.lang.Object WEIGHT

WEIGHT_BOLD

public static final java.lang.Float WEIGHT_BOLD

POSTURE

public static final java.lang.Object POSTURE

POSTURE_OBLIQUE

public static final java.lang.Float POSTURE_OBLIQUE

SIZE

public static final java.lang.Object SIZE

SUPERSCRIPT

public static final java.lang.Object SUPERSCRIPT

SUPERSCRIPT_SUPER

public static final java.lang.Integer SUPERSCRIPT_SUPER

SUPERSCRIPT_SUB

public static final java.lang.Integer SUPERSCRIPT_SUB

FOREGROUND

public static final java.lang.Object FOREGROUND
Attribute key for the foreground and background color adornment.

BACKGROUND

public static final java.lang.Object BACKGROUND

UNDERLINE

public static final java.lang.Object UNDERLINE

UNDERLINE_ON

public static final java.lang.Integer UNDERLINE_ON

STRIKETHROUGH

public static final java.lang.Object STRIKETHROUGH

STRIKETHROUGH_ON

public static final java.lang.Boolean STRIKETHROUGH_ON

OFFSET

public static final java.lang.Object OFFSET

CHAR_REPLACEMENT

public static final java.lang.Object CHAR_REPLACEMENT

EXTRA_LINE_SPACING

public static final java.lang.Object EXTRA_LINE_SPACING

EXTRA_FIRST_LINE_SPACING

public static final java.lang.Object EXTRA_FIRST_LINE_SPACING

FIRST_LINE_INDENT

public static final java.lang.Object FIRST_LINE_INDENT
Amount beyond leading margin to indent the first line of a paragraph.

MIN_LINE_SPACING

public static final java.lang.Object MIN_LINE_SPACING

MIN_FIRST_LINE_SPACING

public static final java.lang.Object MIN_FIRST_LINE_SPACING

LINE_FLUSH

public static final java.lang.Object LINE_FLUSH
Flush lines left, right, or center.

FLUSH_LEADING

public static final java.lang.Integer FLUSH_LEADING

FLUSH_CENTER

public static final java.lang.Integer FLUSH_CENTER

FLUSH_TRAILING

public static final java.lang.Integer FLUSH_TRAILING

FULLY_JUSTIFIED

public static final java.lang.Integer FULLY_JUSTIFIED
Value of LINE_FLUSH for full justification.

LEADING_MARGIN

public static final java.lang.Object LEADING_MARGIN
Leading and trailing margin in paragraph.

TRAILING_MARGIN

public static final java.lang.Object TRAILING_MARGIN

TAB_RULER

public static final java.lang.Object TAB_RULER
Tab ruler. Values are MTabRuler instances.

RUN_DIRECTION

public static final java.lang.Object RUN_DIRECTION
Attribute key for the run direction of the line.

Key

RUN_DIRECTION

Value

Boolean

Constants

RUN_DIRECTION_LTR = true, RUN_DIRECTION_RTL = false

Default

Use the default Unicode base direction from the BIDI algorithm.

Description

Specifies which base run direction to use when positioning mixed directional runs within a paragraph. If this value is RUN_DIRECTION_DEFAULT, TextLayout uses the default Unicode base direction from the BIDI algorithm.

This attribute should have the same value over the whole paragraph.


RUN_DIRECTION_LTR

public static final java.lang.Boolean RUN_DIRECTION_LTR
Left-to-right run direction.
See Also:
RUN_DIRECTION

RUN_DIRECTION_RTL

public static final java.lang.Boolean RUN_DIRECTION_RTL
Right-to-left run direction.
See Also:
RUN_DIRECTION

BIDI_EMBEDDING

public static final java.lang.Object BIDI_EMBEDDING
Attribute key for the embedding level for nested bidirectional runs.

Key

BIDI_EMBEDDING

Value

Integer

Limits

Positive values 1 through 15 are embedding levels, negative values
through -15 are override levels

Default

Use standard BIDI to compute levels from formatting characters in the text.

Description

Specifies the bidi embedding level of the character. When this attribute is present anywhere in a paragraph, then the Unicode characters RLO, LRO, RLE, LRE, PDF are disregarded in the BIDI analysis of that paragraph. See the Unicode Standard v. 2.0, section 3-11.


JUSTIFICATION

public static final java.lang.Object JUSTIFICATION
Attribute key for the justification of a paragraph.

Key

JUSTIFICATION

Value

Float

Limits

0.0 through1.0

Default

1.0

Description

Specifies which fraction of the extra space to use when justification is requested. For example, if the line is 50 points wide and the margins are 70 points apart, a value of 0.5 means that the line is padded to reach a width of 60 points.

This attribute should have the same value over the whole paragraph.


JUSTIFICATION_FULL

public static final java.lang.Float JUSTIFICATION_FULL
Justify the line to the full requested width.
See Also:
JUSTIFICATION

JUSTIFICATION_NONE

public static final java.lang.Float JUSTIFICATION_NONE
Do not allow the line to be justified.
See Also:
JUSTIFICATION
Constructor Detail

TextAttribute

protected TextAttribute(java.lang.String name)
Method Detail

readResolve

protected java.lang.Object readResolve()
                                throws java.io.InvalidObjectException
Overrides:
readResolve in class java.text.AttributedCharacterIterator.Attribute


Copyright (c) 1998-2000 IBM Corporation and others.