01: package net.xoetrope.samples.travel;
02:
03: import java.awt.Color;
04:
05: import net.xoetrope.awt.XImage;
06: import net.xoetrope.awt.XLabel;
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 FlightIndex extends XPage {
20: XLabel lblPrompt, lblAirportMaps, lblFlightSearch;
21: XImage imgBack;
22:
23: public FlightIndex() {
24: setBackground(Color.white);
25: imgBack = (XImage) componentFactory.addComponent(XPage.IMAGE,
26: 220, 10, 18, 14, "home.gif");
27: lblPrompt = (XLabel) componentFactory.addComponent(XPage.LABEL,
28: 10, 10, 300, 30,
29: "Please select the service you require!", "prompt");
30: lblAirportMaps = (XLabel) componentFactory.addComponent(
31: XPage.LABEL, 10, 100, 220, 30, "Airport Maps!",
32: "link/on");
33: lblFlightSearch = (XLabel) componentFactory.addComponent(
34: XPage.LABEL, 10, 200, 220, 30, "Flight Schedules!",
35: "link/on");
36: mapEvents();
37: }
38:
39: public void mapEvents() {
40: addMouseHandler(lblAirportMaps, "showMaps");
41: addMouseHandler(lblFlightSearch, "flightSearch");
42: addMouseHandler(imgBack, "goHome");
43: }
44:
45: public void goHome() {
46: if (wasMouseClicked())
47: XProjectManager.getPageManager().showPage("Services");
48: }
49:
50: public void showMaps() {
51: if (wasMouseClicked())
52: XProjectManager.getPageManager()
53: .showPage("AirportMapIndex");
54: }
55:
56: public void flightSearch() {
57: if (wasMouseClicked())
58: XProjectManager.getPageManager().showPage("FlightSearch");
59: }
60: }
|