Class JRendererLabel

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, SwingConstants, IconAware, PainterAware

public class JRendererLabel extends JLabel implements PainterAware, IconAware
A JLabel optimized for usage in renderers and with a minimal background painter support.

Note: the painter support will be switched to painter_work as soon it enters main. The reasoning for the performance-overrides is copied from core:

The standard JLabel component was not designed to be used this way and we want to avoid triggering a revalidate each time the cell is drawn. This would greatly decrease performance because the revalidate message would be passed up the hierarchy of the container to determine whether any other components would be affected. As the renderer is only parented for the lifetime of a painting operation we similarly want to avoid the overhead associated with walking the hierarchy for painting operations. So this class overrides the validate, invalidate, revalidate, repaint, and firePropertyChange methods to be no-ops and override the isOpaque method solely to improve performance. If you write your own renderer component, please keep this performance consideration in mind.

Author:
Jeanette Winzenburg
See Also:
  • Field Details

    • painter

      protected Painter painter
  • Constructor Details

    • JRendererLabel

      public JRendererLabel()
  • Method Details