Class como.commlet.WindowCommlet
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class como.commlet.WindowCommlet

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Container
                   |
                   +----java.awt.Window
                           |
                           +----java.awt.Frame
                                   |
                                   +----como.commlet.WindowCommlet

public class WindowCommlet
extends Frame
implements Commlet
Any Commlets that might be used within other commlets should be derived from WindowCommlet. This is a Frame that implements Commlet. Also, it can be put into a MetaCommlet.

Variable Index

 o com

Constructor Index

 o WindowCommlet()

Method Index

 o addUser(int)
If a user comes, this method will be called.
 o getCommletInfo()
 o getCommletName()
 o getSessionName()
 o getTopicTextField()
Returns a TextField where the user may type in the topic.
 o handleEvent(Event)
If you close the window, it will call automatically hide() or dispose the commlet (depending if you are in a metacommlet or not).
 o handleMsg(Msg)
This is a default handleMsg() that calles the helper-methods userLeft() and addUser().
 o hideCommlet()
This also takes care of a the menu bar of its MetaCommlet, if it exists.
 o init()
 o isUserAdmitted(User)
Override this for new behaviour!
 o setCom(ComObj)
 o setMetaCommlet(MetaCommlet)
 o showCommlet()
Shows the commlet.
 o stop()
This destroys the local Commlet session.
 o userLeft(int)
If a user leaves, this method will be called.

Variables

 o com
  protected ComObj com

Constructors

 o WindowCommlet
  public WindowCommlet()

Methods

 o getSessionName
  public String getSessionName()
 o getCommletName
  public String getCommletName()
 o getCommletInfo
  public String getCommletInfo()
 o getTopicTextField
  protected TextField getTopicTextField()
Returns a TextField where the user may type in the topic. If an action occurs within it, the text is taken over as a new topic and sent to the other commlet sessions, which then upate the contents of their topic TextField.
 o hideCommlet
  public void hideCommlet()
This also takes care of a the menu bar of its MetaCommlet, if it exists. If it's not a metacommlet calls stop(). Else it only hides the frame.
 o showCommlet
  public void showCommlet()
Shows the commlet. This also takes care of a the menu bar of its MetaCommlet, if it exists.
 o setMetaCommlet
  public void setMetaCommlet(MetaCommlet m)
 o setCom
  public void setCom(ComObj c)
 o init
  public void init()
 o stop
  public void stop()
This destroys the local Commlet session. Automatically called. If you ovveride this, then you have to call super.stop() at the end of your method!
 o isUserAdmitted
  public boolean isUserAdmitted(User u)
Override this for new behaviour!
 o userLeft
  public void userLeft(int who)
If a user leaves, this method will be called.
Parameters:
who - the id of the user.
 o addUser
  public void addUser(int who)
If a user comes, this method will be called.
Parameters:
who - the id of the user.
 o handleMsg
  public boolean handleMsg(Msg msg)
This is a default handleMsg() that calles the helper-methods userLeft() and addUser(). And it takes care of the NEW_TOPIC-message. At the moment you can be sure, that this method is not called more than once at a time. But in future this might change! If you need this behaviour then make it synchronized!
 o handleEvent
  public boolean handleEvent(Event evt)
If you close the window, it will call automatically hide() or dispose the commlet (depending if you are in a metacommlet or not). It also sets the topic (and send a NEW_TOPIC message), if the topic is changed in the topic-TextField.
Overrides:
handleEvent in class Component

All Packages  Class Hierarchy  This Package  Previous  Next  Index