Merge branch 'master' of https://source.jalview.org/git/jalviewjs.git
[jalviewjs.git] / site / j2s / jssun / swing / DefaultLayoutStyle.js
index f0b1a77..89abe83 100644 (file)
-Clazz.declarePackage ("jssun.swing");\r
-Clazz.load (["javax.swing.LayoutStyle"], "jssun.swing.DefaultLayoutStyle", ["java.lang.IllegalArgumentException", "$.NullPointerException", "javax.swing.Icon", "$.JCheckBox", "$.JLabel", "$.JRadioButton", "$.UIManager", "javax.swing.plaf.UIResource"], function () {\r
-c$ = Clazz.declareType (jssun.swing, "DefaultLayoutStyle", javax.swing.LayoutStyle);\r
-c$.getInstance = Clazz.overrideMethod (c$, "getInstance", \r
-function () {\r
-return jssun.swing.DefaultLayoutStyle.INSTANCE;\r
-});\r
-Clazz.overrideMethod (c$, "getPreferredGap", \r
-function (component1, component2, type, position, parent) {\r
-if (component1 == null || component2 == null || type == null) {\r
-throw  new NullPointerException ();\r
-}this.checkPosition (position);\r
-if (type === javax.swing.LayoutStyle.ComponentPlacement.INDENT && (position == 3 || position == 7)) {\r
-var indent = this.getIndent (component1, position);\r
-if (indent > 0) {\r
-return indent;\r
-}}return (type === javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) ? 12 : 6;\r
-}, "javax.swing.JComponent,javax.swing.JComponent,javax.swing.LayoutStyle.ComponentPlacement,~N,java.awt.Container");\r
-Clazz.overrideMethod (c$, "getContainerGap", \r
-function (component, position, parent) {\r
-if (component == null) {\r
-throw  new NullPointerException ();\r
-}this.checkPosition (position);\r
-return 6;\r
-}, "javax.swing.JComponent,~N,java.awt.Container");\r
-Clazz.defineMethod (c$, "isLabelAndNonlabel", \r
-function (c1, c2, position) {\r
-if (position == 3 || position == 7) {\r
-var c1Label = (Clazz.instanceOf (c1, javax.swing.JLabel));\r
-var c2Label = (Clazz.instanceOf (c2, javax.swing.JLabel));\r
-return ((c1Label || c2Label) && (c1Label != c2Label));\r
-}return false;\r
-}, "javax.swing.JComponent,javax.swing.JComponent,~N");\r
-Clazz.defineMethod (c$, "getButtonGap", \r
-function (source, target, position, offset) {\r
-offset -= this.getButtonGap (source, position);\r
-if (offset > 0) {\r
-offset -= this.getButtonGap (target, this.flipDirection (position));\r
-}if (offset < 0) {\r
-return 0;\r
-}return offset;\r
-}, "javax.swing.JComponent,javax.swing.JComponent,~N,~N");\r
-Clazz.defineMethod (c$, "getButtonGap", \r
-function (source, position, offset) {\r
-offset -= this.getButtonGap (source, position);\r
-return Math.max (offset, 0);\r
-}, "javax.swing.JComponent,~N,~N");\r
-Clazz.defineMethod (c$, "getButtonGap", \r
-function (c, position) {\r
-var classID = c.getUIClassID ();\r
-if ((classID === "CheckBoxUI" || classID === "RadioButtonUI") && !(c).isBorderPainted ()) {\r
-var border = c.getBorder ();\r
-if (Clazz.instanceOf (border, javax.swing.plaf.UIResource)) {\r
-return this.getInset (c, position);\r
-}}return 0;\r
-}, "javax.swing.JComponent,~N");\r
-Clazz.defineMethod (c$, "checkPosition", \r
- function (position) {\r
-if (position != 1 && position != 5 && position != 7 && position != 3) {\r
-throw  new IllegalArgumentException ();\r
-}}, "~N");\r
-Clazz.defineMethod (c$, "flipDirection", \r
-function (position) {\r
-switch (position) {\r
-case 1:\r
-return 5;\r
-case 5:\r
-return 1;\r
-case 3:\r
-return 7;\r
-case 7:\r
-return 3;\r
-}\r
-return 0;\r
-}, "~N");\r
-Clazz.defineMethod (c$, "getIndent", \r
-function (c, position) {\r
-var classID = c.getUIClassID ();\r
-if (classID === "CheckBoxUI" || classID === "RadioButtonUI") {\r
-var button = c;\r
-var insets = c.getInsets ();\r
-var icon = this.getIcon (button);\r
-var gap = button.getIconTextGap ();\r
-if (this.isLeftAligned (button, position)) {\r
-return insets.left + icon.getIconWidth () + gap;\r
-} else if (this.isRightAligned (button, position)) {\r
-return insets.right + icon.getIconWidth () + gap;\r
-}}return 0;\r
-}, "javax.swing.JComponent,~N");\r
-Clazz.defineMethod (c$, "getIcon", \r
- function (button) {\r
-var icon = button.getIcon ();\r
-if (icon != null) {\r
-return icon;\r
-}var key = null;\r
-if (Clazz.instanceOf (button, javax.swing.JCheckBox)) {\r
-key = "CheckBox.icon";\r
-} else if (Clazz.instanceOf (button, javax.swing.JRadioButton)) {\r
-key = "RadioButton.icon";\r
-}if (key != null) {\r
-var oIcon = javax.swing.UIManager.get (key);\r
-if (Clazz.instanceOf (oIcon, javax.swing.Icon)) {\r
-return oIcon;\r
-}}return null;\r
-}, "javax.swing.AbstractButton");\r
-Clazz.defineMethod (c$, "isLeftAligned", \r
- function (button, position) {\r
-if (position == 7) {\r
-var ltr = button.getComponentOrientation ().isLeftToRight ();\r
-var hAlign = button.getHorizontalAlignment ();\r
-return ((ltr && (hAlign == 2 || hAlign == 10)) || (!ltr && (hAlign == 11)));\r
-}return false;\r
-}, "javax.swing.AbstractButton,~N");\r
-Clazz.defineMethod (c$, "isRightAligned", \r
- function (button, position) {\r
-if (position == 3) {\r
-var ltr = button.getComponentOrientation ().isLeftToRight ();\r
-var hAlign = button.getHorizontalAlignment ();\r
-return ((ltr && (hAlign == 4 || hAlign == 11)) || (!ltr && (hAlign == 10)));\r
-}return false;\r
-}, "javax.swing.AbstractButton,~N");\r
-Clazz.defineMethod (c$, "getInset", \r
- function (c, position) {\r
-return this.getInset (c.getInsets (), position);\r
-}, "javax.swing.JComponent,~N");\r
-Clazz.defineMethod (c$, "getInset", \r
- function (insets, position) {\r
-if (insets == null) {\r
-return 0;\r
-}switch (position) {\r
-case 1:\r
-return insets.top;\r
-case 5:\r
-return insets.bottom;\r
-case 3:\r
-return insets.right;\r
-case 7:\r
-return insets.left;\r
-}\r
-return 0;\r
-}, "java.awt.Insets,~N");\r
-c$.INSTANCE = c$.prototype.INSTANCE =  new jssun.swing.DefaultLayoutStyle ();\r
-});\r
+Clazz.declarePackage ("jssun.swing");
+Clazz.load (["javax.swing.LayoutStyle"], "jssun.swing.DefaultLayoutStyle", ["java.lang.IllegalArgumentException", "$.NullPointerException", "javax.swing.Icon", "$.JCheckBox", "$.JLabel", "$.JRadioButton", "$.UIManager", "javax.swing.plaf.UIResource"], function () {
+c$ = Clazz.declareType (jssun.swing, "DefaultLayoutStyle", javax.swing.LayoutStyle);
+c$.getInstance = Clazz.overrideMethod (c$, "getInstance", 
+function () {
+return jssun.swing.DefaultLayoutStyle.INSTANCE;
+});
+Clazz.overrideMethod (c$, "getPreferredGap", 
+function (component1, component2, type, position, parent) {
+if (component1 == null || component2 == null || type == null) {
+throw  new NullPointerException ();
+}this.checkPosition (position);
+if (type === javax.swing.LayoutStyle.ComponentPlacement.INDENT && (position == 3 || position == 7)) {
+var indent = this.getIndent (component1, position);
+if (indent > 0) {
+return indent;
+}}return (type === javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) ? 12 : 6;
+}, "javax.swing.JComponent,javax.swing.JComponent,javax.swing.LayoutStyle.ComponentPlacement,~N,java.awt.Container");
+Clazz.overrideMethod (c$, "getContainerGap", 
+function (component, position, parent) {
+if (component == null) {
+throw  new NullPointerException ();
+}this.checkPosition (position);
+return 6;
+}, "javax.swing.JComponent,~N,java.awt.Container");
+Clazz.defineMethod (c$, "isLabelAndNonlabel", 
+function (c1, c2, position) {
+if (position == 3 || position == 7) {
+var c1Label = (Clazz.instanceOf (c1, javax.swing.JLabel));
+var c2Label = (Clazz.instanceOf (c2, javax.swing.JLabel));
+return ((c1Label || c2Label) && (c1Label != c2Label));
+}return false;
+}, "javax.swing.JComponent,javax.swing.JComponent,~N");
+Clazz.defineMethod (c$, "getButtonGap", 
+function (source, target, position, offset) {
+offset -= this.getButtonGap (source, position);
+if (offset > 0) {
+offset -= this.getButtonGap (target, this.flipDirection (position));
+}if (offset < 0) {
+return 0;
+}return offset;
+}, "javax.swing.JComponent,javax.swing.JComponent,~N,~N");
+Clazz.defineMethod (c$, "getButtonGap", 
+function (source, position, offset) {
+offset -= this.getButtonGap (source, position);
+return Math.max (offset, 0);
+}, "javax.swing.JComponent,~N,~N");
+Clazz.defineMethod (c$, "getButtonGap", 
+function (c, position) {
+var classID = c.getUIClassID ();
+if ((classID === "CheckBoxUI" || classID === "RadioButtonUI") && !(c).isBorderPainted ()) {
+var border = c.getBorder ();
+if (Clazz.instanceOf (border, javax.swing.plaf.UIResource)) {
+return this.getInset (c, position);
+}}return 0;
+}, "javax.swing.JComponent,~N");
+Clazz.defineMethod (c$, "checkPosition", 
+ function (position) {
+if (position != 1 && position != 5 && position != 7 && position != 3) {
+throw  new IllegalArgumentException ();
+}}, "~N");
+Clazz.defineMethod (c$, "flipDirection", 
+function (position) {
+switch (position) {
+case 1:
+return 5;
+case 5:
+return 1;
+case 3:
+return 7;
+case 7:
+return 3;
+}
+return 0;
+}, "~N");
+Clazz.defineMethod (c$, "getIndent", 
+function (c, position) {
+var classID = c.getUIClassID ();
+if (classID === "CheckBoxUI" || classID === "RadioButtonUI") {
+var button = c;
+var insets = c.getInsets ();
+var icon = this.getIcon (button);
+var gap = button.getIconTextGap ();
+if (this.isLeftAligned (button, position)) {
+return insets.left + icon.getIconWidth () + gap;
+} else if (this.isRightAligned (button, position)) {
+return insets.right + icon.getIconWidth () + gap;
+}}return 0;
+}, "javax.swing.JComponent,~N");
+Clazz.defineMethod (c$, "getIcon", 
+ function (button) {
+var icon = button.getIcon ();
+if (icon != null) {
+return icon;
+}var key = null;
+if (Clazz.instanceOf (button, javax.swing.JCheckBox)) {
+key = "CheckBox.icon";
+} else if (Clazz.instanceOf (button, javax.swing.JRadioButton)) {
+key = "RadioButton.icon";
+}if (key != null) {
+var oIcon = javax.swing.UIManager.get (key);
+if (Clazz.instanceOf (oIcon, javax.swing.Icon)) {
+return oIcon;
+}}return null;
+}, "javax.swing.AbstractButton");
+Clazz.defineMethod (c$, "isLeftAligned", 
+ function (button, position) {
+if (position == 7) {
+var ltr = button.getComponentOrientation ().isLeftToRight ();
+var hAlign = button.getHorizontalAlignment ();
+return ((ltr && (hAlign == 2 || hAlign == 10)) || (!ltr && (hAlign == 11)));
+}return false;
+}, "javax.swing.AbstractButton,~N");
+Clazz.defineMethod (c$, "isRightAligned", 
+ function (button, position) {
+if (position == 3) {
+var ltr = button.getComponentOrientation ().isLeftToRight ();
+var hAlign = button.getHorizontalAlignment ();
+return ((ltr && (hAlign == 4 || hAlign == 11)) || (!ltr && (hAlign == 10)));
+}return false;
+}, "javax.swing.AbstractButton,~N");
+Clazz.defineMethod (c$, "getInset", 
+ function (c, position) {
+return this.getInset (c.getInsets (), position);
+}, "javax.swing.JComponent,~N");
+Clazz.defineMethod (c$, "getInset", 
+ function (insets, position) {
+if (insets == null) {
+return 0;
+}switch (position) {
+case 1:
+return insets.top;
+case 5:
+return insets.bottom;
+case 3:
+return insets.right;
+case 7:
+return insets.left;
+}
+return 0;
+}, "java.awt.Insets,~N");
+c$.INSTANCE = c$.prototype.INSTANCE =  new jssun.swing.DefaultLayoutStyle ();
+});