be.ugent.caagt.swirl.lists

Interface CellListCellRenderer

Known Implementing Classes:
DefaultCellListCellRenderer

public interface CellListCellRenderer

Is responsible for painting a single element of a CellList. This class plays the same role as a javax.swing.ListCellRenderer does for a javax.swing.JList but with a different interface and contract.

Method Summary

String
getToolTipText(CellList list, Object value, int index)
Return the tool tip text for the given element.
void
paintElement(Graphics2D g2, CellList list, Object value, int index, boolean isSelected, boolean cellHasFocus)
Paint the given element at the 0,0-position on the given graphics context.

Method Details

getToolTipText

public String getToolTipText(CellList list,
                             Object value,
                             int index)
Return the tool tip text for the given element.
Parameters:
list - The cell list to which the element belongs
value - The corresponding value returned from the model
index - The index of the cell in the list
Returns:
the tool tip text for the cell, or null if no tool tip needs to be dipslayed

paintElement

public void paintElement(Graphics2D g2,
                         CellList list,
                         Object value,
                         int index,
                         boolean isSelected,
                         boolean cellHasFocus)
Paint the given element at the 0,0-position on the given graphics context.
Parameters:
g2 - Graphics context onto which the cell must be painted
list - The cell list to which the element belongs
value - The corresponding value returned from the model
index - The index of the cell in the list
isSelected - True if the specified cell was selected.
cellHasFocus - True if the specified cell has the focus.