Merge branch 'master' of https://source.jalview.org/git/jalviewjs.git
[jalviewjs.git] / site / j2s / java / awt / font / GraphicAttribute.js
1 Clazz.declarePackage ("java.awt.font");
2 Clazz.load (null, "java.awt.font.GraphicAttribute", ["java.lang.IllegalArgumentException", "java.awt.geom.Rectangle2D"], function () {
3 c$ = Clazz.decorateAsClass (function () {
4 this.fAlignment = 0;
5 Clazz.instantialize (this, arguments);
6 }, java.awt.font, "GraphicAttribute");
7 Clazz.makeConstructor (c$, 
8 function (alignment) {
9 if (alignment < -2 || alignment > 2) {
10 throw  new IllegalArgumentException ("bad alignment");
11 }this.fAlignment = alignment;
12 }, "~N");
13 Clazz.defineMethod (c$, "getBounds", 
14 function () {
15 var ascent = this.getAscent ();
16 return  new java.awt.geom.Rectangle2D.Float (0, -ascent, this.getAdvance (), ascent + this.getDescent ());
17 });
18 Clazz.defineMethod (c$, "getAlignment", 
19 function () {
20 return this.fAlignment;
21 });
22 Clazz.defineStatics (c$,
23 "TOP_ALIGNMENT", -1,
24 "BOTTOM_ALIGNMENT", -2,
25 "ROMAN_BASELINE", 0,
26 "CENTER_BASELINE", 1,
27 "HANGING_BASELINE", 2);
28 });