Object value, // value to display
int index, // cell index
boolean isSelected, // is the cell selected
boolean cellHasFocus) // the list and the cell have the focus
{
Layer layer = (Layer)value;
String name = layer.getTitle();
if (name == null || name.trim().length() == 0) {
name = layer.getFeatureSource().getName().getLocalPart();
}
nameLabel.setText(name);
visibleLabel.setIcon(
layer.isVisible() ?
LayerControlItem.VISIBLE.getIcon() : LayerControlItem.VISIBLE.getOffIcon());
selectedLabel.setIcon(
layer.isSelected() ?
LayerControlItem.SELECTED.getIcon() : LayerControlItem.SELECTED.getOffIcon());
if (isSelected) {
setBackground(list.getSelectionBackground());
setForeground(list.getSelectionForeground());