be.ugent.caagt.swirl.lists
Interface CellListCellRenderer
- 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.
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.
|
getToolTipText
public String getToolTipText(CellList list,
Object value,
int index)
Return the tool tip text for the given element.
list
- The cell list to which the element belongsvalue
- The corresponding value returned from the modelindex
- The index of the cell in the list
- 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.
g2
- Graphics context onto which the cell must be paintedlist
- The cell list to which the element belongsvalue
- The corresponding value returned from the modelindex
- The index of the cell in the listisSelected
- True if the specified cell was selected.cellHasFocus
- True if the specified cell has the focus.