package org.cmdline.sudoku;

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

public class PuzzleTreeCellRenderer extends DefaultTreeCellRenderer implements TreeCellRenderer {

	private static final Color lightGreen = new Color(0xccffcc);
	PuzzleNode node = null;
	
	public Component getTreeCellRendererComponent(JTree tree,Object value,boolean selected,
													boolean expanded,boolean leaf,
													int row,boolean hasFocus) {
		super.getTreeCellRendererComponent(tree,value,selected,expanded,leaf,row,hasFocus);
		node = (PuzzleNode)value;
/*
		setBackground(lightGreen);
		setBackgroundNonSelectionColor(lightGreen);
		setBackgroundSelectionColor(Color.yellow);
*/
		setIcon(node.getIcon());
		setFont(node.getFont());
		return this;
	}

}