01: package net.xoetrope.samples.travel;
02:
03: import net.xoetrope.awt.XButton;
04: import net.xoetrope.awt.XImage;
05: import net.xoetrope.awt.XMetaContent;
06: import net.xoetrope.awt.XTable;
07: import net.xoetrope.xui.XPage;
08: import net.xoetrope.xui.XProjectManager;
09:
10: /**
11: * <p>Title: Xui</p>
12: * <p>Description: </p>
13: * <p>Copyright: Copyright (c) Xoetrope Ltd., 1998-2003</p>
14: * <p>Company: Xoetrope Ltd.</p>
15: * @author not attributable
16: * @version 1.0
17: */
18:
19: public class FoodDetails extends XPage {
20: XTable table;
21: XButton btnBack;
22: XImage imgBack;
23: XMetaContent txtDetails;
24:
25: public FoodDetails() {
26: imgBack = (XImage) componentFactory.addComponent(XPage.IMAGE,
27: 220, 10, 18, 14, "home.gif");
28: componentFactory.addComponent(XPage.LABEL, 10, 10, 200, 20,
29: "Miso", "heading");
30: componentFactory.addComponent(XPage.LABEL, 10, 30, 200, 20,
31: "30 East Essex Street Temple Bar Dublin 2");
32: componentFactory.addComponent(XPage.LABEL, 10, 50, 200, 20,
33: "Phone 01 6708278");
34: componentFactory.addComponent(XPage.LABEL, 10, 70, 200, 20,
35: "Fax 01 6708278");
36: txtDetails = (XMetaContent) this .componentFactory.addComponent(
37: XPage.METACONTENT, 10, 110, 240, 200, null);
38: txtDetails
39: .setContent("Miso restaurant is located in the heart of Temple Bar in a restored eighteenth century building, near Meeting House Square and the Irish Film Centre, on the corner of Eustace Street and East Essex Street and just up Eustace St from Dublin's new Millennium foot bridge.");
40: btnBack = (XButton) componentFactory.addComponent(XPage.BUTTON,
41: 80, 270, 50, 20, "Back");
42: mapEvents();
43: }
44:
45: public void mapEvents() {
46: addMouseHandler(imgBack, "goHome");
47: addMouseHandler(btnBack, "goBack");
48: }
49:
50: public void showDetails() {
51: table.repaint();
52: }
53:
54: public void goHome() {
55: if (wasMouseClicked())
56: XProjectManager.getPageManager().showPage("Services");
57: }
58:
59: public void goBack() {
60: if (wasMouseClicked())
61: XProjectManager.getPageManager().showPrevious();
62: }
63:
64: }
|