import data.*;
import sale.*;
import javax.swing.*;
public class DefaultOfficeFormCreator extends FormSheetContentCreator
{
private Office officeOwner;
public DefaultOfficeFormCreator(Office officeOwner)
{
super();
this.officeOwner = officeOwner;
}
public void createFormSheetContent (FormSheet fsToCreate)
{
JPanel jpFSComponent = new JPanel();
jpFSComponent.setLayout (new BoxLayout (jpFSComponent, BoxLayout.Y_AXIS));
jpFSComponent.add(new JLabel("Turn : " + Shop.getTheShop().getTimer().getTime()));
Stock coinSlot = Shop.getTheShop().getStock("coin slot");
Currency currency = (Currency)Shop.getTheShop().getCatalog("DM");
IntegerValue money = (IntegerValue)coinSlot.sumStock(null,
new CatalogItemValue(), new IntegerValue (0));
jpFSComponent.add (new JLabel("Money : " + currency.toString(money)));
fsToCreate.setComponent (jpFSComponent);
fsToCreate.removeAllButtons();
fsToCreate.addButton ("Close", 1, new sale.Action()
{
public void doAction (SaleProcess p, SalesPoint sp)
{
officeOwner.quit();
}
});
}
}