1 Clazz.declarePackage ("javax.swing.table");
\r
2 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
3 c$ = Clazz.decorateAsClass (function () {
\r
4 this.unselectedForeground = null;
\r
5 this.unselectedBackground = null;
\r
6 Clazz.instantialize (this, arguments);
\r
7 }, javax.swing.table, "DefaultTableCellRenderer", javax.swing.JLabel, javax.swing.table.TableCellRenderer);
\r
8 Clazz.makeConstructor (c$,
\r
10 Clazz.superConstructor (this, javax.swing.table.DefaultTableCellRenderer);
\r
11 this.setOpaque (true);
\r
12 this.setBorder (this.getNoFocusBorder ());
\r
13 this.setName ("Table.cellRenderer");
\r
15 Clazz.defineMethod (c$, "getNoFocusBorder",
\r
17 var border = jssun.swing.DefaultLookup.getBorder (this, this.ui, "Table.cellNoFocusBorder");
\r
18 if (System.getSecurityManager () != null) {
\r
19 if (border != null) return border;
\r
20 return javax.swing.table.DefaultTableCellRenderer.SAFE_NO_FOCUS_BORDER;
\r
21 } else if (border != null) {
\r
22 if (javax.swing.table.DefaultTableCellRenderer.noFocusBorder == null || javax.swing.table.DefaultTableCellRenderer.noFocusBorder === javax.swing.table.DefaultTableCellRenderer.DEFAULT_NO_FOCUS_BORDER) {
\r
24 }}return javax.swing.table.DefaultTableCellRenderer.noFocusBorder;
\r
26 Clazz.defineMethod (c$, "setForeground",
\r
28 Clazz.superCall (this, javax.swing.table.DefaultTableCellRenderer, "setForeground", [c]);
\r
29 this.unselectedForeground = c;
\r
30 }, "java.awt.Color");
\r
31 Clazz.defineMethod (c$, "setBackground",
\r
33 Clazz.superCall (this, javax.swing.table.DefaultTableCellRenderer, "setBackground", [c]);
\r
34 this.unselectedBackground = c;
\r
35 }, "java.awt.Color");
\r
36 Clazz.defineMethod (c$, "updateUI",
\r
38 Clazz.superCall (this, javax.swing.table.DefaultTableCellRenderer, "updateUI", []);
\r
39 this.setForeground (null);
\r
40 this.setBackground (null);
\r
42 Clazz.overrideMethod (c$, "getTableCellRendererComponent",
\r
43 function (table, value, isSelected, hasFocus, row, column) {
\r
47 Clazz.superCall (this, javax.swing.table.DefaultTableCellRenderer, "setForeground", [fg == null ? table.getSelectionForeground () : fg]);
\r
48 Clazz.superCall (this, javax.swing.table.DefaultTableCellRenderer, "setBackground", [bg == null ? table.getSelectionBackground () : bg]);
\r
50 var background = this.unselectedBackground != null ? this.unselectedBackground : table.getBackground ();
\r
51 if (background == null || Clazz.instanceOf (background, javax.swing.plaf.UIResource)) {
\r
52 var alternateColor = jssun.swing.DefaultLookup.getColor (this, this.ui, "Table.alternateRowColor");
\r
53 if (alternateColor != null && row % 2 != 0) {
\r
54 background = alternateColor;
\r
55 }}Clazz.superCall (this, javax.swing.table.DefaultTableCellRenderer, "setForeground", [this.unselectedForeground != null ? this.unselectedForeground : table.getForeground ()]);
\r
56 Clazz.superCall (this, javax.swing.table.DefaultTableCellRenderer, "setBackground", [background]);
\r
57 }this.setFont (table.getFont ());
\r
61 border = jssun.swing.DefaultLookup.getBorder (this, this.ui, "Table.focusSelectedCellHighlightBorder");
\r
62 }if (border == null) {
\r
63 border = jssun.swing.DefaultLookup.getBorder (this, this.ui, "Table.focusCellHighlightBorder");
\r
64 }this.setBorder (border);
\r
65 if (!isSelected && table.isCellEditable (row, column)) {
\r
67 col = jssun.swing.DefaultLookup.getColor (this, this.ui, "Table.focusCellForeground");
\r
69 Clazz.superCall (this, javax.swing.table.DefaultTableCellRenderer, "setForeground", [col]);
\r
70 }col = jssun.swing.DefaultLookup.getColor (this, this.ui, "Table.focusCellBackground");
\r
72 Clazz.superCall (this, javax.swing.table.DefaultTableCellRenderer, "setBackground", [col]);
\r
74 this.setBorder (this.getNoFocusBorder ());
\r
75 }this.setValue (value);
\r
77 }, "javax.swing.JTable,~O,~B,~B,~N,~N");
\r
78 Clazz.defineMethod (c$, "isOpaque",
\r
80 var back = this.getBackground ();
\r
81 var p = this.getParent ();
\r
84 }var colorMatch = (back != null) && (p != null) && back.equals (p.getBackground ()) && p.isOpaque ();
\r
85 return !colorMatch && Clazz.superCall (this, javax.swing.table.DefaultTableCellRenderer, "isOpaque", []);
\r
87 Clazz.overrideMethod (c$, "invalidate",
\r
90 Clazz.overrideMethod (c$, "validate",
\r
93 Clazz.overrideMethod (c$, "revalidate",
\r
96 Clazz.defineMethod (c$, "repaint",
\r
97 function (tm, x, y, width, height) {
\r
98 }, "~N,~N,~N,~N,~N");
\r
99 Clazz.defineMethod (c$, "repaint",
\r
101 }, "java.awt.Rectangle");
\r
102 Clazz.defineMethod (c$, "repaint",
\r
105 Clazz.overrideMethod (c$, "firePropertyChangeObject",
\r
106 function (propertyName, oldValue, newValue) {
\r
108 Clazz.overrideMethod (c$, "firePropertyChangeBool",
\r
109 function (propertyName, oldValue, newValue) {
\r
111 Clazz.defineMethod (c$, "setValue",
\r
113 this.setText ((value == null) ? "" : value.toString ());
\r
115 Clazz.pu$h(self.c$);
\r
116 c$ = Clazz.declareType (javax.swing.table.DefaultTableCellRenderer, "UIResource", javax.swing.table.DefaultTableCellRenderer, javax.swing.plaf.UIResource);
\r
118 c$.SAFE_NO_FOCUS_BORDER = c$.prototype.SAFE_NO_FOCUS_BORDER = new javax.swing.border.EmptyBorder (1, 1, 1, 1);
\r
119 c$.DEFAULT_NO_FOCUS_BORDER = c$.prototype.DEFAULT_NO_FOCUS_BORDER = new javax.swing.border.EmptyBorder (1, 1, 1, 1);
\r
120 c$.noFocusBorder = c$.prototype.noFocusBorder = javax.swing.table.DefaultTableCellRenderer.DEFAULT_NO_FOCUS_BORDER;
\r