|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectfrog.gui.User
public class User
This class is the FROGUI abstraction for Session. It listens to the Session and provides access to most of its methods for GUI use.
| Constructor Summary | |
|---|---|
User(int index)
Creates a new user with the specified index. |
|
| Method Summary | |
|---|---|
void |
accelerationPerformed(AccelEvent e)
Executed whenever a Session detects an acceleration from a Device it is listening to. |
void |
gestureComplete(boolean good,
Device d)
Executed whenever a Session detects a complete gesture from a Device it is listening to. |
void |
gestureRecognized(GestureModel g)
Executed whenever a Session has recognized a gesture performed by the Device it is listening to (requires being in recognition mode). |
Device |
getDevice()
Returns the device this user has connected. |
int |
getIndex()
Returns the index of this user. |
Session |
getSession()
Returns the Session currently associated with this user. |
String |
getUserName()
Returns the name of the User this object represents. |
void |
saveSession(File saveFile)
Attempts to serialize this User's current Session into a File for later retrieval. |
void |
setDevice(Device d)
Sets the Device for this User to use. |
void |
setSession(File openFile)
Creates a new Session from the given serialized session file and sets that as the User's current Session. |
void |
setSession(Session s)
Sets the Session for the User. |
void |
setUserName(String userName)
This method sets the name of the user to be used in dialogs, user files, etc. |
String |
toString()
|
void |
unexpectedDisconnect(Device d)
Executed whenever a Session detects an unexpected disconnect from a Device it is listening to. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public User(int index)
index - the index of this user.| Method Detail |
|---|
public Device getDevice()
null. You can use hasDeviceConnected() to
verify beforehand.
null if no Device
is connected.public int getIndex()
public Session getSession()
public String getUserName()
public void saveSession(File saveFile)
throws NullPointerException,
IOException
saveFile - a valid File to write the Session object to
NullPointerException - if the Session was null
IOException - if a problem occurred while serializing the Session
public void setDevice(Device d)
throws IOException
d - this User's new Device.
IOExceptionpublic void setUserName(String userName)
userName - the name to be given to this User.
public void setSession(Session s)
throws IOException
s - session to be associated to this object.
IOException
public void setSession(File openFile)
throws Exception
openFile - a File containing a serialized Session object
Exceptionpublic String toString()
toString in class Objectpublic void accelerationPerformed(AccelEvent e)
SessionListener
accelerationPerformed in interface DeviceListeneraccelerationPerformed in interface SessionListenere - contains the acceleration data and the calling devicepublic void unexpectedDisconnect(Device d)
SessionListener
unexpectedDisconnect in interface DeviceListenerunexpectedDisconnect in interface SessionListenerd - Device that was unexpectedly disconnected
public void gestureComplete(boolean good,
Device d)
SessionListener
gestureComplete in interface DeviceListenergestureComplete in interface SessionListenergood - true if this gesture is complete.
false if this gesture should be discarded.d - the device that completed the gesturepublic void gestureRecognized(GestureModel g)
SessionListener
gestureRecognized in interface SessionListenerg - The gesture recognizedSession.inRecognitionMode()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||