JClass DesktopViews 6.3.0 API
Documentation

com.klg.jclass.cell
Interface JCLightCellRenderer

All Superinterfaces:
JCCellRenderer, Serializable
All Known Implementing Classes:
JCImageCellRenderer, JCScaledImageCellRenderer, JCStringCellRenderer, JCWordWrapCellRenderer

public interface JCLightCellRenderer
extends JCCellRenderer

A drawing-based cell renderer interface. This interface is used to draw cell data within contraints provided by the container. This technique is faster than that provided by JCComponentCellRenderer, and offers more control. It can also be more work.

See Also:
JCCellRenderer, JCComponentCellRenderer

Method Summary
 void draw(Graphics gc, com.klg.jclass.cell.JCCellInfo cellInfo, Object o, boolean selected)
          Used to draw the cell.
 Dimension getPreferredSize(Graphics gc, com.klg.jclass.cell.JCCellInfo cellInfo, Object o)
          Returns the preferred size of the cell's drawing area.
 

Method Detail

draw

public void draw(Graphics gc,
                 com.klg.jclass.cell.JCCellInfo cellInfo,
                 Object o,
                 boolean selected)
Used to draw the cell.
Note: The size of the cell comes from cellInfo.getDrawingArea().

When the renderer's draw method is called, the gc is translated to the upper-left corner of the drawing area for the cell. The "drawing area" of the cell is the region inside the borders and the margins.

Parameters:
gc - graphics context to use for drawing
cellInfo - cell property information
o - object to be rendered
selected - boolean value indicating whether the cell is selected

getPreferredSize

public Dimension getPreferredSize(Graphics gc,
                                  com.klg.jclass.cell.JCCellInfo cellInfo,
                                  Object o)
Returns the preferred size of the cell's drawing area. The "drawing area" of the cell is the region inside the borders and the margins.

Parameters:
gc - graphics context for calculating size
cellInfo - cell property information
o - object to be rendered
Returns:
java.awt.Dimension instance containing preferrred height and width

Copyright © 2004 Quest Software Inc..
All rights reserved.