All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class calypso.clients.remotecontrol.RemoteControl

java.lang.Object
   |
   +----calypso.clients.remotecontrol.RemoteControl

public class RemoteControl
extends Object
implements Runnable
The RemoteControl class part of a beans model. The remote reads commands that are received via socket from a C++ application that encrypts the ir-codes. The RemoteControl notifies events to the current listeners.

Author:
Kim Lahti, Olli-Pekka Auvinen / TCM laboratory / HUT

Variable Index

 o host
The host of which port is to be listened.
 o listeners
Vector object keeping a list of remote control listeners.
 o OFF
Remote control state OFF identifier.
 o port
The port number which is to be listened.
 o state
Remote control state variable.
 o TV
Remote control state TV identifier.
 o VCR
Remote control state VCR identifier.

Constructor Index

 o RemoteControl(String, int)
The constructor for RemoteControl.

Method Index

 o addRemoteControlListener(RemoteControlListener)
Method to add listeners.
 o getHost()
Method to get the host of the connection.
 o getPort()
Method to get the port of the connection.
 o getState()
Method to get the current state.
 o notifyRemoteControlKeyDown(String)
Method that notifies the event to all listeners.
 o notifyRemoteControlState(int)
Method that notifies the event to all listeners.
 o removeRemoteControlListener(RemoteControlListener)
Method to remove listeners.
 o run()
Run method that gets commands and notifies to current listeners.

Variables

 o listeners
 protected Vector listeners
Vector object keeping a list of remote control listeners.

 o host
 protected String host
The host of which port is to be listened.

 o port
 protected int port
The port number which is to be listened.

 o state
 protected int state
Remote control state variable.

 o OFF
 public static final int OFF
Remote control state OFF identifier.

 o TV
 public static final int TV
Remote control state TV identifier.

 o VCR
 public static final int VCR
Remote control state VCR identifier.

Constructors

 o RemoteControl
 public RemoteControl(String host_,
                      int port_)
The constructor for RemoteControl.

Parameters:
host_ - The host of which port is listened.
port_ - The TCP port that is listened.

Methods

 o getPort
 public int getPort()
Method to get the port of the connection.

Returns:
The port of the connection.
 o getHost
 public String getHost()
Method to get the host of the connection.

Returns:
The host of the connection.
 o getState
 public int getState()
Method to get the current state.

Returns:
The current state.
 o run
 public void run()
Run method that gets commands and notifies to current listeners.

 o addRemoteControlListener
 public synchronized void addRemoteControlListener(RemoteControlListener kdl_)
Method to add listeners.

Parameters:
kdl_ - A new RemoteControlListener to be added.
 o removeRemoteControlListener
 public synchronized void removeRemoteControlListener(RemoteControlListener kdl_)
Method to remove listeners.

Parameters:
kdl_ - A RemoteControlListener to be removed.
 o notifyRemoteControlKeyDown
 protected void notifyRemoteControlKeyDown(String command_)
Method that notifies the event to all listeners.

Parameters:
command_ - A command that is notified in keydown event.
 o notifyRemoteControlState
 protected void notifyRemoteControlState(int state_)
Method that notifies the event to all listeners.

Parameters:
state_ - The state that is used in state event.

All Packages  Class Hierarchy  This Package  Previous  Next  Index