edu.UCL.xmiddle.apps.shop
Class Shop

java.lang.Object
  |
  +--java.awt.event.WindowAdapter
        |
        +--edu.UCL.xmiddle.apps.shop.Shop
All Implemented Interfaces:
java.awt.event.ActionListener, java.util.EventListener, java.awt.event.TextListener, java.awt.event.WindowFocusListener, java.awt.event.WindowListener, java.awt.event.WindowStateListener, XApp

public class Shop
extends java.awt.event.WindowAdapter
implements java.awt.event.ActionListener, java.awt.event.TextListener, XApp

Shop is a sample shopping application for the xmiddle platform. It uses the AWT for the interface, as to maximize compability with other virtual machines and minimize memory requirements.


Field Summary
 
Fields inherited from interface edu.UCL.xmiddle.framework.lib.XApp
CONNECTED, DISCONNECTED
 
Constructor Summary
Shop(int width, int height)
          Constructor.
Shop(int width, int height, java.lang.String configPath)
          Constructs the Shop application.
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent event)
          Responds to ActionEvents.
 java.lang.Integer getID()
          Returns the application ID
 org.w3c.dom.Document getSchema()
          Returns the Schema Document
static void main(java.lang.String[] args)
          Starts the shop application with the appropriate display size.
 void notifyConnectionStatus(boolean status)
          Not implemented
 void notifyProtocolAbort(java.lang.String id, java.lang.Object[] parameters)
          Not implemented
 void notifyProtocolBegin(java.lang.String id, java.lang.Object[] parameters)
          Not implemented
 void notifyProtocolEnd(java.lang.String id, java.lang.Object[] parameters)
          Notifies the termination of the synchronization protocol.
 void textValueChanged(java.awt.event.TextEvent event)
          Responds to the textValueChanged event
 void windowClosing(java.awt.event.WindowEvent event)
          Responds to WindowEvents.
 
Methods inherited from class java.awt.event.WindowAdapter
windowActivated, windowClosed, windowDeactivated, windowDeiconified, windowGainedFocus, windowIconified, windowLostFocus, windowOpened, windowStateChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Shop

public Shop(int width,
            int height)
Constructor.

Parameters:
width - is the width of the application window
height - is the height of the application window

Shop

public Shop(int width,
            int height,
            java.lang.String configPath)
Constructs the Shop application.

Parameters:
width - the window width
height - the window eight
configPath - the path where the configuration files are stored
Method Detail

getID

public java.lang.Integer getID()
Returns the application ID

Specified by:
getID in interface XApp
Returns:
the application ID

notifyConnectionStatus

public void notifyConnectionStatus(boolean status)
Not implemented

Specified by:
notifyConnectionStatus in interface XApp

notifyProtocolBegin

public void notifyProtocolBegin(java.lang.String id,
                                java.lang.Object[] parameters)
Not implemented

Specified by:
notifyProtocolBegin in interface XApp

notifyProtocolAbort

public void notifyProtocolAbort(java.lang.String id,
                                java.lang.Object[] parameters)
Not implemented

Specified by:
notifyProtocolAbort in interface XApp

getSchema

public org.w3c.dom.Document getSchema()
Returns the Schema Document

Specified by:
getSchema in interface XApp

notifyProtocolEnd

public void notifyProtocolEnd(java.lang.String id,
                              java.lang.Object[] parameters)
Notifies the termination of the synchronization protocol.

Specified by:
notifyProtocolEnd in interface XApp
Parameters:
id - the application ID
parameters - an array of Objects

main

public static void main(java.lang.String[] args)
Starts the shop application with the appropriate display size. We assume an iPAQ-type resolution (320x240). Display size detection capabilities should be added.


actionPerformed

public void actionPerformed(java.awt.event.ActionEvent event)
Responds to ActionEvents.

Specified by:
actionPerformed in interface java.awt.event.ActionListener
Parameters:
event - The ActionEvent.

textValueChanged

public void textValueChanged(java.awt.event.TextEvent event)
Responds to the textValueChanged event

Specified by:
textValueChanged in interface java.awt.event.TextListener

windowClosing

public void windowClosing(java.awt.event.WindowEvent event)
Responds to WindowEvents.

Specified by:
windowClosing in interface java.awt.event.WindowListener
Overrides:
windowClosing in class java.awt.event.WindowAdapter
Parameters:
event - The WindowEvent.