All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class webwisdom.tango.TAgentJS

java.lang.Object
   |
   +----webwisdom.tango.TAgent
           |
           +----webwisdom.tango.TAgentJS

public final class TAgentJS
extends TAgent
implements TDataListener, TControlListener
Tango system proxy to be used in JavaScript applications.
Only methods ending with "JS" are designed to be called from scripts. The functionality corresponds to the one of TAgent.

See Also:
TAgent

Method Index

 o addTControlListenerJS(JSObject)
Adds a recipient of the Tango system notifications.
 o addTDataListenerJS(JSObject)
Adds a recipient of the session data.
 o audioRequested(boolean)
 o createTAgentFakeJS(JSObject, String, Number)
Registers application and creates handle on a fake Tango agent.
 o createTAgentJS(JSObject)
Registers application and creates handle on a Tango agent.
 o exitJS()
Deregisters this application.
 o getMasterNameJS()
 o getParticipantNamesJS()
 o getUserNameJS()
 o isAudioAvailableJS()
 o isMasterJS()
 o masterChanged(boolean, String)
 o participantJoined(String)
 o participantLeft(String)
 o receive(byte[])
 o removeTControlListenerJS(JSObject)
Stops receiving control data by the given script/window.
 o removeTDataListenerJS(JSObject)
Stops receiving private data by the given script/window.
 o selectiveSendJS(JSObject, String)
Sends string messages to selected users.
 o sendJS(String)
Sends string messages.
 o setDbgModeJS(Boolean)
Sets or unsets debug mode.
 o toString()

Methods

 o setDbgModeJS
 public void setDbgModeJS(Boolean debug)
Sets or unsets debug mode. If TAgentJS operates in debug mode then every time JavaScript interface functions are used it prints to System.out the name of the method called and the arguments passed. Arguments are printed in the Java, not JavaScript form.

Parameters:
debug - whether TAgentJS should operate in debug mode
 o exitJS
 public void exitJS()
Deregisters this application.

 o addTDataListenerJS
 public void addTDataListenerJS(JSObject l)
Adds a recipient of the session data.

Parameters:
l - script/window receiving application messages. The given window must implement Tango_receive() method.
See Also:
sendJS
 o removeTDataListenerJS
 public void removeTDataListenerJS(JSObject l)
Stops receiving private data by the given script/window. This function reverses the effect of addTDataListener() with the same argument. A listener can be removed and added as often as necessary.

Parameters:
l - listener script/window
See Also:
addTDataListenerJS
 o addTControlListenerJS
 public void addTControlListenerJS(JSObject l)
Adds a recipient of the Tango system notifications.

Parameters:
l - listener script/window - this script has to implement the control listener interface:
  • Tango_masterChanged(isMaster,masterName);
  • Tango_participantJoined(participantName);
  • Tango_participantLeft(participantName);
  • Tango_audioRequested(isAudioRequested);
 o removeTControlListenerJS
 public void removeTControlListenerJS(JSObject l)
Stops receiving control data by the given script/window. This function reverses the effect of addTControlListener() with the same argument. A listener can be removed and added as often as necessary.

Parameters:
l - listener script/window
See Also:
addTControlListenerJS
 o sendJS
 public void sendJS(String data)
Sends string messages.

Parameters:
data - string to be sent
 o selectiveSendJS
 public void selectiveSendJS(JSObject part,
                             String data)
Sends string messages to selected users.

Parameters:
data - string to be sent
part - participants which are to receive the message
See Also:
getParticipantNamesJS
 o receive
 public void receive(byte data[])
 o masterChanged
 public void masterChanged(boolean isMaster,
                           String masterName)
 o participantJoined
 public void participantJoined(String name)
 o participantLeft
 public void participantLeft(String name)
 o audioRequested
 public void audioRequested(boolean r)
 o getUserNameJS
 public JSObject getUserNameJS()
Returns:
String - this user name (as logged to the system)
 o getParticipantNamesJS
 public JSObject getParticipantNamesJS()
Returns:
Array object - array of Strings representing names of the users of this session
 o getMasterNameJS
 public JSObject getMasterNameJS()
Returns:
the name of the master of this session
 o isMasterJS
 public JSObject isMasterJS()
Returns:
Boolean object - true if this user is the master of this session
 o isAudioAvailableJS
 public JSObject isAudioAvailableJS()
Returns:
Boolean object - true if the audio resources can be used by this session
 o createTAgentJS
 public static TAgentJS createTAgentJS(JSObject scr)
Registers application and creates handle on a Tango agent.

Parameters:
scr - script/window to be registered - the top of this window will be closed upon the application termination
 o createTAgentFakeJS
 public static TAgentJS createTAgentFakeJS(JSObject scr,
                                           String host,
                                           Number port)
Registers application and creates handle on a fake Tango agent.

Parameters:
scr - script/window to be registered - the top of this window will be closed upon the application termination
host,port - fake server location
 o toString
 public String toString()
Overrides:
toString in class TAgent

All Packages  Class Hierarchy  This Package  Previous  Next  Index