/*
 * CorTecnicoCellRenderer.java
 *
 * Created on February 1, 2006, 11:13 PM
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package siprp.higiene.marcacoes;

import java.awt.*;
import javax.swing.*;

import siprp.higiene.*;

/**
 *
 * @author fpalma
 */
public class CorTecnicoCellRenderer extends JLabel implements ListCellRenderer
{
	
	public CorTecnicoCellRenderer()
	{
		setOpaque(true);
	}
	
	public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus)
	{
		setText( "  " );
		Color color = HigieneDataProvider.CORES_TECNICOS[ ( ( Integer ) value ).intValue() ];
		if( cellHasFocus )
		{
			color = color.darker().darker();
		}
		setBackground( color );
			
		return this;
	}
}
