package siprp.higiene.gestao;

import java.awt.Dimension;

import javax.swing.JFrame;
import javax.swing.JTabbedPane;
import javax.swing.SwingUtilities;

import com.evolute.utils.tracker.TrackableWindow;

import static com.evolute.utils.strings.UnicodeLatin1Map.*;

public class GestaoRelatorioWindow extends JFrame implements TrackableWindow
{

	public static final String TITLE = "Gest" + atilde + "o de Relat" + oacute + "rio de Higiene e Seguran" + ccedil + "a";
	
	private static final Dimension SIZE = new Dimension( 1024, 700 );
	
	private static final long serialVersionUID = 1L;
	
	private final JTabbedPane tabs = new JTabbedPane();
	
	private final GlobalPanel panelGlobal = new GlobalPanel();
	
	private final EmpresaPanel panelEmpresa = new EmpresaPanel();

	public static void main( String[] args )
	{
		GestaoRelatorioWindow window = new GestaoRelatorioWindow();
		window.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
		window.open();
	}
	
	public GestaoRelatorioWindow()
	{
		this.setTitle( TITLE );
		this.setSize( SIZE );
		this.setLocationRelativeTo( null );
		placeComponents();
	}
	
	private void placeComponents()
	{
		tabs.addTab( "Global", panelGlobal );
		tabs.addTab( "Por Empresa", panelEmpresa );
		this.setContentPane( tabs );
	}

	@Override
	public void open()
	{
		setVisible( true );
	}

	public void close()
	{
		SwingUtilities.invokeLater( new Runnable()
		{
			public void run()
			{
				setVisible( false );
				dispose();
			}
		} );
	}

	@Override
	public boolean closeIfPossible()
	{
		close();
		return true;
	}

	@Override
	public void refresh()
	{
	}


}
