dc73b65ac8dd0c9858a8461d2384e4879f924af2
[jalviewjs.git] / site / j2s / javax / swing / border / CompoundBorder.js
1 Clazz.declarePackage ("javax.swing.border");\r
2 Clazz.load (["javax.swing.border.AbstractBorder"], "javax.swing.border.CompoundBorder", ["java.awt.Insets"], function () {\r
3 c$ = Clazz.decorateAsClass (function () {\r
4 this.outsideBorder = null;\r
5 this.insideBorder = null;\r
6 Clazz.instantialize (this, arguments);\r
7 }, javax.swing.border, "CompoundBorder", javax.swing.border.AbstractBorder);\r
8 Clazz.makeConstructor (c$, \r
9 function () {\r
10 Clazz.superConstructor (this, javax.swing.border.CompoundBorder, []);\r
11 this.outsideBorder = null;\r
12 this.insideBorder = null;\r
13 });\r
14 Clazz.makeConstructor (c$, \r
15 function (outsideBorder, insideBorder) {\r
16 Clazz.superConstructor (this, javax.swing.border.CompoundBorder, []);\r
17 this.outsideBorder = outsideBorder;\r
18 this.insideBorder = insideBorder;\r
19 }, "javax.swing.border.Border,javax.swing.border.Border");\r
20 Clazz.overrideMethod (c$, "isBorderOpaque", \r
21 function () {\r
22 return (this.outsideBorder == null || this.outsideBorder.isBorderOpaque ()) && (this.insideBorder == null || this.insideBorder.isBorderOpaque ());\r
23 });\r
24 Clazz.overrideMethod (c$, "paintBorder", \r
25 function (c, g, x, y, width, height) {\r
26 var nextInsets;\r
27 var px;\r
28 var py;\r
29 var pw;\r
30 var ph;\r
31 px = x;\r
32 py = y;\r
33 pw = width;\r
34 ph = height;\r
35 if (this.outsideBorder != null) {\r
36 this.outsideBorder.paintBorder (c, g, px, py, pw, ph);\r
37 nextInsets = this.outsideBorder.getBorderInsets (c);\r
38 px += nextInsets.left;\r
39 py += nextInsets.top;\r
40 pw = pw - nextInsets.right - nextInsets.left;\r
41 ph = ph - nextInsets.bottom - nextInsets.top;\r
42 }if (this.insideBorder != null) this.insideBorder.paintBorder (c, g, px, py, pw, ph);\r
43 }, "java.awt.Component,java.awt.Graphics,~N,~N,~N,~N");\r
44 Clazz.defineMethod (c$, "getBorderInsets", \r
45 function (c, insets) {\r
46 var nextInsets;\r
47 insets.top = insets.left = insets.right = insets.bottom = 0;\r
48 if (this.outsideBorder != null) {\r
49 nextInsets = this.outsideBorder.getBorderInsets (c);\r
50 insets.top += nextInsets.top;\r
51 insets.left += nextInsets.left;\r
52 insets.right += nextInsets.right;\r
53 insets.bottom += nextInsets.bottom;\r
54 }if (this.insideBorder != null) {\r
55 nextInsets = this.insideBorder.getBorderInsets (c);\r
56 insets.top += nextInsets.top;\r
57 insets.left += nextInsets.left;\r
58 insets.right += nextInsets.right;\r
59 insets.bottom += nextInsets.bottom;\r
60 }return insets;\r
61 }, "java.awt.Component,java.awt.Insets");\r
62 Clazz.defineMethod (c$, "getBorderInsets", \r
63 function (c) {\r
64 return this.getBorderInsets (c,  new java.awt.Insets (0, 0, 0, 0));\r
65 }, "java.awt.Component");\r
66 Clazz.defineMethod (c$, "getOutsideBorder", \r
67 function () {\r
68 return this.outsideBorder;\r
69 });\r
70 Clazz.defineMethod (c$, "getInsideBorder", \r
71 function () {\r
72 return this.insideBorder;\r
73 });\r
74 });\r