import java.awt.*;
import java.awt.event.*;

class CardControl extends Panel implements ActionListener {
	CompanyPresentation parent;
	Button issueCard = new Button("New Card");
	Button cancelCard = new Button("Cancel Card");
	Button purchase = new Button("Purchase");
	Button payment = new Button("Payment");

	CardControl(CompanyPresentation parent) {
		super(new FlowLayout());	
		this.parent = parent;

		add(issueCard);
		add(cancelCard);
		add(purchase);
		add(payment);
		issueCard.addActionListener(this);
		cancelCard.addActionListener(this);
		purchase.addActionListener(this);
		payment.addActionListener(this);
	}

	public void actionPerformed(ActionEvent evt) {
		if (evt.getSource() == issueCard)	parent.issueCard();
		if (evt.getSource() == cancelCard) parent.cancelCard();
		if (evt.getSource() == purchase)   parent.purchase();
		if (evt.getSource() == payment)	parent.payment();
	}
}
