package edu.drexel.tm.cs338.textacular;

import javax.swing.JComponent;
import javax.swing.JLabel;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
import javax.swing.JTextField;
import javax.swing.text.JTextComponent;

import net.miginfocom.swing.MigLayout;

/**
 * The class LetterPanel.
 * 
 * Displays inputs pertaining to letter creation
 * 
 * @author Trevor Maglione <tm@cs.drexel.edu>
 */
public class LetterPanel extends TemplatePanel {
	
	/**
	 * The template name.
	 */
	private static final String TEMPLATE_NAME = "Letter";
	
	/**
	 * The template filename.
	 */
	private static final String TEMPLATE_FILENAME = "letter.tex";
	
	/**
	 * The signature label.
	 */
	private JLabel lblSignature;
	
	/**
	 * The address label.
	 */
	private JLabel lblAddress;
	
	/**
	 * The addressee label.
	 */
	private JLabel lblTo;
	
	/**
	 * The opening label.
	 */
	private JLabel lblOpening;
	
	/**
	 * The content label.
	 */
	private JLabel lblContent;
	
	/**
	 * The closing label.
	 */
	private JLabel lblClosing;
	
	/**
	 * The signature text field.
	 */
	private JTextField txtSignature;
	
	/**
	 * The opening text field.
	 */
	private JTextField txtOpening;
	
	/**
	 * The closing text field.
	 */
	private JTextField txtClosing;
	
	/**
	 * The writer address text area.
	 */
	private JTextArea txtAddress;
	
	/**
	 * The addressee text area.
	 */
	private JTextArea txtTo;
	
	/**
	 * The content text area.
	 */
	private JTextArea txtContent;
	
	/**
	 * Instantiate a new LetterPanel.
	 */
	public LetterPanel() {
		super(TEMPLATE_NAME, TEMPLATE_FILENAME, new MigLayout("wrap 4"));
		
		lblSignature = new JLabel("Signature");
		lblAddress = new JLabel("Address");
		lblTo = new JLabel("To");
		lblOpening = new JLabel("Opening");
		lblContent = new JLabel("Content");
		lblClosing = new JLabel("Closing");
		
		inputs.put("signature", txtSignature = new JTextField(20));
		inputs.put("opening", txtOpening = new JTextField(20));
		inputs.put("closing", txtClosing = new JTextField(20));
		inputs.put("address", txtAddress = new JTextArea(5, 20));
		inputs.put("to", txtTo = new JTextArea(5, 20));
		inputs.put("content", txtContent = new JTextArea(10, 40));
		
		add(lblAddress);
		add(new JScrollPane(txtAddress));
		add(lblTo);
		add(new JScrollPane(txtTo), "wrap");
		add(lblOpening);
		add(txtOpening, "wrap");
		add(lblContent);
		add(new JScrollPane(txtContent), "span");
		add(lblClosing);
		add(txtClosing, "wrap");
		add(lblSignature);
		add(txtSignature, "wrap");
	}
}

@@ -1022,32 +1022,89 @@
 Closing;%0A%09%0A%09/**%0A
+%09 * The date label.%0A%09 */%0A%09private JLabel lblDate;%0A%09%0A%09/**%0A
 %09 * The signatur
@@ -1109,32 +1109,32 @@
 ure text field.%0A
-
 %09 */%0A%09private JT
@@ -1299,32 +1299,98 @@
 Closing;%0A%09%0A%09/**%0A
+%09 * The date text field.%0A%09 */%0A%09private JTextField txtDate;%0A%09%0A%09/**%0A
 %09 * The writer a
@@ -1826,24 +1826,56 @@
 abel(%22To%22);%0A
+%09%09lblDate = new JLabel(%22Date%22);%0A
 %09%09lblOpening
@@ -2209,32 +2209,84 @@
 xtArea(5, 20));%0A
+%09%09inputs.put(%22date%22, txtDate = new JTextField(20));%0A
 %09%09inputs.put(%22to
@@ -2452,16 +2452,16 @@
 lblTo);%0A
-
 %09%09add(ne
@@ -2483,32 +2483,72 @@
 xtTo), %22wrap%22);%0A
+%09%09add(lblDate);%0A%09%09add(txtDate, %22wrap%22);%0A
 %09%09add(lblOpening

Add date field to article panel