package edu.drexel.tm.cs338.textacular;

import java.awt.BorderLayout;

import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JTabbedPane;

import net.miginfocom.swing.MigLayout;

public class ProjectFrame extends JFrame {
	private JTabbedPane tabbedPane;
	
	private JPanel buttonsPanel;
	
	private JButton btnCompile;
	private JButton btnClear;
	private JButton btnOptions;
	
	private TemplatePanel[] panels = { new LetterPanel() };
	
	public ProjectFrame() {
		super("TeXtacular");

		tabbedPane = new JTabbedPane();
		addTabPanels();
		
		btnCompile = new JButton("Compile");
		btnClear = new JButton("Clear");
		btnOptions = new JButton("Options");
		
		buttonsPanel = new JPanel(new MigLayout());
		buttonsPanel.add(btnCompile);
		buttonsPanel.add(btnClear);
		buttonsPanel.add(btnOptions, "gapleft 30");
		
		add(tabbedPane);
		add(buttonsPanel, BorderLayout.SOUTH);
		
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setSize(800, 600);
	}
	
	private void addTabPanels() {
		for (TemplatePanel panel : panels) {
			tabbedPane.add(panel.getTemplateName(), panel);
		}
	}
}

@@ -63,16 +63,48 @@
 rLayout;
+%0Aimport java.awt.event.KeyEvent;
 %0A%0Aimport
@@ -152,16 +152,101 @@
 JFrame;%0A
+import javax.swing.JMenu;%0Aimport javax.swing.JMenuBar;%0Aimport javax.swing.JMenuItem;%0A
 import j
@@ -380,16 +380,102 @@
 Frame %7B%0A
+%09private JMenuBar menuBar;%0A%09%0A%09private JMenu mainMenu;%0A%09%0A%09private JMenuItem itmQuit;%0A%09%0A
 %09private
@@ -726,16 +726,62 @@
 cular%22);
+%0A%09%09%0A%09%09createMenuBar();%0A%09%09setJMenuBar(menuBar);
 %0A%0A%09%09tabb
@@ -1215,16 +1215,16 @@
 CLOSE);%0A
-
 %09%09setSiz
@@ -1241,16 +1241,216 @@
 );%0A%09%7D%0A%09%0A
+%09private void createMenuBar() %7B%0A%09%09menuBar = new JMenuBar();%0A%09%09mainMenu = new JMenu(%22File%22);%0A%09%09menuBar.add(mainMenu);%0A%09%09%0A%09%09itmQuit = new JMenuItem(%22Quit%22, KeyEvent.VK_Q);%0A%09%09mainMenu.add(itmQuit);%0A%09%7D%0A%09%0A
 %09private

Add menu bar to main frame