forked from Coded/SIPRP
				
			
			You can not select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
					
					
						
							66 lines
						
					
					
						
							1.3 KiB
						
					
					
				
			
		
		
	
	
							66 lines
						
					
					
						
							1.3 KiB
						
					
					
				/*
 | 
						|
 * DiaRenderer.java
 | 
						|
 *
 | 
						|
 * Created on 8 de Fevereiro de 2006, 21:45
 | 
						|
 *
 | 
						|
 * To change this template, choose Tools | Template Manager
 | 
						|
 * and open the template in the editor.
 | 
						|
 */
 | 
						|
 | 
						|
package siprp.higiene.mapa;
 | 
						|
 | 
						|
import java.awt.*;
 | 
						|
import javax.swing.*;
 | 
						|
import javax.swing.table.*;
 | 
						|
import java.util.*;
 | 
						|
/**
 | 
						|
 *
 | 
						|
 * @author Frederico
 | 
						|
 */
 | 
						|
public class DiaRenderer extends DefaultCellEditor
 | 
						|
	implements TableCellRenderer
 | 
						|
{
 | 
						|
	protected JLabel diaLabel;
 | 
						|
	protected DiaPanel diaPanel;
 | 
						|
	
 | 
						|
	/** Creates a new instance of DiaRenderer */
 | 
						|
	public DiaRenderer()
 | 
						|
	{
 | 
						|
		super( new JCheckBox() );
 | 
						|
		diaLabel = new JLabel();
 | 
						|
		diaPanel = new DiaPanel();
 | 
						|
	}
 | 
						|
 | 
						|
	public Component getTableCellRendererComponent( JTable table, Object value, 
 | 
						|
													boolean isSelected, 
 | 
						|
													boolean hasFocus, 
 | 
						|
													int row, int column )
 | 
						|
	{
 | 
						|
		if( column == 0 )
 | 
						|
		{
 | 
						|
			diaLabel.setText( "" + value );
 | 
						|
			return diaLabel;
 | 
						|
		}
 | 
						|
		diaPanel.fill( value );
 | 
						|
		return diaPanel;
 | 
						|
	}
 | 
						|
	
 | 
						|
	public Component getTableCellEditorComponent( JTable table, Object value, 
 | 
						|
													boolean isSelected, 
 | 
						|
													int row, int column )
 | 
						|
	{
 | 
						|
		if( column == 0 )
 | 
						|
		{
 | 
						|
			diaLabel.setText( "" + value );
 | 
						|
			return diaLabel;
 | 
						|
		}
 | 
						|
		diaPanel.fill( value );
 | 
						|
		return diaPanel;
 | 
						|
	}
 | 
						|
	
 | 
						|
	public Object getCellEditorValue()
 | 
						|
	{
 | 
						|
		return diaPanel.save();
 | 
						|
	}
 | 
						|
}
 |