01: package net.xoetrope.samples.apps;
02:
03: import net.xoetrope.awt.XButton;
04: import net.xoetrope.awt.XLabel;
05: import net.xoetrope.xui.XPage;
06: import net.xoetrope.xui.XPageManager;
07: import net.xoetrope.xui.style.XStyleFactory;
08: import net.xoetrope.xui.helper.BuddyHelper;
09: import net.xoetrope.xui.data.XTextBinding;
10: import net.xoetrope.xui.XProjectManager;
11:
12: /**
13: * <p>Title: Xui</p>
14: * <p>Description: </p>
15: * <p>Copyright: Copyright (c) Xoetrope Ltd., 1998-2003</p>
16: * <p>Company: Xoetrope Ltd.</p>
17: * @author not attributable
18: * @version 1.0
19: */
20:
21: public class LastPage extends XPage {
22: XLabel lblFirstname, lblSurname, lblAge, lblProfession, lblGender,
23: lblPrice, lblAdvance, lblDeposit;
24: XButton btnBack, btnEnd;
25:
26: public LastPage() {
27: BuddyHelper buddy = new BuddyHelper(
28: (XStyleFactory) componentFactory);
29: componentFactory.addComponent(XPage.LABEL, 10, 10, 200, 25,
30: "Summary of details", "base/PageTitle");
31: lblFirstname = (XLabel) buddy.addComponent(XPage.LABEL, 20, 40,
32: 130, 20, "Firstname", "", null);
33: lblSurname = (XLabel) buddy.addComponent(XPage.LABEL, 20, 65,
34: 130, 20, "Surname", "", null);
35: lblAge = (XLabel) buddy.addComponent(XPage.LABEL, 20, 90, 130,
36: 20, "Age", "", null);
37: lblProfession = (XLabel) buddy.addComponent(XPage.LABEL, 20,
38: 115, 130, 20, "Profession", "", null);
39: lblGender = (XLabel) buddy.addComponent(XPage.LABEL, 20, 140,
40: 130, 20, "Profession", "", null);
41: lblPrice = (XLabel) buddy.addComponent(XPage.LABEL, 20, 165,
42: 130, 20, "Price", "", null);
43: lblAdvance = (XLabel) buddy.addComponent(XPage.LABEL, 20, 190,
44: 130, 20, "Advance", "", null);
45: lblDeposit = (XLabel) buddy.addComponent(XPage.LABEL, 20, 215,
46: 130, 20, "Deposit", "", null);
47: btnBack = (XButton) componentFactory.addComponent(XPage.BUTTON,
48: 20, 250, 60, 25, "Back");
49: btnEnd = (XButton) componentFactory.addComponent(XPage.BUTTON,
50: 120, 250, 60, 25, "End");
51: populateComponents();
52: mapEvent();
53: }
54:
55: public void populateComponents() {
56: addBinding(new XTextBinding(lblFirstname, "customer1/firstname"));
57: addBinding(new XTextBinding(lblSurname, "customer1/surname"));
58: addBinding(new XTextBinding(lblAge, "customer1/age"));
59: addBinding(new XTextBinding(lblProfession,
60: "general/professions"));
61: addBinding(new XTextBinding(lblGender, "general/gender"));
62: addBinding(new XTextBinding(lblPrice, "finance/price"));
63: addBinding(new XTextBinding(lblAdvance, "finance/advance"));
64: addBinding(new XTextBinding(lblDeposit, "finance/deposit"));
65: }
66:
67: public void mapEvent() {
68: addMouseHandler(btnBack, "previousScreen");
69: addMouseHandler(btnEnd, "end");
70: }
71:
72: public void previousScreen() {
73: if (wasMouseClicked()) {
74: XProjectManager.getPageManager().showPage("SecondPage");
75: }
76: }
77:
78: public void end() {
79: if (wasMouseClicked()) {
80: System.exit(0);
81: }
82: }
83: }
|