01: package net.xoetrope.samples.travel;
02:
03: import net.xoetrope.awt.XImage;
04: import net.xoetrope.xui.XPage;
05: import net.xoetrope.xui.XProjectManager;
06:
07: /**
08: * <p>Title: Xui</p>
09: * <p>Description: </p>
10: * <p>Copyright: Copyright (c) Xoetrope Ltd., 1998-2003</p>
11: * <p>Company: Xoetrope Ltd.</p>
12: * @author Xoetrope Ltd.
13: * @version 1.0
14: */
15: public class Services extends XPage {
16: XImage imgFlightInfo, imgCarHire, imgBusSchedules, imgTaxis,
17: imgFoodNDrink, imgTourGuide;
18:
19: public Services() {
20: super ();
21: imgFlightInfo = (XImage) componentFactory.addComponent(
22: XPage.IMAGE, 0, 0, 125, 95, "flightinfo.jpg");
23: imgCarHire = (XImage) componentFactory.addComponent(
24: XPage.IMAGE, 126, 0, 125, 95, "carhire.jpg");
25: imgBusSchedules = (XImage) componentFactory.addComponent(
26: XPage.IMAGE, 0, 96, 125, 95, "busschedules.jpg");
27: imgTaxis = (XImage) componentFactory.addComponent(XPage.IMAGE,
28: 126, 96, 125, 95, "taxis.jpg");
29: imgFoodNDrink = (XImage) componentFactory.addComponent(
30: XPage.IMAGE, 0, 192, 125, 95, "foodndrink.jpg");
31: imgTourGuide = (XImage) componentFactory.addComponent(
32: XPage.IMAGE, 126, 192, 125, 95, "tourguide.jpg");
33: mapEvents();
34: }
35:
36: private void mapEvents() {
37: addMouseHandler(imgFlightInfo, "showFlights");
38: addMouseHandler(imgCarHire, "showCarHire");
39: addMouseHandler(imgBusSchedules, "showBusSchedules");
40: addMouseHandler(imgTaxis, "showTaxis");
41: addMouseHandler(imgFoodNDrink, "showFoodNDrink");
42: addMouseHandler(imgTourGuide, "showTourGuide");
43: }
44:
45: public void showFlights() {
46: if (wasMouseClicked())
47: XProjectManager.getPageManager().showPage("FlightIndex");
48: }
49:
50: public void showCarHire() {
51: if (wasMouseClicked())
52: XProjectManager.getPageManager().showPage("CarHire");
53: }
54:
55: public void showBusSchedules() {
56: if (wasMouseClicked())
57: XProjectManager.getPageManager().showPage("BusSchedules");
58: }
59:
60: public void showTaxis() {
61: if (wasMouseClicked())
62: ;
63: }
64:
65: public void showFoodNDrink() {
66: if (wasMouseClicked())
67: XProjectManager.getPageManager().showPage("FoodIndex");
68: }
69:
70: public void showTourGuide() {
71: if (wasMouseClicked())
72: XProjectManager.getPageManager()
73: .showPage("GuidedTourIndex");
74: }
75: }
|