8043bf20ecf9f23280d98363a4f33a3a08bb99ce
[jalviewjs.git] / site / j2s / javax / swing / border / AbstractBorder.js
1 Clazz.declarePackage ("javax.swing.border");
2 Clazz.load (["javax.swing.border.Border"], "javax.swing.border.AbstractBorder", ["java.lang.IllegalArgumentException", "$.NullPointerException", "java.awt.Component", "$.Insets", "$.Rectangle"], function () {
3 c$ = Clazz.declareType (javax.swing.border, "AbstractBorder", null, javax.swing.border.Border);
4 Clazz.overrideMethod (c$, "paintBorder", 
5 function (c, g, x, y, width, height) {
6 }, "java.awt.Component,java.awt.Graphics,~N,~N,~N,~N");
7 Clazz.defineMethod (c$, "getBorderInsets", 
8 function (c) {
9 return  new java.awt.Insets (0, 0, 0, 0);
10 }, "java.awt.Component");
11 Clazz.defineMethod (c$, "getBorderInsets", 
12 function (c, insets) {
13 insets.left = insets.top = insets.right = insets.bottom = 0;
14 return insets;
15 }, "java.awt.Component,java.awt.Insets");
16 Clazz.overrideMethod (c$, "isBorderOpaque", 
17 function () {
18 return false;
19 });
20 Clazz.defineMethod (c$, "getInteriorRectangle", 
21 function (c, x, y, width, height) {
22 return javax.swing.border.AbstractBorder.getInteriorRectangle (c, this, x, y, width, height);
23 }, "java.awt.Component,~N,~N,~N,~N");
24 c$.getInteriorRectangle = Clazz.defineMethod (c$, "getInteriorRectangle", 
25 function (c, b, x, y, width, height) {
26 var insets;
27 if (b != null) insets = b.getBorderInsets (c);
28  else insets =  new java.awt.Insets (0, 0, 0, 0);
29 return  new java.awt.Rectangle (x + insets.left, y + insets.top, width - insets.right - insets.left, height - insets.top - insets.bottom);
30 }, "java.awt.Component,javax.swing.border.Border,~N,~N,~N,~N");
31 Clazz.defineMethod (c$, "getBaseline", 
32 function (c, width, height) {
33 if (width < 0 || height < 0) {
34 throw  new IllegalArgumentException ("Width and height must be >= 0");
35 }return -1;
36 }, "java.awt.Component,~N,~N");
37 Clazz.defineMethod (c$, "getBaselineResizeBehavior", 
38 function (c) {
39 if (c == null) {
40 throw  new NullPointerException ("Component must be non-null");
41 }return java.awt.Component.BaselineResizeBehavior.OTHER;
42 }, "java.awt.Component");
43 c$.isLeftToRight = Clazz.defineMethod (c$, "isLeftToRight", 
44 function (c) {
45 return c.getComponentOrientation ().isLeftToRight ();
46 }, "java.awt.Component");
47 });