package org.grandviewtech.userinterface.screen;

/*
 * #%L
 * Programmable Login Controller Inteface
 * %%
 * Copyright (C) 2016 GrandViewTech
 * %%
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as
 * published by the Free Software Foundation, either version 3 of the
 * License, or (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public
 * License along with this program.  If not, see
 * <http://www.gnu.org/licenses/gpl-3.0.html>.
 * #L%
 */

import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;

import javax.swing.JPanel;

import org.grandviewtech.entity.bo.Screen;
import org.grandviewtech.userinterface.listeners.DefaultKeyListener;

public class Sheet extends JPanel
	{
		private static Screen		screen				= Screen.getInstance();
		
		private static final long	serialVersionUID	= 2259392011305568009L;
		
		public GridBagConstraints	gridBagConstraints	= new GridBagConstraints();
		
		public Sheet()
			{
				if (screen == null)
					{
						screen = Screen.getInstance();
					}
				addKeyListener(new DefaultKeyListener());
				GridBagLayout gridBagLayout = new GridBagLayout();
				setLayout(gridBagLayout);
			}
			
		@Override
		public void removeAll()
			{
				
				super.removeAll();
				if (screen == null)
					{
						screen = Screen.getInstance();
					}
				screen.removeAll();
			}
			
	}
