001 package videoautomat; 002 import java.awt.Rectangle; 003 004 import sale.Action; 005 import sale.FormSheet; 006 import sale.FormSheetContentCreator; 007 import sale.SaleProcess; 008 import sale.SalesPoint; 009 import videoautomat.gui.Global; 010 011 /** 012 * This class is an implementation of a <code>SalesPoint</code>, at which all the user 013 * activities take place. 014 * 015 */ 016 public class VideoAutomat extends SalesPoint { 017 /** 018 * The Constructor of VideoAutomat 019 * 020 */ 021 public VideoAutomat() { 022 super(Global.CAPTION_AUTOMAT); 023 setSalesPointFrameBounds(new Rectangle(0, 0, 640, 480)); 024 } 025 026 /** 027 * @return the default <code>FormSheet</code> shown whenever no process is running. 028 * @see sale.SalesPoint#getDefaultFormSheet() 029 */ 030 protected FormSheet getDefaultFormSheet() { 031 FormSheet fs = 032 Global.getStartFormSheet( 033 VideoShop.getVideoStock(), 034 null, 035 false, 036 new TEDVideoStock()); 037 fs.addContentCreator(new FormSheetContentCreator() { 038 protected void createFormSheetContent(FormSheet sheet) { 039 sheet.getButton(Global.FB_LOGON).setAction(new Action() { 040 public void doAction(SaleProcess process, SalesPoint point) 041 throws Throwable { 042 point.runProcess(new SaleProcessLogOn()); 043 } 044 }); 045 } 046 }); 047 return fs; 048 } 049 050 }