package unileipzig.isys.neuronviz.kernel;

import java.awt.BorderLayout;
import java.awt.event.KeyEvent;
import java.util.Vector;

import javax.swing.JPanel;
import javax.swing.JTabbedPane;

public class VizManager
{
	private JTabbedPane vizTabbedPane;
	private JPanel managerPanel;
	
	private Vector vizPanelList;
	
	
	public VizManager()
	{
		vizPanelList = new Vector();
		
		managerPanel = new JPanel();
		managerPanel.setLayout(new BorderLayout());
		
		vizTabbedPane = new JTabbedPane();
		vizTabbedPane.setTabPlacement(JTabbedPane.BOTTOM);
		managerPanel.add(BorderLayout.CENTER, vizTabbedPane);
	}
	
	
	public void addVizPanel(JPanel vizPanel)
	{
		vizPanelList.add(vizPanel);
		
		String tabName = new String(
						"<html>" +
						"<b style=\"color:#990000;\">" + 
						vizPanelList.size() + 
						"</b> " + 
						vizPanel.getName() + 
						"</html>");
		vizTabbedPane.addTab(tabName, null, vizPanel, vizPanel.getToolTipText());
		vizTabbedPane.setMnemonicAt(vizPanelList.size()-1, KeyEvent.VK_0 + vizPanelList.size());
		
		vizPanel.setToolTipText(null);
	}

	public JPanel getManagerPanel()
	{
		return this.managerPanel;
	}
}
