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