8de728531d7bba13e902adb29d219d370147289a
[jalviewjs.git] / site / j2s / javax / swing / text / StyleContext.js
1 Clazz.declarePackage ("javax.swing.text");
2 Clazz.load (["java.util.Enumeration", "javax.swing.text.AbstractDocument", "$.AttributeSet", "$.Style", "java.util.Collections", "$.HashMap", "$.Hashtable", "$.Vector", "javax.swing.event.EventListenerList", "javax.swing.text.SimpleAttributeSet"], "javax.swing.text.StyleContext", ["java.util.NoSuchElementException", "java.awt.Font", "$.Toolkit", "javax.swing.SwingUtilities", "javax.swing.event.ChangeEvent", "$.ChangeListener", "javax.swing.text.MutableAttributeSet", "$.StyleConstants"], function () {
3 c$ = Clazz.decorateAsClass (function () {
4 this.styles = null;
5 this.fontSearch = null;
6 this.fontTable = null;
7 this.attributesPool = null;
8 this.search = null;
9 if (!Clazz.isClassDefined ("javax.swing.text.StyleContext.SmallAttributeSet")) {
10 javax.swing.text.StyleContext.$StyleContext$SmallAttributeSet$ ();
11 }
12 if (!Clazz.isClassDefined ("javax.swing.text.StyleContext.KeyEnumeration")) {
13 javax.swing.text.StyleContext.$StyleContext$KeyEnumeration$ ();
14 }
15 if (!Clazz.isClassDefined ("javax.swing.text.StyleContext.KeyBuilder")) {
16 javax.swing.text.StyleContext.$StyleContext$KeyBuilder$ ();
17 }
18 if (!Clazz.isClassDefined ("javax.swing.text.StyleContext.NamedStyle")) {
19 javax.swing.text.StyleContext.$StyleContext$NamedStyle$ ();
20 }
21 Clazz.instantialize (this, arguments);
22 }, javax.swing.text, "StyleContext", null, javax.swing.text.AbstractDocument.AttributeContext);
23 Clazz.prepareFields (c$, function () {
24 this.fontSearch =  new javax.swing.text.StyleContext.FontKey (null, 0, 0);
25 this.fontTable =  new java.util.Hashtable ();
26 this.attributesPool = java.util.Collections.synchronizedMap ( new java.util.HashMap ());
27 this.search =  new javax.swing.text.SimpleAttributeSet ();
28 });
29 c$.getDefaultStyleContext = Clazz.defineMethod (c$, "getDefaultStyleContext", 
30 function () {
31 if (javax.swing.text.StyleContext.defaultContext == null) {
32 javax.swing.text.StyleContext.defaultContext =  new javax.swing.text.StyleContext ();
33 }return javax.swing.text.StyleContext.defaultContext;
34 });
35 Clazz.makeConstructor (c$, 
36 function () {
37 this.styles = Clazz.innerTypeInstance (javax.swing.text.StyleContext.NamedStyle, this, null, null);
38 this.addStyle ("default", null);
39 });
40 Clazz.defineMethod (c$, "addStyle", 
41 function (nm, parent) {
42 var style = Clazz.innerTypeInstance (javax.swing.text.StyleContext.NamedStyle, this, null, nm, parent);
43 if (nm != null) {
44 this.styles.addAttribute (nm, style);
45 }return style;
46 }, "~S,javax.swing.text.Style");
47 Clazz.defineMethod (c$, "removeStyle", 
48 function (nm) {
49 this.styles.removeAttribute (nm);
50 }, "~S");
51 Clazz.defineMethod (c$, "getStyle", 
52 function (nm) {
53 return this.styles.getAttribute (nm);
54 }, "~S");
55 Clazz.defineMethod (c$, "getStyleNames", 
56 function () {
57 return this.styles.getAttributeNames ();
58 });
59 Clazz.defineMethod (c$, "addChangeListener", 
60 function (l) {
61 this.styles.addChangeListener (l);
62 }, "javax.swing.event.ChangeListener");
63 Clazz.defineMethod (c$, "removeChangeListener", 
64 function (l) {
65 this.styles.removeChangeListener (l);
66 }, "javax.swing.event.ChangeListener");
67 Clazz.defineMethod (c$, "getChangeListeners", 
68 function () {
69 return (this.styles).getChangeListeners ();
70 });
71 Clazz.defineMethod (c$, "getFont", 
72 function (attr) {
73 var style = 0;
74 if (javax.swing.text.StyleConstants.isBold (attr)) {
75 style |= 1;
76 }if (javax.swing.text.StyleConstants.isItalic (attr)) {
77 style |= 2;
78 }var family = javax.swing.text.StyleConstants.getFontFamily (attr);
79 var size = javax.swing.text.StyleConstants.getFontSize (attr);
80 if (javax.swing.text.StyleConstants.isSuperscript (attr) || javax.swing.text.StyleConstants.isSubscript (attr)) {
81 size -= 2;
82 }return this.getFont (family, style, size);
83 }, "javax.swing.text.AttributeSet");
84 Clazz.defineMethod (c$, "getForeground", 
85 function (attr) {
86 return javax.swing.text.StyleConstants.getForeground (attr);
87 }, "javax.swing.text.AttributeSet");
88 Clazz.defineMethod (c$, "getBackground", 
89 function (attr) {
90 return javax.swing.text.StyleConstants.getBackground (attr);
91 }, "javax.swing.text.AttributeSet");
92 Clazz.defineMethod (c$, "getFont", 
93 function (family, style, size) {
94 this.fontSearch.setValue (family, style, size);
95 var f = this.fontTable.get (this.fontSearch);
96 if (f == null) {
97 var defaultStyle = this.getStyle ("default");
98 if (defaultStyle != null) {
99 var FONT_ATTRIBUTE_KEY = "FONT_ATTRIBUTE_KEY";
100 var defaultFont = defaultStyle.getAttribute ("FONT_ATTRIBUTE_KEY");
101 if (defaultFont != null && defaultFont.getFamily ().equalsIgnoreCase (family)) {
102 f = defaultFont.deriveFont (style, size);
103 }}if (f == null) {
104 f =  new java.awt.Font (family, style, size);
105 }var key =  new javax.swing.text.StyleContext.FontKey (family, style, size);
106 this.fontTable.put (key, f);
107 }return f;
108 }, "~S,~N,~N");
109 Clazz.defineMethod (c$, "getFontMetrics", 
110 function (f) {
111 return java.awt.Toolkit.getDefaultToolkit ().getFontMetrics (f);
112 }, "java.awt.Font");
113 Clazz.overrideMethod (c$, "addAttribute", 
114 function (old, name, value) {
115 if ((old.getAttributeCount () + 1) <= this.getCompressionThreshold ()) {
116 this.search.removeAttributes (this.search);
117 this.search.addAttributes (old);
118 this.search.addAttribute (name, value);
119 this.reclaim (old);
120 return this.getImmutableUniqueSet ();
121 }var ma = this.getMutableAttributeSet (old);
122 ma.addAttribute (name, value);
123 return ma;
124 }, "javax.swing.text.AttributeSet,~O,~O");
125 Clazz.overrideMethod (c$, "addAttributes", 
126 function (old, attr) {
127 if ((old.getAttributeCount () + attr.getAttributeCount ()) <= this.getCompressionThreshold ()) {
128 this.search.removeAttributes (this.search);
129 this.search.addAttributes (old);
130 this.search.addAttributes (attr);
131 this.reclaim (old);
132 return this.getImmutableUniqueSet ();
133 }var ma = this.getMutableAttributeSet (old);
134 ma.addAttributes (attr);
135 return ma;
136 }, "javax.swing.text.AttributeSet,javax.swing.text.AttributeSet");
137 Clazz.overrideMethod (c$, "removeAttribute", 
138 function (old, name) {
139 if ((old.getAttributeCount () - 1) <= this.getCompressionThreshold ()) {
140 this.search.removeAttributes (this.search);
141 this.search.addAttributes (old);
142 this.search.removeAttribute (name);
143 this.reclaim (old);
144 return this.getImmutableUniqueSet ();
145 }var ma = this.getMutableAttributeSet (old);
146 ma.removeAttribute (name);
147 return ma;
148 }, "javax.swing.text.AttributeSet,~O");
149 Clazz.defineMethod (c$, "removeAttributes", 
150 function (old, names) {
151 if (old.getAttributeCount () <= this.getCompressionThreshold ()) {
152 this.search.removeAttributes (this.search);
153 this.search.addAttributes (old);
154 this.search.removeAttributes (names);
155 this.reclaim (old);
156 return this.getImmutableUniqueSet ();
157 }var ma = this.getMutableAttributeSet (old);
158 ma.removeAttributes (names);
159 return ma;
160 }, "javax.swing.text.AttributeSet,java.util.Enumeration");
161 Clazz.defineMethod (c$, "removeAttributes", 
162 function (old, attrs) {
163 if (old.getAttributeCount () <= this.getCompressionThreshold ()) {
164 this.search.removeAttributes (this.search);
165 this.search.addAttributes (old);
166 this.search.removeAttributes (attrs);
167 this.reclaim (old);
168 return this.getImmutableUniqueSet ();
169 }var ma = this.getMutableAttributeSet (old);
170 ma.removeAttributes (attrs);
171 return ma;
172 }, "javax.swing.text.AttributeSet,javax.swing.text.AttributeSet");
173 Clazz.overrideMethod (c$, "getEmptySet", 
174 function () {
175 return javax.swing.text.SimpleAttributeSet.EMPTY;
176 });
177 Clazz.overrideMethod (c$, "reclaim", 
178 function (a) {
179 if (javax.swing.SwingUtilities.isEventDispatchThread ()) {
180 this.attributesPool.size ();
181 }}, "javax.swing.text.AttributeSet");
182 Clazz.defineMethod (c$, "getCompressionThreshold", 
183 function () {
184 return 9;
185 });
186 Clazz.defineMethod (c$, "createSmallAttributeSet", 
187 function (a) {
188 return Clazz.innerTypeInstance (javax.swing.text.StyleContext.SmallAttributeSet, this, null, a);
189 }, "javax.swing.text.AttributeSet");
190 Clazz.defineMethod (c$, "createLargeAttributeSet", 
191 function (a) {
192 return  new javax.swing.text.SimpleAttributeSet (a);
193 }, "javax.swing.text.AttributeSet");
194 Clazz.defineMethod (c$, "removeUnusedSets", 
195 function () {
196 this.attributesPool.size ();
197 });
198 Clazz.defineMethod (c$, "getImmutableUniqueSet", 
199 function () {
200 return null;
201 });
202 Clazz.defineMethod (c$, "getMutableAttributeSet", 
203 function (a) {
204 if (Clazz.instanceOf (a, javax.swing.text.MutableAttributeSet) && a !== javax.swing.text.SimpleAttributeSet.EMPTY) {
205 return a;
206 }return this.createLargeAttributeSet (a);
207 }, "javax.swing.text.AttributeSet");
208 Clazz.defineMethod (c$, "toString", 
209 function () {
210 this.removeUnusedSets ();
211 var s = "";
212 var iterator = this.attributesPool.keySet ().iterator ();
213 while (iterator.hasNext ()) {
214 var set = iterator.next ();
215 s = s + set + "\n";
216 }
217 return s;
218 });
219 c$.registerStaticAttributeKey = Clazz.defineMethod (c$, "registerStaticAttributeKey", 
220 function (key) {
221 var ioFmt = key.getClass ().getName () + "." + key.toString ();
222 if (javax.swing.text.StyleContext.freezeKeyMap == null) {
223 javax.swing.text.StyleContext.freezeKeyMap =  new java.util.Hashtable ();
224 javax.swing.text.StyleContext.thawKeyMap =  new java.util.Hashtable ();
225 }javax.swing.text.StyleContext.freezeKeyMap.put (key, ioFmt);
226 javax.swing.text.StyleContext.thawKeyMap.put (ioFmt, key);
227 }, "~O");
228 c$.getStaticAttribute = Clazz.defineMethod (c$, "getStaticAttribute", 
229 function (key) {
230 if (javax.swing.text.StyleContext.thawKeyMap == null || key == null) {
231 return null;
232 }return javax.swing.text.StyleContext.thawKeyMap.get (key);
233 }, "~O");
234 c$.getStaticAttributeKey = Clazz.defineMethod (c$, "getStaticAttributeKey", 
235 function (key) {
236 return key.getClass ().getName () + "." + key.toString ();
237 }, "~O");
238 c$.$StyleContext$SmallAttributeSet$ = function () {
239 Clazz.pu$h(self.c$);
240 c$ = Clazz.decorateAsClass (function () {
241 Clazz.prepareCallback (this, arguments);
242 this.attributes = null;
243 this.resolveParent = null;
244 Clazz.instantialize (this, arguments);
245 }, javax.swing.text.StyleContext, "SmallAttributeSet", null, javax.swing.text.AttributeSet);
246 Clazz.makeConstructor (c$, 
247 function (a) {
248 this.attributes = a;
249 this.updateResolveParent ();
250 }, "~A");
251 Clazz.makeConstructor (c$, 
252 function (a) {
253 var b = a.getAttributeCount ();
254 var c =  new Array (2 * b);
255 var d = a.getAttributeNames ();
256 var e = 0;
257 while (d.hasMoreElements ()) {
258 c[e] = d.nextElement ();
259 c[e + 1] = a.getAttribute (c[e]);
260 e += 2;
261 }
262 this.attributes = c;
263 this.updateResolveParent ();
264 }, "javax.swing.text.AttributeSet");
265 Clazz.defineMethod (c$, "updateResolveParent", 
266  function () {
267 this.resolveParent = null;
268 var a = this.attributes;
269 for (var b = 0; b < a.length; b += 2) {
270 if (a[b] === javax.swing.text.StyleConstants.ResolveAttribute) {
271 this.resolveParent = a[b + 1];
272 break;
273 }}
274 });
275 Clazz.defineMethod (c$, "getLocalAttribute", 
276 function (a) {
277 if (a === javax.swing.text.StyleConstants.ResolveAttribute) {
278 return this.resolveParent;
279 }var b = this.attributes;
280 for (var c = 0; c < b.length; c += 2) {
281 if (a.equals (b[c])) {
282 return b[c + 1];
283 }}
284 return null;
285 }, "~O");
286 Clazz.overrideMethod (c$, "toString", 
287 function () {
288 var a = "{";
289 var b = this.attributes;
290 for (var c = 0; c < b.length; c += 2) {
291 if (Clazz.instanceOf (b[c + 1], javax.swing.text.AttributeSet)) {
292 a = a + b[c] + "=" + "AttributeSet" + ",";
293 } else {
294 a = a + b[c] + "=" + b[c + 1] + ",";
295 }}
296 a = a + "}";
297 return a;
298 });
299 Clazz.defineMethod (c$, "hashCode", 
300 function () {
301 var a = 0;
302 var b = this.attributes;
303 for (var c = 1; c < b.length; c += 2) {
304 a ^= b[c].hashCode ();
305 }
306 return a;
307 });
308 Clazz.defineMethod (c$, "equals", 
309 function (a) {
310 if (Clazz.instanceOf (a, javax.swing.text.AttributeSet)) {
311 var b = a;
312 return ((this.getAttributeCount () == b.getAttributeCount ()) && this.containsAttributes (b));
313 }return false;
314 }, "~O");
315 Clazz.overrideMethod (c$, "clone", 
316 function () {
317 return this;
318 });
319 Clazz.defineMethod (c$, "getAttributeCount", 
320 function () {
321 return Clazz.doubleToInt (this.attributes.length / 2);
322 });
323 Clazz.overrideMethod (c$, "isDefined", 
324 function (a) {
325 var b = this.attributes;
326 var c = b.length;
327 for (var d = 0; d < c; d += 2) {
328 if (a.equals (b[d])) {
329 return true;
330 }}
331 return false;
332 }, "~O");
333 Clazz.overrideMethod (c$, "isEqual", 
334 function (a) {
335 if (Clazz.instanceOf (a, javax.swing.text.StyleContext.SmallAttributeSet)) {
336 return a === this;
337 }return ((this.getAttributeCount () == a.getAttributeCount ()) && this.containsAttributes (a));
338 }, "javax.swing.text.AttributeSet");
339 Clazz.overrideMethod (c$, "copyAttributes", 
340 function () {
341 return this;
342 });
343 Clazz.defineMethod (c$, "getAttribute", 
344 function (a) {
345 var b = this.getLocalAttribute (a);
346 if (b == null) {
347 var c = this.getResolveParent ();
348 if (c != null) b = c.getAttribute (a);
349 }return b;
350 }, "~O");
351 Clazz.defineMethod (c$, "getAttributeNames", 
352 function () {
353 return Clazz.innerTypeInstance (javax.swing.text.StyleContext.KeyEnumeration, this, null, this.attributes);
354 });
355 Clazz.overrideMethod (c$, "containsAttribute", 
356 function (a, b) {
357 return b.equals (this.getAttribute (a));
358 }, "~O,~O");
359 Clazz.overrideMethod (c$, "containsAttributes", 
360 function (a) {
361 var b = true;
362 var c = a.getAttributeNames ();
363 while (b && c.hasMoreElements ()) {
364 var d = c.nextElement ();
365 b = a.getAttribute (d).equals (this.getAttribute (d));
366 }
367 return b;
368 }, "javax.swing.text.AttributeSet");
369 Clazz.overrideMethod (c$, "getResolveParent", 
370 function () {
371 return this.resolveParent;
372 });
373 c$ = Clazz.p0p ();
374 };
375 c$.$StyleContext$KeyEnumeration$ = function () {
376 Clazz.pu$h(self.c$);
377 c$ = Clazz.decorateAsClass (function () {
378 Clazz.prepareCallback (this, arguments);
379 this.attr = null;
380 this.i = 0;
381 Clazz.instantialize (this, arguments);
382 }, javax.swing.text.StyleContext, "KeyEnumeration", null, java.util.Enumeration);
383 Clazz.makeConstructor (c$, 
384 function (a) {
385 this.attr = a;
386 this.i = 0;
387 }, "~A");
388 Clazz.overrideMethod (c$, "hasMoreElements", 
389 function () {
390 return this.i < this.attr.length;
391 });
392 Clazz.overrideMethod (c$, "nextElement", 
393 function () {
394 if (this.i < this.attr.length) {
395 var a = this.attr[this.i];
396 this.i += 2;
397 return a;
398 }throw  new java.util.NoSuchElementException ();
399 });
400 c$ = Clazz.p0p ();
401 };
402 c$.$StyleContext$KeyBuilder$ = function () {
403 Clazz.pu$h(self.c$);
404 c$ = Clazz.decorateAsClass (function () {
405 Clazz.prepareCallback (this, arguments);
406 this.keys = null;
407 this.data = null;
408 Clazz.instantialize (this, arguments);
409 }, javax.swing.text.StyleContext, "KeyBuilder");
410 Clazz.prepareFields (c$, function () {
411 this.keys =  new java.util.Vector ();
412 this.data =  new java.util.Vector ();
413 });
414 Clazz.defineMethod (c$, "initialize", 
415 function (a) {
416 if (Clazz.instanceOf (a, javax.swing.text.StyleContext.SmallAttributeSet)) {
417 this.initialize ((a).attributes);
418 } else {
419 this.keys.removeAllElements ();
420 this.data.removeAllElements ();
421 var b = a.getAttributeNames ();
422 while (b.hasMoreElements ()) {
423 var c = b.nextElement ();
424 this.addAttribute (c, a.getAttribute (c));
425 }
426 }}, "javax.swing.text.AttributeSet");
427 Clazz.defineMethod (c$, "initialize", 
428  function (a) {
429 this.keys.removeAllElements ();
430 this.data.removeAllElements ();
431 var b = a.length;
432 for (var c = 0; c < b; c += 2) {
433 this.keys.addElement (a[c]);
434 this.data.addElement (a[c + 1]);
435 }
436 }, "~A");
437 Clazz.defineMethod (c$, "createTable", 
438 function () {
439 var a = this.keys.size ();
440 var b =  new Array (2 * a);
441 for (var c = 0; c < a; c++) {
442 var d = 2 * c;
443 b[d] = this.keys.elementAt (c);
444 b[d + 1] = this.data.elementAt (c);
445 }
446 return b;
447 });
448 Clazz.defineMethod (c$, "getCount", 
449 function () {
450 return this.keys.size ();
451 });
452 Clazz.defineMethod (c$, "addAttribute", 
453 function (a, b) {
454 this.keys.addElement (a);
455 this.data.addElement (b);
456 }, "~O,~O");
457 Clazz.defineMethod (c$, "addAttributes", 
458 function (a) {
459 if (Clazz.instanceOf (a, javax.swing.text.StyleContext.SmallAttributeSet)) {
460 var b = (a).attributes;
461 var c = b.length;
462 for (var d = 0; d < c; d += 2) {
463 this.addAttribute (b[d], b[d + 1]);
464 }
465 } else {
466 var b = a.getAttributeNames ();
467 while (b.hasMoreElements ()) {
468 var c = b.nextElement ();
469 this.addAttribute (c, a.getAttribute (c));
470 }
471 }}, "javax.swing.text.AttributeSet");
472 Clazz.defineMethod (c$, "removeAttribute", 
473 function (a) {
474 var b = this.keys.size ();
475 for (var c = 0; c < b; c++) {
476 if (this.keys.elementAt (c).equals (a)) {
477 this.keys.removeElementAt (c);
478 this.data.removeElementAt (c);
479 return;
480 }}
481 }, "~O");
482 Clazz.defineMethod (c$, "removeAttributes", 
483 function (a) {
484 while (a.hasMoreElements ()) {
485 var b = a.nextElement ();
486 this.removeAttribute (b);
487 }
488 }, "java.util.Enumeration");
489 Clazz.defineMethod (c$, "removeAttributes", 
490 function (a) {
491 var b = a.getAttributeNames ();
492 while (b.hasMoreElements ()) {
493 var c = b.nextElement ();
494 var d = a.getAttribute (c);
495 this.removeSearchAttribute (c, d);
496 }
497 }, "javax.swing.text.AttributeSet");
498 Clazz.defineMethod (c$, "removeSearchAttribute", 
499  function (a, b) {
500 var c = this.keys.size ();
501 for (var d = 0; d < c; d++) {
502 if (this.keys.elementAt (d).equals (a)) {
503 if (this.data.elementAt (d).equals (b)) {
504 this.keys.removeElementAt (d);
505 this.data.removeElementAt (d);
506 }return;
507 }}
508 }, "~O,~O");
509 c$ = Clazz.p0p ();
510 };
511 c$.$StyleContext$NamedStyle$ = function () {
512 Clazz.pu$h(self.c$);
513 c$ = Clazz.decorateAsClass (function () {
514 Clazz.prepareCallback (this, arguments);
515 this.listenerList = null;
516 this.changeEvent = null;
517 this.attributes = null;
518 Clazz.instantialize (this, arguments);
519 }, javax.swing.text.StyleContext, "NamedStyle", null, javax.swing.text.Style);
520 Clazz.prepareFields (c$, function () {
521 this.listenerList =  new javax.swing.event.EventListenerList ();
522 });
523 Clazz.makeConstructor (c$, 
524 function (a, b) {
525 this.attributes = this.b$["javax.swing.text.StyleContext"].getEmptySet ();
526 if (a != null) {
527 this.setName (a);
528 }if (b != null) {
529 this.setResolveParent (b);
530 }}, "~S,javax.swing.text.Style");
531 Clazz.makeConstructor (c$, 
532 function (a) {
533 this.construct (null, a);
534 }, "javax.swing.text.Style");
535 Clazz.makeConstructor (c$, 
536 function () {
537 this.attributes = this.b$["javax.swing.text.StyleContext"].getEmptySet ();
538 });
539 Clazz.defineMethod (c$, "toString", 
540 function () {
541 return "NamedStyle:" + this.getName () + " " + this.attributes;
542 });
543 Clazz.overrideMethod (c$, "getName", 
544 function () {
545 if (this.isDefined (javax.swing.text.StyleConstants.NameAttribute)) {
546 return this.getAttribute (javax.swing.text.StyleConstants.NameAttribute).toString ();
547 }return null;
548 });
549 Clazz.defineMethod (c$, "setName", 
550 function (a) {
551 if (a != null) {
552 this.addAttribute (javax.swing.text.StyleConstants.NameAttribute, a);
553 }}, "~S");
554 Clazz.overrideMethod (c$, "addChangeListener", 
555 function (a) {
556 this.listenerList.add (javax.swing.event.ChangeListener, a);
557 }, "javax.swing.event.ChangeListener");
558 Clazz.overrideMethod (c$, "removeChangeListener", 
559 function (a) {
560 this.listenerList.remove (javax.swing.event.ChangeListener, a);
561 }, "javax.swing.event.ChangeListener");
562 Clazz.defineMethod (c$, "getChangeListeners", 
563 function () {
564 return this.listenerList.getListeners (javax.swing.event.ChangeListener);
565 });
566 Clazz.defineMethod (c$, "fireStateChanged", 
567 function () {
568 var a = this.listenerList.getListenerList ();
569 for (var b = a.length - 2; b >= 0; b -= 2) {
570 if (a[b] === javax.swing.event.ChangeListener) {
571 if (this.changeEvent == null) this.changeEvent =  new javax.swing.event.ChangeEvent (this);
572 (a[b + 1]).stateChanged (this.changeEvent);
573 }}
574 });
575 Clazz.defineMethod (c$, "getListeners", 
576 function (a) {
577 return this.listenerList.getListeners (a);
578 }, "Class");
579 Clazz.defineMethod (c$, "getAttributeCount", 
580 function () {
581 return this.attributes.getAttributeCount ();
582 });
583 Clazz.defineMethod (c$, "isDefined", 
584 function (a) {
585 return this.attributes.isDefined (a);
586 }, "~O");
587 Clazz.defineMethod (c$, "isEqual", 
588 function (a) {
589 return this.attributes.isEqual (a);
590 }, "javax.swing.text.AttributeSet");
591 Clazz.defineMethod (c$, "copyAttributes", 
592 function () {
593 var a = Clazz.innerTypeInstance (javax.swing.text.StyleContext.NamedStyle, this, null);
594 a.attributes = this.attributes.copyAttributes ();
595 return a;
596 });
597 Clazz.defineMethod (c$, "getAttribute", 
598 function (a) {
599 return this.attributes.getAttribute (a);
600 }, "~O");
601 Clazz.defineMethod (c$, "getAttributeNames", 
602 function () {
603 return this.attributes.getAttributeNames ();
604 });
605 Clazz.defineMethod (c$, "containsAttribute", 
606 function (a, b) {
607 return this.attributes.containsAttribute (a, b);
608 }, "~O,~O");
609 Clazz.defineMethod (c$, "containsAttributes", 
610 function (a) {
611 return this.attributes.containsAttributes (a);
612 }, "javax.swing.text.AttributeSet");
613 Clazz.defineMethod (c$, "getResolveParent", 
614 function () {
615 return this.attributes.getResolveParent ();
616 });
617 Clazz.overrideMethod (c$, "addAttribute", 
618 function (a, b) {
619 var c = this.b$["javax.swing.text.StyleContext"];
620 this.attributes = c.addAttribute (this.attributes, a, b);
621 this.fireStateChanged ();
622 }, "~O,~O");
623 Clazz.overrideMethod (c$, "addAttributes", 
624 function (a) {
625 var b = this.b$["javax.swing.text.StyleContext"];
626 this.attributes = b.addAttributes (this.attributes, a);
627 this.fireStateChanged ();
628 }, "javax.swing.text.AttributeSet");
629 Clazz.overrideMethod (c$, "removeAttribute", 
630 function (a) {
631 var b = this.b$["javax.swing.text.StyleContext"];
632 this.attributes = b.removeAttribute (this.attributes, a);
633 this.fireStateChanged ();
634 }, "~O");
635 Clazz.defineMethod (c$, "removeAttributes", 
636 function (a) {
637 var b = this.b$["javax.swing.text.StyleContext"];
638 this.attributes = b.removeAttributes (this.attributes, a);
639 this.fireStateChanged ();
640 }, "java.util.Enumeration");
641 Clazz.defineMethod (c$, "removeAttributes", 
642 function (a) {
643 var b = this.b$["javax.swing.text.StyleContext"];
644 if (a === this) {
645 this.attributes = b.getEmptySet ();
646 } else {
647 this.attributes = b.removeAttributes (this.attributes, a);
648 }this.fireStateChanged ();
649 }, "javax.swing.text.AttributeSet");
650 Clazz.overrideMethod (c$, "setResolveParent", 
651 function (a) {
652 if (a != null) {
653 this.addAttribute (javax.swing.text.StyleConstants.ResolveAttribute, a);
654 } else {
655 this.removeAttribute (javax.swing.text.StyleConstants.ResolveAttribute);
656 }}, "javax.swing.text.AttributeSet");
657 c$ = Clazz.p0p ();
658 };
659 Clazz.pu$h(self.c$);
660 c$ = Clazz.decorateAsClass (function () {
661 this.family = null;
662 this.style = 0;
663 this.size = 0;
664 Clazz.instantialize (this, arguments);
665 }, javax.swing.text.StyleContext, "FontKey");
666 Clazz.makeConstructor (c$, 
667 function (a, b, c) {
668 this.setValue (a, b, c);
669 }, "~S,~N,~N");
670 Clazz.defineMethod (c$, "setValue", 
671 function (a, b, c) {
672 this.family = (a != null) ? a.intern () : null;
673 this.style = b;
674 this.size = c;
675 }, "~S,~N,~N");
676 Clazz.overrideMethod (c$, "hashCode", 
677 function () {
678 var a = (this.family != null) ? this.family.hashCode () : 0;
679 return a ^ this.style ^ this.size;
680 });
681 Clazz.overrideMethod (c$, "equals", 
682 function (a) {
683 if (Clazz.instanceOf (a, javax.swing.text.StyleContext.FontKey)) {
684 var b = a;
685 return (this.size == b.size) && (this.style == b.style) && (this.family === b.family);
686 }return false;
687 }, "~O");
688 c$ = Clazz.p0p ();
689 Clazz.defineStatics (c$,
690 "defaultContext", null,
691 "DEFAULT_STYLE", "default",
692 "freezeKeyMap", null,
693 "thawKeyMap", null,
694 "THRESHOLD", 9);
695 {
696 }});