ants.move.core.models.avatar
Class AvatarControl

java.lang.Object
  |
  +--ants.move.core.models.avatar.AvatarControl
All Implemented Interfaces:
ants.core.PlaceListener, ants.comm.RemoteEventListener

public class AvatarControl
extends java.lang.Object
implements ants.comm.RemoteEventListener, ants.core.PlaceListener

Avatar addition and removal control class.

Version:
1.2 Build 2000
Author:
Carles Pairot (cpairot@tinet.org), Oriol Montalà (omontala@tinet.org)

Constructor Summary
AvatarControl(ants.core.Place ch, java.util.Hashtable env)
           
 
Method Summary
 boolean contains(java.lang.String user)
          Checks if user is in the users Hashtable.
 void destroyPilotUser()
          Remotely remove ourselves from users Vector and from the VRML scene of other clients.
 void eventArrived(java.util.Hashtable evt)
          Adds and removes avatars.
 AvatarView getUser(java.lang.String usr)
           
 void getUsers()
          Remotely gets all users connected at that time.
 void leaveSession()
          Leaves Notification Service's session.
 void onMessage(java.util.Hashtable evt)
          Method triggered when a message arrives.
 void remove(java.lang.String user)
          Removes user from users Hashtable.
 void userJoined(java.lang.String userName)
          Method triggered when a user arrives.
 void userLeft(java.lang.String userName)
          Method triggered when a user leaves the place.
 void usersChanged(java.lang.String usrs)
          Method triggered when hung users have been detected
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AvatarControl

public AvatarControl(ants.core.Place ch,
                     java.util.Hashtable env)
Method Detail

getUsers

public void getUsers()
Remotely gets all users connected at that time. This method is used for getting all users connected.
Sends an 'ask' remote event.
Parameters:
params - None
Returns:
No return value
Throws:
exceptions - No exceptions thrown

destroyPilotUser

public void destroyPilotUser()
Remotely remove ourselves from users Vector and from the VRML scene of other clients. Sends a 'delUser' remote event.
Parameters:
params - None
Returns:
No return value
Throws:
exceptions - No exceptions thrown

eventArrived

public void eventArrived(java.util.Hashtable evt)
Adds and removes avatars. This method is executed whenever an avatar remote event is received by the Elvin4 client.
Specified by:
eventArrived in interface ants.comm.RemoteEventListener
Parameters:
evt - Context
Returns:
No return value
Throws:
exceptions - No exceptions thrown

contains

public boolean contains(java.lang.String user)
Checks if user is in the users Hashtable.
Parameters:
user - User's name
Returns:
True if user matches
Throws:
exceptions - No exceptions thrown

remove

public void remove(java.lang.String user)
Removes user from users Hashtable.
Parameters:
user - User's name
Returns:
No return value
Throws:
exceptions - No exceptions thrown

leaveSession

public void leaveSession()
Leaves Notification Service's session.
Parameters:
params - None
Returns:
No return value
Throws:
exceptions - No exceptions thrown

getUser

public AvatarView getUser(java.lang.String usr)

onMessage

public void onMessage(java.util.Hashtable evt)
Description copied from interface: ants.core.PlaceListener
Method triggered when a message arrives.
Specified by:
onMessage in interface ants.core.PlaceListener
Following copied from interface: ants.core.PlaceListener
Parameters:
evt - Hashtable event containing the received event.

userJoined

public void userJoined(java.lang.String userName)
Description copied from interface: ants.core.PlaceListener
Method triggered when a user arrives.
Specified by:
userJoined in interface ants.core.PlaceListener
Following copied from interface: ants.core.PlaceListener
Parameters:
userName - New user`s name

userLeft

public void userLeft(java.lang.String userName)
Description copied from interface: ants.core.PlaceListener
Method triggered when a user leaves the place.
Specified by:
userLeft in interface ants.core.PlaceListener
Following copied from interface: ants.core.PlaceListener
Parameters:
userName - Name of leaving user.

usersChanged

public void usersChanged(java.lang.String usrs)
Description copied from interface: ants.core.PlaceListener
Method triggered when hung users have been detected
Specified by:
usersChanged in interface ants.core.PlaceListener
Following copied from interface: ants.core.PlaceListener
Parameters:
users - Current users in that place.


Developers: Oriol Montala, Carles Pairot, Francesc Pinas2000 - 2002
Departament d'Enginyeria Informatica i Matematiques
Escola Tecnica Superior d'Enginyeria
Universitat Rovira i Virgili