Device Class Reference

Inheritance diagram for Device:

AudioHeadsetDevice HandheldDevice LCDDevice ProjectorDevice List of all members.

Public Member Functions

 Device (String theHostNameOrIPAddr, String descriptiveName)
 Provide an IP address of a remote device that is listening for actions.
void connect ()
 Once we have connected, we can start sending this device commands.
void disconnect ()
ActionChannel getActionChannel ()
AudioChannel getAudioChannel ()
 The audio channel provides convenience functions to easily play audio or read text on this device.
DisplayChannel getDisplayChannel ()
 Access the display.
String getName ()
void invokeAction (R3Action action)
 Send actions directly to the REMOTE device that this Device object represents.
boolean isAlive ()
 Instead of pinging, we check if a device is "reachable" by making sure it has a host address.

Static Public Member Functions

static PlaySoundAction doPlaySound (File soundFile)
 Plays the sound file on the local device.
static void doSpeakText (String textToSpeak)
static void doOpenURL (String urlString)
 Opens a URL on the local machine.
static OpenFileAction doOpenFile (File file)
 Opens a file on the local device, using the default file editor.

Detailed Description

Applications can also include devices, which can supply input and receive output. Since devices may not be attached to the local machine where you are running the program, we need to assign a hostname to each device.

Devices work closely with the Actions API. Basically, devices are constructs that allow us to send events and actions to remote machines...

This software is distributed under the BSD License.

Author:
Ron B Yeh (ronyeh(AT)cs.stanford.edu)

Definition at line 39 of file Device.java.


Member Function Documentation

void connect (  ) 

Once we have connected, we can start sending this device commands.

...

Definition at line 136 of file Device.java.

static OpenFileAction doOpenFile ( File  file  )  [static]

Opens a file on the local device, using the default file editor.

Parameters:
file 
Returns:

Definition at line 248 of file Device.java.

References OpenFileAction.invoke().

static PlaySoundAction doPlaySound ( File  soundFile  )  [static]

Plays the sound file on the local device.

Parameters:
soundFile 
Returns:
the playSoundAction object, so you can stop the audio if you wish.

Definition at line 86 of file Device.java.

References PlaySoundAction.invoke(), and PlaySoundAction.stop().

static void doSpeakText ( String  textToSpeak  )  [static]

Parameters:
textToSpeak 

Definition at line 226 of file Device.java.

ActionChannel getActionChannel (  ) 

Returns:

Definition at line 152 of file Device.java.

AudioChannel getAudioChannel (  ) 

The audio channel provides convenience functions to easily play audio or read text on this device.

But, if you need to access the sender directly, you can always call the lower level invokeAction(...).

Returns:
a channel that allows us to send audio to this device...

Definition at line 166 of file Device.java.

DisplayChannel getDisplayChannel (  ) 

Access the display.

Returns:

Definition at line 178 of file Device.java.

String getName (  ) 

Returns:

Definition at line 188 of file Device.java.

void invokeAction ( R3Action  action  ) 

Send actions directly to the REMOTE device that this Device object represents.

Parameters:
action 

Definition at line 197 of file Device.java.

References ActionSender.invokeRemoteAction().

Referenced by ActionChannel.openFile(), ActionChannel.openURL(), AudioChannel.playSoundFile(), AudioChannel.readTextOutLoud(), and ActionChannel.typeString().

boolean isAlive (  ) 

Instead of pinging, we check if a device is "reachable" by making sure it has a host address.

Returns:

Definition at line 210 of file Device.java.


The documentation for this class was generated from the following file:
Generated on Sat Apr 14 18:21:41 2007 for R3 Paper Toolkit by  doxygen 1.4.7