1 Clazz.declarePackage ("java.awt.font");
2 Clazz.load (null, "java.awt.font.FontRenderContext", ["java.awt.RenderingHints", "java.awt.geom.AffineTransform"], function () {
3 c$ = Clazz.decorateAsClass (function () {
5 this.aaHintValue = null;
6 this.fmHintValue = null;
7 this.defaulting = false;
8 Clazz.instantialize (this, arguments);
9 }, java.awt.font, "FontRenderContext");
10 Clazz.makeConstructor (c$,
12 this.defaulting = true;
14 Clazz.makeConstructor (c$,
15 function (tx, isAntiAliased, usesFractionalMetrics) {
16 if (tx != null && !tx.isIdentity ()) {
17 this.tx = new java.awt.geom.AffineTransform (tx);
18 }}, "java.awt.geom.AffineTransform,~B,~B");
19 Clazz.makeConstructor (c$,
20 function (tx, aaHint, fmHint) {
21 if (tx != null && !tx.isIdentity ()) {
22 this.tx = new java.awt.geom.AffineTransform (tx);
23 }this.aaHintValue = aaHint;
24 this.fmHintValue = fmHint;
25 }, "java.awt.geom.AffineTransform,~O,~O");
26 Clazz.defineMethod (c$, "isTransformed",
28 if (!this.defaulting) {
29 return this.tx != null;
31 return !this.getTransform ().isIdentity ();
33 Clazz.defineMethod (c$, "getTransformType",
35 if (!this.defaulting) {
36 if (this.tx == null) {
39 return this.tx.getType ();
41 return this.getTransform ().getType ();
43 Clazz.defineMethod (c$, "getTransform",
45 return (this.tx == null) ? new java.awt.geom.AffineTransform () : new java.awt.geom.AffineTransform (this.tx);
47 Clazz.defineMethod (c$, "isAntiAliased",
49 return !(this.aaHintValue === java.awt.RenderingHints.VALUE_TEXT_ANTIALIAS_OFF || this.aaHintValue === java.awt.RenderingHints.VALUE_TEXT_ANTIALIAS_DEFAULT);
51 Clazz.defineMethod (c$, "usesFractionalMetrics",
53 return !(this.fmHintValue === java.awt.RenderingHints.VALUE_FRACTIONALMETRICS_OFF || this.fmHintValue === java.awt.RenderingHints.VALUE_FRACTIONALMETRICS_DEFAULT);
55 Clazz.defineMethod (c$, "getAntiAliasingHint",
57 if (this.defaulting) {
58 if (this.isAntiAliased ()) {
59 return java.awt.RenderingHints.VALUE_TEXT_ANTIALIAS_ON;
61 return java.awt.RenderingHints.VALUE_TEXT_ANTIALIAS_OFF;
62 }}return this.aaHintValue;
64 Clazz.defineMethod (c$, "getFractionalMetricsHint",
66 if (this.defaulting) {
67 if (this.usesFractionalMetrics ()) {
68 return java.awt.RenderingHints.VALUE_FRACTIONALMETRICS_ON;
70 return java.awt.RenderingHints.VALUE_FRACTIONALMETRICS_OFF;
71 }}return this.fmHintValue;
73 Clazz.defineMethod (c$, "equals",
76 return this.equals (obj);
78 if (Clazz.exceptionOf (e, ClassCastException)) {
85 Clazz.defineMethod (c$, "equals",
91 }if (!rhs.defaulting && !this.defaulting) {
92 if (rhs.aaHintValue === this.aaHintValue && rhs.fmHintValue === this.fmHintValue) {
93 return this.tx == null ? rhs.tx == null : this.tx.equals (rhs.tx);
96 return rhs.getAntiAliasingHint () === this.getAntiAliasingHint () && rhs.getFractionalMetricsHint () === this.getFractionalMetricsHint () && rhs.getTransform ().equals (this.getTransform ());
97 }}, "java.awt.font.FontRenderContext");
98 Clazz.defineMethod (c$, "hashCode",
100 var hash = this.tx == null ? 0 : this.tx.hashCode ();
101 if (this.defaulting) {
102 hash += this.getAntiAliasingHint ().hashCode ();
103 hash += this.getFractionalMetricsHint ().hashCode ();
105 hash += this.aaHintValue.hashCode ();
106 hash += this.fmHintValue.hashCode ();