bluegammon.gui
Class BluetoothClientWorkflow

java.lang.Object
  extended bybluegammon.gui.BluetoothClientWorkflow
All Implemented Interfaces:
javax.bluetooth.DiscoveryListener, ItemAction, PopupListener

public class BluetoothClientWorkflow
extends java.lang.Object
implements ItemAction, javax.bluetooth.DiscoveryListener, PopupListener

Handles the different steps of connecting to a server as a client. Controls the gui component, the BluetoothDevicePage

Author:
Peter Andersson
See Also:
BluetoothDevicePage

Field Summary
 
Fields inherited from interface javax.bluetooth.DiscoveryListener
INQUIRY_COMPLETED, INQUIRY_ERROR, INQUIRY_TERMINATED, SERVICE_SEARCH_COMPLETED, SERVICE_SEARCH_DEVICE_NOT_REACHABLE, SERVICE_SEARCH_ERROR, SERVICE_SEARCH_NO_RECORDS, SERVICE_SEARCH_TERMINATED
 
Constructor Summary
BluetoothClientWorkflow(BluetoothDevicePage devicePage)
          Creates a workflow for connecting to a server as client.
 
Method Summary
 void deviceDiscovered(javax.bluetooth.RemoteDevice btDevice, javax.bluetooth.DeviceClass cod)
           
 void inquiryCompleted(int discType)
           
 void itemAction(MenuPage page, PageItem item)
          Called when user selects an item in a page.
 void refresh()
          Refreshes the view of nearby devices.
 void searchingStopped()
          Called when all nearby devices has been found or an error occurred during search.
 void selectedChoice(byte choice, boolean timeOut)
          Called when user presses cancel during connection to server.
 void servicesDiscovered(int transID, javax.bluetooth.ServiceRecord[] records)
           
 void serviceSearchCompleted(int transID, int respCode)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BluetoothClientWorkflow

public BluetoothClientWorkflow(BluetoothDevicePage devicePage)
Creates a workflow for connecting to a server as client. Uses the specified device page as a gui component.

Parameters:
devicePage - The gui component of this workflow.
Method Detail

refresh

public void refresh()
Refreshes the view of nearby devices.


searchingStopped

public void searchingStopped()
Called when all nearby devices has been found or an error occurred during search.


itemAction

public void itemAction(MenuPage page,
                       PageItem item)
Called when user selects an item in a page. This item can be that user wants to see list of devices to connect to, or the actual device item to connect to.

Specified by:
itemAction in interface ItemAction
Parameters:
page - The page this action is called from.
item - The item this action is called from.

selectedChoice

public void selectedChoice(byte choice,
                           boolean timeOut)
Called when user presses cancel during connection to server.

Specified by:
selectedChoice in interface PopupListener
Parameters:
choice - The index of the alternatives that were chosen.
timeOut - True if the choice was made because of a time out.

deviceDiscovered

public void deviceDiscovered(javax.bluetooth.RemoteDevice btDevice,
                             javax.bluetooth.DeviceClass cod)
Specified by:
deviceDiscovered in interface javax.bluetooth.DiscoveryListener

inquiryCompleted

public void inquiryCompleted(int discType)
Specified by:
inquiryCompleted in interface javax.bluetooth.DiscoveryListener

servicesDiscovered

public void servicesDiscovered(int transID,
                               javax.bluetooth.ServiceRecord[] records)
Specified by:
servicesDiscovered in interface javax.bluetooth.DiscoveryListener

serviceSearchCompleted

public void serviceSearchCompleted(int transID,
                                   int respCode)
Specified by:
serviceSearchCompleted in interface javax.bluetooth.DiscoveryListener