Both the JTree and JTable classes make use of cell renderers to display cells and cell editors to modify cell values. The following classes round out the utilities available for rendering information. 27.4.1 The CellRendererPane ClassThis utility class was built to keep renderers from propagating repaint( ) and validate( ) calls to the components using renderer components such as JTree and JList. If you played around with creating your own renderers for any of the Swing components that use them, you'll recall that you did not use this class yourself. Normally this pane is wrapped around the renderer and the various paintComponent( ) methods below are used to do the actual drawing. Developers do not normally need to worry about this class. 27.4.2 The Renderer InterfaceThe Swing package includes a Renderer interface (which does not appear to be used within Swing itself) with the following methods:
This interface could be useful if you were to create a library of renderers for use with your own applications; however, it is not implemented anywhere in the Swing package as of SDK 1.4.1. 27.4.3 The GrayFilter ClassThe GrayFilter class is an extension of the java.awt.image.RGBImageFilter class. This class contains a static method that returns a "disabled" version of an image passed in. The image is converted to a grayscale version, and some lighter parts of the image are amplified to ensure the image is recognizable. All of the components that can display images use this class to present a default disabled version of the image if an explicit disabled image is not provided. If you want the gory details on image manipulation with Java 2, check out Java 2D Graphics by Jonathan Knudsen (O'Reilly & Associates). 27.4.3.1 Constructor
27.4.3.2 Image methods
|