Merge branch 'master' of https://source.jalview.org/git/jalviewjs.git
[jalviewjs.git] / site / j2s / javax / swing / table / DefaultTableCellRenderer.js
index afc0f6a..e75ef65 100644 (file)
-Clazz.declarePackage ("javax.swing.table");\r
-Clazz.load (["javax.swing.JLabel", "javax.swing.plaf.UIResource", "javax.swing.table.TableCellRenderer", "javax.swing.border.EmptyBorder"], "javax.swing.table.DefaultTableCellRenderer", ["jssun.swing.DefaultLookup"], function () {\r
-c$ = Clazz.decorateAsClass (function () {\r
-this.unselectedForeground = null;\r
-this.unselectedBackground = null;\r
-Clazz.instantialize (this, arguments);\r
-}, javax.swing.table, "DefaultTableCellRenderer", javax.swing.JLabel, javax.swing.table.TableCellRenderer);\r
-Clazz.makeConstructor (c$, \r
-function () {\r
-Clazz.superConstructor (this, javax.swing.table.DefaultTableCellRenderer);\r
-this.setOpaque (true);\r
-this.setBorder (this.getNoFocusBorder ());\r
-this.setName ("Table.cellRenderer");\r
-});\r
-Clazz.defineMethod (c$, "getNoFocusBorder", \r
- function () {\r
-var border = jssun.swing.DefaultLookup.getBorder (this, this.ui, "Table.cellNoFocusBorder");\r
-if (System.getSecurityManager () != null) {\r
-if (border != null) return border;\r
-return javax.swing.table.DefaultTableCellRenderer.SAFE_NO_FOCUS_BORDER;\r
-} else if (border != null) {\r
-if (javax.swing.table.DefaultTableCellRenderer.noFocusBorder == null || javax.swing.table.DefaultTableCellRenderer.noFocusBorder === javax.swing.table.DefaultTableCellRenderer.DEFAULT_NO_FOCUS_BORDER) {\r
-return border;\r
-}}return javax.swing.table.DefaultTableCellRenderer.noFocusBorder;\r
-});\r
-Clazz.defineMethod (c$, "setForeground", \r
-function (c) {\r
-Clazz.superCall (this, javax.swing.table.DefaultTableCellRenderer, "setForeground", [c]);\r
-this.unselectedForeground = c;\r
-}, "java.awt.Color");\r
-Clazz.defineMethod (c$, "setBackground", \r
-function (c) {\r
-Clazz.superCall (this, javax.swing.table.DefaultTableCellRenderer, "setBackground", [c]);\r
-this.unselectedBackground = c;\r
-}, "java.awt.Color");\r
-Clazz.defineMethod (c$, "updateUI", \r
-function () {\r
-Clazz.superCall (this, javax.swing.table.DefaultTableCellRenderer, "updateUI", []);\r
-this.setForeground (null);\r
-this.setBackground (null);\r
-});\r
-Clazz.overrideMethod (c$, "getTableCellRendererComponent", \r
-function (table, value, isSelected, hasFocus, row, column) {\r
-var fg = null;\r
-var bg = null;\r
-if (isSelected) {\r
-Clazz.superCall (this, javax.swing.table.DefaultTableCellRenderer, "setForeground", [fg == null ? table.getSelectionForeground () : fg]);\r
-Clazz.superCall (this, javax.swing.table.DefaultTableCellRenderer, "setBackground", [bg == null ? table.getSelectionBackground () : bg]);\r
-} else {\r
-var background = this.unselectedBackground != null ? this.unselectedBackground : table.getBackground ();\r
-if (background == null || Clazz.instanceOf (background, javax.swing.plaf.UIResource)) {\r
-var alternateColor = jssun.swing.DefaultLookup.getColor (this, this.ui, "Table.alternateRowColor");\r
-if (alternateColor != null && row % 2 != 0) {\r
-background = alternateColor;\r
-}}Clazz.superCall (this, javax.swing.table.DefaultTableCellRenderer, "setForeground", [this.unselectedForeground != null ? this.unselectedForeground : table.getForeground ()]);\r
-Clazz.superCall (this, javax.swing.table.DefaultTableCellRenderer, "setBackground", [background]);\r
-}this.setFont (table.getFont ());\r
-if (hasFocus) {\r
-var border = null;\r
-if (isSelected) {\r
-border = jssun.swing.DefaultLookup.getBorder (this, this.ui, "Table.focusSelectedCellHighlightBorder");\r
-}if (border == null) {\r
-border = jssun.swing.DefaultLookup.getBorder (this, this.ui, "Table.focusCellHighlightBorder");\r
-}this.setBorder (border);\r
-if (!isSelected && table.isCellEditable (row, column)) {\r
-var col;\r
-col = jssun.swing.DefaultLookup.getColor (this, this.ui, "Table.focusCellForeground");\r
-if (col != null) {\r
-Clazz.superCall (this, javax.swing.table.DefaultTableCellRenderer, "setForeground", [col]);\r
-}col = jssun.swing.DefaultLookup.getColor (this, this.ui, "Table.focusCellBackground");\r
-if (col != null) {\r
-Clazz.superCall (this, javax.swing.table.DefaultTableCellRenderer, "setBackground", [col]);\r
-}}} else {\r
-this.setBorder (this.getNoFocusBorder ());\r
-}this.setValue (value);\r
-return this;\r
-}, "javax.swing.JTable,~O,~B,~B,~N,~N");\r
-Clazz.defineMethod (c$, "isOpaque", \r
-function () {\r
-var back = this.getBackground ();\r
-var p = this.getParent ();\r
-if (p != null) {\r
-p = p.getParent ();\r
-}var colorMatch = (back != null) && (p != null) && back.equals (p.getBackground ()) && p.isOpaque ();\r
-return !colorMatch && Clazz.superCall (this, javax.swing.table.DefaultTableCellRenderer, "isOpaque", []);\r
-});\r
-Clazz.overrideMethod (c$, "invalidate", \r
-function () {\r
-});\r
-Clazz.overrideMethod (c$, "validate", \r
-function () {\r
-});\r
-Clazz.overrideMethod (c$, "revalidate", \r
-function () {\r
-});\r
-Clazz.defineMethod (c$, "repaint", \r
-function (tm, x, y, width, height) {\r
-}, "~N,~N,~N,~N,~N");\r
-Clazz.defineMethod (c$, "repaint", \r
-function (r) {\r
-}, "java.awt.Rectangle");\r
-Clazz.defineMethod (c$, "repaint", \r
-function () {\r
-});\r
-Clazz.overrideMethod (c$, "firePropertyChangeObject", \r
-function (propertyName, oldValue, newValue) {\r
-}, "~S,~O,~O");\r
-Clazz.overrideMethod (c$, "firePropertyChangeBool", \r
-function (propertyName, oldValue, newValue) {\r
-}, "~S,~B,~B");\r
-Clazz.defineMethod (c$, "setValue", \r
-function (value) {\r
-this.setText ((value == null) ? "" : value.toString ());\r
-}, "~O");\r
-Clazz.pu$h(self.c$);\r
-c$ = Clazz.declareType (javax.swing.table.DefaultTableCellRenderer, "UIResource", javax.swing.table.DefaultTableCellRenderer, javax.swing.plaf.UIResource);\r
-c$ = Clazz.p0p ();\r
-c$.SAFE_NO_FOCUS_BORDER = c$.prototype.SAFE_NO_FOCUS_BORDER =  new javax.swing.border.EmptyBorder (1, 1, 1, 1);\r
-c$.DEFAULT_NO_FOCUS_BORDER = c$.prototype.DEFAULT_NO_FOCUS_BORDER =  new javax.swing.border.EmptyBorder (1, 1, 1, 1);\r
-c$.noFocusBorder = c$.prototype.noFocusBorder = javax.swing.table.DefaultTableCellRenderer.DEFAULT_NO_FOCUS_BORDER;\r
-});\r
+Clazz.declarePackage ("javax.swing.table");
+Clazz.load (["javax.swing.JLabel", "javax.swing.plaf.UIResource", "javax.swing.table.TableCellRenderer", "javax.swing.border.EmptyBorder"], "javax.swing.table.DefaultTableCellRenderer", ["jssun.swing.DefaultLookup"], function () {
+c$ = Clazz.decorateAsClass (function () {
+this.unselectedForeground = null;
+this.unselectedBackground = null;
+Clazz.instantialize (this, arguments);
+}, javax.swing.table, "DefaultTableCellRenderer", javax.swing.JLabel, javax.swing.table.TableCellRenderer);
+Clazz.makeConstructor (c$, 
+function () {
+Clazz.superConstructor (this, javax.swing.table.DefaultTableCellRenderer);
+this.setOpaque (true);
+this.setBorder (this.getNoFocusBorder ());
+this.setName ("Table.cellRenderer");
+});
+Clazz.defineMethod (c$, "getNoFocusBorder", 
+ function () {
+var border = jssun.swing.DefaultLookup.getBorder (this, this.ui, "Table.cellNoFocusBorder");
+if (System.getSecurityManager () != null) {
+if (border != null) return border;
+return javax.swing.table.DefaultTableCellRenderer.SAFE_NO_FOCUS_BORDER;
+} else if (border != null) {
+if (javax.swing.table.DefaultTableCellRenderer.noFocusBorder == null || javax.swing.table.DefaultTableCellRenderer.noFocusBorder === javax.swing.table.DefaultTableCellRenderer.DEFAULT_NO_FOCUS_BORDER) {
+return border;
+}}return javax.swing.table.DefaultTableCellRenderer.noFocusBorder;
+});
+Clazz.defineMethod (c$, "setForeground", 
+function (c) {
+Clazz.superCall (this, javax.swing.table.DefaultTableCellRenderer, "setForeground", [c]);
+this.unselectedForeground = c;
+}, "java.awt.Color");
+Clazz.defineMethod (c$, "setBackground", 
+function (c) {
+Clazz.superCall (this, javax.swing.table.DefaultTableCellRenderer, "setBackground", [c]);
+this.unselectedBackground = c;
+}, "java.awt.Color");
+Clazz.defineMethod (c$, "updateUI", 
+function () {
+Clazz.superCall (this, javax.swing.table.DefaultTableCellRenderer, "updateUI", []);
+this.setForeground (null);
+this.setBackground (null);
+});
+Clazz.overrideMethod (c$, "getTableCellRendererComponent", 
+function (table, value, isSelected, hasFocus, row, column) {
+var fg = null;
+var bg = null;
+if (isSelected) {
+Clazz.superCall (this, javax.swing.table.DefaultTableCellRenderer, "setForeground", [fg == null ? table.getSelectionForeground () : fg]);
+Clazz.superCall (this, javax.swing.table.DefaultTableCellRenderer, "setBackground", [bg == null ? table.getSelectionBackground () : bg]);
+} else {
+var background = this.unselectedBackground != null ? this.unselectedBackground : table.getBackground ();
+if (background == null || Clazz.instanceOf (background, javax.swing.plaf.UIResource)) {
+var alternateColor = jssun.swing.DefaultLookup.getColor (this, this.ui, "Table.alternateRowColor");
+if (alternateColor != null && row % 2 != 0) {
+background = alternateColor;
+}}Clazz.superCall (this, javax.swing.table.DefaultTableCellRenderer, "setForeground", [this.unselectedForeground != null ? this.unselectedForeground : table.getForeground ()]);
+Clazz.superCall (this, javax.swing.table.DefaultTableCellRenderer, "setBackground", [background]);
+}this.setFont (table.getFont ());
+if (hasFocus) {
+var border = null;
+if (isSelected) {
+border = jssun.swing.DefaultLookup.getBorder (this, this.ui, "Table.focusSelectedCellHighlightBorder");
+}if (border == null) {
+border = jssun.swing.DefaultLookup.getBorder (this, this.ui, "Table.focusCellHighlightBorder");
+}this.setBorder (border);
+if (!isSelected && table.isCellEditable (row, column)) {
+var col;
+col = jssun.swing.DefaultLookup.getColor (this, this.ui, "Table.focusCellForeground");
+if (col != null) {
+Clazz.superCall (this, javax.swing.table.DefaultTableCellRenderer, "setForeground", [col]);
+}col = jssun.swing.DefaultLookup.getColor (this, this.ui, "Table.focusCellBackground");
+if (col != null) {
+Clazz.superCall (this, javax.swing.table.DefaultTableCellRenderer, "setBackground", [col]);
+}}} else {
+this.setBorder (this.getNoFocusBorder ());
+}this.setValue (value);
+return this;
+}, "javax.swing.JTable,~O,~B,~B,~N,~N");
+Clazz.defineMethod (c$, "isOpaque", 
+function () {
+var back = this.getBackground ();
+var p = this.getParent ();
+if (p != null) {
+p = p.getParent ();
+}var colorMatch = (back != null) && (p != null) && back.equals (p.getBackground ()) && p.isOpaque ();
+return !colorMatch && Clazz.superCall (this, javax.swing.table.DefaultTableCellRenderer, "isOpaque", []);
+});
+Clazz.overrideMethod (c$, "invalidate", 
+function () {
+});
+Clazz.overrideMethod (c$, "validate", 
+function () {
+});
+Clazz.overrideMethod (c$, "revalidate", 
+function () {
+});
+Clazz.defineMethod (c$, "repaint", 
+function (tm, x, y, width, height) {
+}, "~N,~N,~N,~N,~N");
+Clazz.defineMethod (c$, "repaint", 
+function (r) {
+}, "java.awt.Rectangle");
+Clazz.defineMethod (c$, "repaint", 
+function () {
+});
+Clazz.overrideMethod (c$, "firePropertyChangeObject", 
+function (propertyName, oldValue, newValue) {
+}, "~S,~O,~O");
+Clazz.overrideMethod (c$, "firePropertyChangeBool", 
+function (propertyName, oldValue, newValue) {
+}, "~S,~B,~B");
+Clazz.defineMethod (c$, "setValue", 
+function (value) {
+this.setText ((value == null) ? "" : value.toString ());
+}, "~O");
+Clazz.pu$h(self.c$);
+c$ = Clazz.declareType (javax.swing.table.DefaultTableCellRenderer, "UIResource", javax.swing.table.DefaultTableCellRenderer, javax.swing.plaf.UIResource);
+c$ = Clazz.p0p ();
+c$.SAFE_NO_FOCUS_BORDER = c$.prototype.SAFE_NO_FOCUS_BORDER =  new javax.swing.border.EmptyBorder (1, 1, 1, 1);
+c$.DEFAULT_NO_FOCUS_BORDER = c$.prototype.DEFAULT_NO_FOCUS_BORDER =  new javax.swing.border.EmptyBorder (1, 1, 1, 1);
+c$.noFocusBorder = c$.prototype.noFocusBorder = javax.swing.table.DefaultTableCellRenderer.DEFAULT_NO_FOCUS_BORDER;
+});