1 Clazz.declarePackage ("java.awt.font");
\r
2 Clazz.load (null, "java.awt.font.GraphicAttribute", ["java.lang.IllegalArgumentException", "java.awt.geom.Rectangle2D"], function () {
\r
3 c$ = Clazz.decorateAsClass (function () {
\r
5 Clazz.instantialize (this, arguments);
\r
6 }, java.awt.font, "GraphicAttribute");
\r
7 Clazz.makeConstructor (c$,
\r
8 function (alignment) {
\r
9 if (alignment < -2 || alignment > 2) {
\r
10 throw new IllegalArgumentException ("bad alignment");
\r
11 }this.fAlignment = alignment;
\r
13 Clazz.defineMethod (c$, "getBounds",
\r
15 var ascent = this.getAscent ();
\r
16 return new java.awt.geom.Rectangle2D.Float (0, -ascent, this.getAdvance (), ascent + this.getDescent ());
\r
18 Clazz.defineMethod (c$, "getAlignment",
\r
20 return this.fAlignment;
\r
22 Clazz.defineStatics (c$,
\r
23 "TOP_ALIGNMENT", -1,
\r
24 "BOTTOM_ALIGNMENT", -2,
\r
25 "ROMAN_BASELINE", 0,
\r
26 "CENTER_BASELINE", 1,
\r
27 "HANGING_BASELINE", 2);
\r