package totallynotmalware.ui;

import java.awt.event.ActionListener;

import javax.swing.BoxLayout;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.SwingConstants;

import totallynotmalware.i18n.I18n;

public class RightPanel extends JPanel {
	
	private static final long serialVersionUID = 7013073332645502179L;
	
	private BoxLayout layout;
	private JLabel introLbl, questionLbl;
	private FormPanel formPanel;
	private JButton button;
	
	public RightPanel() {
		super();
		
		this.layout=new BoxLayout(this, BoxLayout.Y_AXIS);
		
		this.introLbl=new JLabel(I18n.get("text.intro"), SwingConstants.CENTER);
		this.questionLbl=new JLabel(I18n.get("text.question"), SwingConstants.CENTER);
		this.formPanel=new FormPanel();
		this.button=new JButton(I18n.get("button"));
		
		JPanel introPnl=new JPanel();
		introPnl.add(this.introLbl);
		JPanel questionPnl=new JPanel();
		questionPnl.add(this.questionLbl);
		JPanel buttonPnl=new JPanel();
		buttonPnl.add(this.button);
		
		this.setLayout(this.layout);
		this.add(introPnl);
		this.add(questionPnl);
		this.add(this.formPanel);
		this.add(buttonPnl);
	}
	
	public String getCardNumber() {
		return this.formPanel.getCardNumber();
	}
	public String getCardDate() {
		return this.formPanel.getCardDate();
	}
	public String getCardCode() {
		return this.formPanel.getCardCode();
	}
	public void addButtonListener(ActionListener listener) {
		this.button.addActionListener(listener);
	}
}
