46 * <code>validate</code>,
47 * <code>revalidate</code>,
48 * <code>repaint</code>,
49 * <code>isOpaque</code>,
50 * and
51 * <code>firePropertyChange</code>
52 * solely to improve performance.
53 * If not overridden, these frequently called methods would execute code paths
54 * that are unnecessary for the default list cell renderer.
55 * If you write your own renderer,
56 * take care to weigh the benefits and
57 * drawbacks of overriding these methods.
58 *
59 * <p>
60 *
61 * <strong>Warning:</strong>
62 * Serialized objects of this class will not be compatible with
63 * future Swing releases. The current serialization support is
64 * appropriate for short term storage or RMI between applications running
65 * the same version of Swing. As of 1.4, support for long term storage
66 * of all JavaBeans™
67 * has been added to the <code>java.beans</code> package.
68 * Please see {@link java.beans.XMLEncoder}.
69 *
70 * @author Philip Milne
71 * @author Hans Muller
72 * @since 1.2
73 */
74 @SuppressWarnings("serial") // Same-version serialization only
75 public class DefaultListCellRenderer extends JLabel
76 implements ListCellRenderer<Object>, Serializable
77 {
78
79 /**
80 * An empty <code>Border</code>. This field might not be used. To change the
81 * <code>Border</code> used by this renderer override the
82 * <code>getListCellRendererComponent</code> method and set the border
83 * of the returned component directly.
84 */
85 private static final Border SAFE_NO_FOCUS_BORDER = new EmptyBorder(1, 1, 1, 1);
86 private static final Border DEFAULT_NO_FOCUS_BORDER = new EmptyBorder(1, 1, 1, 1);
326
327 /**
328 * Overridden for performance reasons.
329 * See the <a href="#override">Implementation Note</a>
330 * for more information.
331 */
332 @Override
333 public void firePropertyChange(String propertyName, boolean oldValue, boolean newValue) {}
334
335 /**
336 * A subclass of DefaultListCellRenderer that implements UIResource.
337 * DefaultListCellRenderer doesn't implement UIResource
338 * directly so that applications can safely override the
339 * cellRenderer property with DefaultListCellRenderer subclasses.
340 * <p>
341 * <strong>Warning:</strong>
342 * Serialized objects of this class will not be compatible with
343 * future Swing releases. The current serialization support is
344 * appropriate for short term storage or RMI between applications running
345 * the same version of Swing. As of 1.4, support for long term storage
346 * of all JavaBeans™
347 * has been added to the <code>java.beans</code> package.
348 * Please see {@link java.beans.XMLEncoder}.
349 */
350 @SuppressWarnings("serial") // Same-version serialization only
351 public static class UIResource extends DefaultListCellRenderer
352 implements javax.swing.plaf.UIResource
353 {
354 }
355 }
|
46 * <code>validate</code>,
47 * <code>revalidate</code>,
48 * <code>repaint</code>,
49 * <code>isOpaque</code>,
50 * and
51 * <code>firePropertyChange</code>
52 * solely to improve performance.
53 * If not overridden, these frequently called methods would execute code paths
54 * that are unnecessary for the default list cell renderer.
55 * If you write your own renderer,
56 * take care to weigh the benefits and
57 * drawbacks of overriding these methods.
58 *
59 * <p>
60 *
61 * <strong>Warning:</strong>
62 * Serialized objects of this class will not be compatible with
63 * future Swing releases. The current serialization support is
64 * appropriate for short term storage or RMI between applications running
65 * the same version of Swing. As of 1.4, support for long term storage
66 * of all JavaBeans
67 * has been added to the <code>java.beans</code> package.
68 * Please see {@link java.beans.XMLEncoder}.
69 *
70 * @author Philip Milne
71 * @author Hans Muller
72 * @since 1.2
73 */
74 @SuppressWarnings("serial") // Same-version serialization only
75 public class DefaultListCellRenderer extends JLabel
76 implements ListCellRenderer<Object>, Serializable
77 {
78
79 /**
80 * An empty <code>Border</code>. This field might not be used. To change the
81 * <code>Border</code> used by this renderer override the
82 * <code>getListCellRendererComponent</code> method and set the border
83 * of the returned component directly.
84 */
85 private static final Border SAFE_NO_FOCUS_BORDER = new EmptyBorder(1, 1, 1, 1);
86 private static final Border DEFAULT_NO_FOCUS_BORDER = new EmptyBorder(1, 1, 1, 1);
326
327 /**
328 * Overridden for performance reasons.
329 * See the <a href="#override">Implementation Note</a>
330 * for more information.
331 */
332 @Override
333 public void firePropertyChange(String propertyName, boolean oldValue, boolean newValue) {}
334
335 /**
336 * A subclass of DefaultListCellRenderer that implements UIResource.
337 * DefaultListCellRenderer doesn't implement UIResource
338 * directly so that applications can safely override the
339 * cellRenderer property with DefaultListCellRenderer subclasses.
340 * <p>
341 * <strong>Warning:</strong>
342 * Serialized objects of this class will not be compatible with
343 * future Swing releases. The current serialization support is
344 * appropriate for short term storage or RMI between applications running
345 * the same version of Swing. As of 1.4, support for long term storage
346 * of all JavaBeans
347 * has been added to the <code>java.beans</code> package.
348 * Please see {@link java.beans.XMLEncoder}.
349 */
350 @SuppressWarnings("serial") // Same-version serialization only
351 public static class UIResource extends DefaultListCellRenderer
352 implements javax.swing.plaf.UIResource
353 {
354 }
355 }
|