1:
37:
38:
39: package ;
40:
41: import ;
42: import ;
43:
44:
48: public final class TextAttribute extends AttributedCharacterIterator.Attribute
49: {
50: private static final long serialVersionUID = 7744112784117861702L;
51:
52:
53: public static final TextAttribute BACKGROUND =
54: new TextAttribute("background");
55:
56:
57: public static final TextAttribute BIDI_EMBEDDING =
58: new TextAttribute("bidi_embedding");
59:
60:
61: public static final TextAttribute CHAR_REPLACEMENT =
62: new TextAttribute("char_replacement");
63:
64:
65: public static final TextAttribute FAMILY = new TextAttribute("family");
66:
67:
68: public static final TextAttribute FONT = new TextAttribute("font");
69:
70:
71: public static final TextAttribute FOREGROUND =
72: new TextAttribute("foreground");
73:
74:
75: public static final TextAttribute INPUT_METHOD_HIGHLIGHT =
76: new TextAttribute("input method highlight");
77:
78:
79: public static final TextAttribute INPUT_METHOD_UNDERLINE =
80: new TextAttribute("input method underline");
81:
82:
83: public static final TextAttribute JUSTIFICATION =
84: new TextAttribute("justification");
85:
86:
90: public static final Float JUSTIFICATION_FULL = new Float(1.0);
91:
92:
96: public static final Float JUSTIFICATION_NONE = new Float(0.0);
97:
98:
99: public static final TextAttribute NUMERIC_SHAPING =
100: new TextAttribute("numeric_shaping");
101:
102:
103: public static final TextAttribute POSTURE = new TextAttribute("posture");
104:
105:
106: public static final Float POSTURE_OBLIQUE = new Float(0.2);
107:
108:
109: public static final Float POSTURE_REGULAR = new Float(0.0);
110:
111:
112: public static final TextAttribute RUN_DIRECTION =
113: new TextAttribute("run_direction");
114:
115:
116: public static final Boolean RUN_DIRECTION_LTR = Boolean.FALSE;
117:
118:
119: public static final Boolean RUN_DIRECTION_RTL = Boolean.TRUE;
120:
121:
122: public static final TextAttribute SIZE = new TextAttribute("size");
123:
124:
125: public static final TextAttribute STRIKETHROUGH =
126: new TextAttribute("strikethrough");
127:
128:
129: public static final Boolean STRIKETHROUGH_ON = Boolean.TRUE;
130:
131:
132: public static final TextAttribute SUPERSCRIPT =
133: new TextAttribute("superscript");
134:
135:
136: public static final Integer SUPERSCRIPT_SUB = new Integer(-1);
137:
138:
139: public static final Integer SUPERSCRIPT_SUPER = new Integer(1);
140:
141:
142: public static final TextAttribute SWAP_COLORS =
143: new TextAttribute("swap_colors");
144:
145:
146: public static final Boolean SWAP_COLORS_ON = Boolean.TRUE;
147:
148:
149: public static final TextAttribute TRANSFORM = new TextAttribute("transform");
150:
151:
152: public static final TextAttribute UNDERLINE = new TextAttribute("underline");
153:
154:
155: public static final Integer UNDERLINE_LOW_DASHED = new Integer(5);
156:
157:
158: public static final Integer UNDERLINE_LOW_DOTTED = new Integer(3);
159:
160:
161: public static final Integer UNDERLINE_LOW_GRAY = new Integer(4);
162:
163:
164: public static final Integer UNDERLINE_LOW_ONE_PIXEL = new Integer(1);
165:
166:
167: public static final Integer UNDERLINE_LOW_TWO_PIXEL = new Integer(2);
168:
169:
170: public static final Integer UNDERLINE_ON = new Integer(0);
171:
172:
173: public static final TextAttribute WEIGHT = new TextAttribute("weight");
174:
175:
176: public static final Float WEIGHT_BOLD = new Float(2.0);
177:
178:
179: public static final Float WEIGHT_DEMIBOLD = new Float(1.75);
180:
181:
182: public static final Float WEIGHT_DEMILIGHT = new Float(0.875);
183:
184:
185: public static final Float WEIGHT_EXTRA_LIGHT = new Float(0.5);
186:
187:
188: public static final Float WEIGHT_EXTRABOLD = new Float(2.5);
189:
190:
191: public static final Float WEIGHT_HEAVY = new Float(2.25);
192:
193:
194: public static final Float WEIGHT_LIGHT = new Float(0.75);
195:
196:
197: public static final Float WEIGHT_MEDIUM = new Float(1.5);
198:
199:
200: public static final Float WEIGHT_REGULAR = new Float(1.0);
201:
202:
203: public static final Float WEIGHT_SEMIBOLD = new Float(1.25);
204:
205:
206: public static final Float WEIGHT_ULTRABOLD = new Float(2.75);
207:
208:
209: public static final TextAttribute WIDTH = new TextAttribute("width");
210:
211:
212: public static final Float WIDTH_CONDENSED = new Float(0.75);
213:
214:
215: public static final Float WIDTH_EXTENDED = new Float(1.5);
216:
217:
218: public static final Float WIDTH_REGULAR = new Float(1.0);
219:
220:
221: public static final Float WIDTH_SEMI_CONDENSED = new Float(0.875);
222:
223:
224: public static final Float WIDTH_SEMI_EXTENDED = new Float(1.25);
225:
226:
231: protected TextAttribute(String name)
232: {
233: super(name);
234: }
235:
236:
244: protected Object readResolve()
245: throws InvalidObjectException
246: {
247: if (this.getName().equals("background"))
248: return BACKGROUND;
249:
250: if (this.getName().equals("bidi_embedding"))
251: return BIDI_EMBEDDING;
252:
253: if (this.getName().equals("char_replacement"))
254: return CHAR_REPLACEMENT;
255:
256: if (this.getName().equals("family"))
257: return FAMILY;
258:
259: if (this.getName().equals("font"))
260: return FONT;
261:
262: if (this.getName().equals("foreground"))
263: return FOREGROUND;
264:
265: if (this.getName().equals("input method highlight"))
266: return INPUT_METHOD_HIGHLIGHT;
267:
268: if (this.getName().equals("input method underline"))
269: return INPUT_METHOD_UNDERLINE;
270:
271: if (this.getName().equals("justification"))
272: return JUSTIFICATION;
273:
274: if (this.getName().equals("numeric_shaping"))
275: return NUMERIC_SHAPING;
276:
277: if (this.getName().equals("posture"))
278: return POSTURE;
279:
280: if (this.getName().equals("run_direction"))
281: return RUN_DIRECTION;
282:
283: if (this.getName().equals("size"))
284: return SIZE;
285:
286: if (this.getName().equals("strikethrough"))
287: return STRIKETHROUGH;
288:
289: if (this.getName().equals("superscript"))
290: return SUPERSCRIPT;
291:
292: if (this.getName().equals("swap_colors"))
293: return SWAP_COLORS;
294:
295: if (this.getName().equals("transform"))
296: return TRANSFORM;
297:
298: if (this.getName().equals("underline"))
299: return UNDERLINE;
300:
301: if (this.getName().equals("weight"))
302: return WEIGHT;
303:
304: if (this.getName().equals("width"))
305: return WIDTH;
306:
307: throw new InvalidObjectException("Can't resolve Attribute: " + getName());
308: }
309: }