01: package net.xoetrope.samples.travel;
02:
03: import net.xoetrope.awt.XButton;
04: import net.xoetrope.awt.XImage;
05: import net.xoetrope.awt.XTable;
06: import net.xoetrope.xui.XPage;
07: import net.xoetrope.xui.XProjectManager;
08: import net.xoetrope.xui.data.XModel;
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 BusRoutes extends XPage {
20: XTable table;
21: XButton btnShow;
22: XImage imgBack;
23:
24: public BusRoutes() {
25: imgBack = (XImage) componentFactory.addComponent(XPage.IMAGE,
26: 220, 10, 18, 14, "home.gif");
27: table = (XTable) componentFactory.addComponent(XPage.TABLE, 10,
28: 10, 215, 150);
29: table.setModel((XModel) XProjectManager.getModel().get(
30: "base/busroutes/items"));
31: table.setStyle("base/TableData");
32: table.setHeaderStyle("base/TableHeading");
33: table.setSelectedStyle("base/TableSelection");
34: table.setInteractiveTable(true);
35: table.repaint();
36: // btnShow = (XButton)componentFactory.addNamedComponent( XPage.BUTTON, 70, 200, 50, 20, "Show" );
37: // addMouseHandler( btnShow, "showRoute" );
38: mapEvents();
39: }
40:
41: public void mapEvents() {
42: addMouseHandler(imgBack, "goHome");
43: }
44:
45: public void showRoute() {
46: table.repaint();
47: }
48:
49: public void goHome() {
50: if (wasMouseClicked())
51: XProjectManager.getPageManager().showPage("Services");
52: }
53:
54: }
|