1 Clazz.declarePackage ("javax.swing.border");
2 Clazz.load (["javax.swing.border.AbstractBorder"], "javax.swing.border.EtchedBorder", ["java.awt.Insets"], function () {
3 c$ = Clazz.decorateAsClass (function () {
7 Clazz.instantialize (this, arguments);
8 }, javax.swing.border, "EtchedBorder", javax.swing.border.AbstractBorder);
9 Clazz.makeConstructor (c$,
13 Clazz.makeConstructor (c$,
15 this.construct (etchType, null, null);
17 Clazz.makeConstructor (c$,
18 function (highlight, shadow) {
19 this.construct (1, highlight, shadow);
20 }, "java.awt.Color,java.awt.Color");
21 Clazz.makeConstructor (c$,
22 function (etchType, highlight, shadow) {
23 Clazz.superConstructor (this, javax.swing.border.EtchedBorder, []);
24 this.etchType = etchType;
25 this.highlight = highlight;
27 }, "~N,java.awt.Color,java.awt.Color");
28 Clazz.overrideMethod (c$, "paintBorder",
29 function (c, g, x, y, width, height) {
33 g.setColor (this.etchType == 1 ? this.getShadowColor (c) : this.getHighlightColor (c));
34 g.drawRect (0, 0, w - 2, h - 2);
35 g.setColor (this.etchType == 1 ? this.getHighlightColor (c) : this.getShadowColor (c));
36 g.drawLine (1, h - 3, 1, 1);
37 g.drawLine (1, 1, w - 3, 1);
38 g.drawLine (0, h - 1, w - 1, h - 1);
39 g.drawLine (w - 1, h - 1, w - 1, 0);
41 }, "java.awt.Component,java.awt.Graphics,~N,~N,~N,~N");
42 Clazz.defineMethod (c$, "getBorderInsets",
44 return new java.awt.Insets (2, 2, 2, 2);
45 }, "java.awt.Component");
46 Clazz.defineMethod (c$, "getBorderInsets",
47 function (c, insets) {
48 insets.left = insets.top = insets.right = insets.bottom = 2;
50 }, "java.awt.Component,java.awt.Insets");
51 Clazz.overrideMethod (c$, "isBorderOpaque",
55 Clazz.defineMethod (c$, "getEtchType",
59 Clazz.defineMethod (c$, "getHighlightColor",
61 return this.highlight != null ? this.highlight : c.getBackground ().brighter ();
62 }, "java.awt.Component");
63 Clazz.defineMethod (c$, "getHighlightColor",
65 return this.highlight;
67 Clazz.defineMethod (c$, "getShadowColor",
69 return this.shadow != null ? this.shadow : c.getBackground ().darker ();
70 }, "java.awt.Component");
71 Clazz.defineMethod (c$, "getShadowColor",
75 Clazz.defineStatics (c$,