package org.cmdline.sudoku;

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

public class PuzzleCellRenderer extends DefaultTableCellRenderer {

	ListTableCell cell = null;
	
	protected void setValue(Object value) {
//		super.getTreeCellRendererComponent(tree,value,selected,expanded,leaf,row,hasFocus);
		cell = (ListTableCell)value;
		if (cell == null) return;
/*
		setBackground(lightGreen);
		setBackgroundNonSelectionColor(lightGreen);
		setBackgroundSelectionColor(Color.yellow);
*/
		setIcon(cell.getIcon());
//		setFont(node.getFont());
		setText(cell.getText());
		setHorizontalTextPosition(SwingConstants.RIGHT);
		setVerticalTextPosition(SwingConstants.CENTER);
		setHorizontalAlignment(SwingConstants.LEFT);
		setVerticalAlignment(SwingConstants.CENTER);
	}

}