TextAttribute.java [plain text]
package java.awt.font;
import java.io.InvalidObjectException;
import java.text.AttributedCharacterIterator;
public final class TextAttribute extends AttributedCharacterIterator.Attribute
{
private static final long serialVersionUID = 7744112784117861702L;
public static final TextAttribute BACKGROUND =
new TextAttribute("background");
public static final TextAttribute BIDI_EMBEDDING =
new TextAttribute("bidi_embedding");
public static final TextAttribute CHAR_REPLACEMENT =
new TextAttribute("char_replacement");
public static final TextAttribute FAMILY = new TextAttribute("family");
public static final TextAttribute FONT = new TextAttribute("font");
public static final TextAttribute FOREGROUND =
new TextAttribute("foreground");
public static final TextAttribute INPUT_METHOD_HIGHLIGHT =
new TextAttribute("input method highlight");
public static final TextAttribute INPUT_METHOD_UNDERLINE =
new TextAttribute("input method underline");
public static final TextAttribute JUSTIFICATION =
new TextAttribute("justification");
public static final Float JUSTIFICATION_FULL = new Float(1.0);
public static final Float JUSTIFICATION_NONE = new Float(0.0);
public static final TextAttribute NUMERIC_SHAPING =
new TextAttribute("numeric_shaping");
public static final TextAttribute POSTURE = new TextAttribute("posture");
public static final Float POSTURE_OBLIQUE = new Float(0.2);
public static final Float POSTURE_REGULAR = new Float(0.0);
public static final TextAttribute RUN_DIRECTION =
new TextAttribute("run_direction");
public static final Boolean RUN_DIRECTION_LTR = Boolean.FALSE;
public static final Boolean RUN_DIRECTION_RTL = Boolean.TRUE;
public static final TextAttribute SIZE = new TextAttribute("size");
public static final TextAttribute STRIKETHROUGH =
new TextAttribute("strikethrough");
public static final Boolean STRIKETHROUGH_ON = Boolean.TRUE;
public static final TextAttribute SUPERSCRIPT =
new TextAttribute("superscript");
public static final Integer SUPERSCRIPT_SUB = new Integer(-1);
public static final Integer SUPERSCRIPT_SUPER = new Integer(1);
public static final TextAttribute SWAP_COLORS =
new TextAttribute("swap_colors");
public static final Boolean SWAP_COLORS_ON = Boolean.TRUE;
public static final TextAttribute TRANSFORM = new TextAttribute("transform");
public static final TextAttribute UNDERLINE = new TextAttribute("underline");
public static final Integer UNDERLINE_LOW_DASHED = new Integer(5);
public static final Integer UNDERLINE_LOW_DOTTED = new Integer(3);
public static final Integer UNDERLINE_LOW_GRAY = new Integer(4);
public static final Integer UNDERLINE_LOW_ONE_PIXEL = new Integer(1);
public static final Integer UNDERLINE_LOW_TWO_PIXEL = new Integer(2);
public static final Integer UNDERLINE_ON = new Integer(0);
public static final TextAttribute WEIGHT = new TextAttribute("weight");
public static final Float WEIGHT_BOLD = new Float(2.0);
public static final Float WEIGHT_DEMIBOLD = new Float(1.75);
public static final Float WEIGHT_DEMILIGHT = new Float(0.875);
public static final Float WEIGHT_EXTRA_LIGHT = new Float(0.5);
public static final Float WEIGHT_EXTRABOLD = new Float(2.5);
public static final Float WEIGHT_HEAVY = new Float(2.25);
public static final Float WEIGHT_LIGHT = new Float(0.75);
public static final Float WEIGHT_MEDIUM = new Float(1.5);
public static final Float WEIGHT_REGULAR = new Float(1.0);
public static final Float WEIGHT_SEMIBOLD = new Float(1.25);
public static final Float WEIGHT_ULTRABOLD = new Float(2.75);
public static final TextAttribute WIDTH = new TextAttribute("width");
public static final Float WIDTH_CONDENSED = new Float(0.75);
public static final Float WIDTH_EXTENDED = new Float(1.5);
public static final Float WIDTH_REGULAR = new Float(1.0);
public static final Float WIDTH_SEMI_CONDENSED = new Float(0.875);
public static final Float WIDTH_SEMI_EXTENDED = new Float(1.25);
protected TextAttribute(String name)
{
super(name);
}
protected Object readResolve()
throws InvalidObjectException
{
if (this.getName().equals("background"))
return BACKGROUND;
if (this.getName().equals("bidi_embedding"))
return BIDI_EMBEDDING;
if (this.getName().equals("char_replacement"))
return CHAR_REPLACEMENT;
if (this.getName().equals("family"))
return FAMILY;
if (this.getName().equals("font"))
return FONT;
if (this.getName().equals("foreground"))
return FOREGROUND;
if (this.getName().equals("input method highlight"))
return INPUT_METHOD_HIGHLIGHT;
if (this.getName().equals("input method underline"))
return INPUT_METHOD_UNDERLINE;
if (this.getName().equals("justification"))
return JUSTIFICATION;
if (this.getName().equals("numeric_shaping"))
return NUMERIC_SHAPING;
if (this.getName().equals("posture"))
return POSTURE;
if (this.getName().equals("run_direction"))
return RUN_DIRECTION;
if (this.getName().equals("size"))
return SIZE;
if (this.getName().equals("strikethrough"))
return STRIKETHROUGH;
if (this.getName().equals("superscript"))
return SUPERSCRIPT;
if (this.getName().equals("swap_colors"))
return SWAP_COLORS;
if (this.getName().equals("transform"))
return TRANSFORM;
if (this.getName().equals("underline"))
return UNDERLINE;
if (this.getName().equals("weight"))
return WEIGHT;
if (this.getName().equals("width"))
return WIDTH;
throw new InvalidObjectException("Can't resolve Attribute: " + getName());
}
}