1 Clazz.declarePackage ("javax.swing");
2 Clazz.load (["javax.swing.JLabel", "$.ListCellRenderer", "javax.swing.plaf.UIResource", "javax.swing.border.EmptyBorder"], "javax.swing.DefaultListCellRenderer", ["javax.swing.Icon", "jssun.swing.DefaultLookup"], function () {
3 c$ = Clazz.declareType (javax.swing, "DefaultListCellRenderer", javax.swing.JLabel, javax.swing.ListCellRenderer);
4 Clazz.makeConstructor (c$,
6 Clazz.superConstructor (this, javax.swing.DefaultListCellRenderer);
8 this.setBorder (this.getNoFocusBorder ());
9 this.setName ("List.cellRenderer");
11 Clazz.defineMethod (c$, "getNoFocusBorder",
13 var border = jssun.swing.DefaultLookup.getBorder (this, this.ui, "List.cellNoFocusBorder");
14 if (System.getSecurityManager () != null) {
15 if (border != null) return border;
16 return javax.swing.DefaultListCellRenderer.SAFE_NO_FOCUS_BORDER;
18 if (border != null && (javax.swing.DefaultListCellRenderer.noFocusBorder == null || javax.swing.DefaultListCellRenderer.noFocusBorder === javax.swing.DefaultListCellRenderer.DEFAULT_NO_FOCUS_BORDER)) {
20 }return javax.swing.DefaultListCellRenderer.noFocusBorder;
22 Clazz.overrideMethod (c$, "getListCellRendererComponent",
23 function (list, value, index, isSelected, cellHasFocus) {
24 this.setComponentOrientation (list.getComponentOrientation ());
28 this.setBackground (bg == null ? list.getSelectionBackground () : bg);
29 this.setForeground (fg == null ? list.getSelectionForeground () : fg);
31 this.setBackground (list.getBackground ());
32 this.setForeground (list.getForeground ());
33 }if (Clazz.instanceOf (value, javax.swing.Icon)) {
38 this.setText ((value == null) ? "" : value.toString ());
39 }this.setEnabled (list.isEnabled ());
40 this.setFont (list.getFont ());
44 border = jssun.swing.DefaultLookup.getBorder (this, this.ui, "List.focusSelectedCellHighlightBorder");
45 }if (border == null) {
46 border = jssun.swing.DefaultLookup.getBorder (this, this.ui, "List.focusCellHighlightBorder");
48 border = this.getNoFocusBorder ();
49 }this.setBorder (border);
51 }, "javax.swing.JList,~O,~N,~B,~B");
52 Clazz.defineMethod (c$, "isOpaque",
54 var back = this.getBackground ();
55 var p = this.getParent ();
58 }var colorMatch = (back != null) && (p != null) && back.equals (p.getBackground ()) && p.isOpaque ();
59 return !colorMatch && Clazz.superCall (this, javax.swing.DefaultListCellRenderer, "isOpaque", []);
61 Clazz.overrideMethod (c$, "validate",
64 Clazz.overrideMethod (c$, "invalidate",
67 Clazz.defineMethod (c$, "repaint",
70 Clazz.overrideMethod (c$, "revalidate",
73 Clazz.defineMethod (c$, "repaint",
74 function (tm, x, y, width, height) {
76 Clazz.defineMethod (c$, "repaint",
78 }, "java.awt.Rectangle");
79 Clazz.overrideMethod (c$, "firePropertyChangeObject",
80 function (propertyName, oldValue, newValue) {
82 Clazz.overrideMethod (c$, "firePropertyChangeByte",
83 function (propertyName, oldValue, newValue) {
85 Clazz.overrideMethod (c$, "firePropertyChangeChar",
86 function (propertyName, oldValue, newValue) {
88 Clazz.overrideMethod (c$, "firePropertyChangeShort",
89 function (propertyName, oldValue, newValue) {
91 Clazz.overrideMethod (c$, "firePropertyChangeInt",
92 function (propertyName, oldValue, newValue) {
94 Clazz.overrideMethod (c$, "firePropertyChangeLong",
95 function (propertyName, oldValue, newValue) {
97 Clazz.overrideMethod (c$, "firePropertyChangeFloat",
98 function (propertyName, oldValue, newValue) {
100 Clazz.overrideMethod (c$, "firePropertyChangeDouble",
101 function (propertyName, oldValue, newValue) {
103 Clazz.overrideMethod (c$, "firePropertyChangeBool",
104 function (propertyName, oldValue, newValue) {
107 c$ = Clazz.declareType (javax.swing.DefaultListCellRenderer, "UIResource", javax.swing.DefaultListCellRenderer, javax.swing.plaf.UIResource);
109 c$.SAFE_NO_FOCUS_BORDER = c$.prototype.SAFE_NO_FOCUS_BORDER = new javax.swing.border.EmptyBorder (1, 1, 1, 1);
110 c$.DEFAULT_NO_FOCUS_BORDER = c$.prototype.DEFAULT_NO_FOCUS_BORDER = new javax.swing.border.EmptyBorder (1, 1, 1, 1);
111 c$.noFocusBorder = c$.prototype.noFocusBorder = javax.swing.DefaultListCellRenderer.DEFAULT_NO_FOCUS_BORDER;