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
-
host
- The host of which port is to be listened.
-
listeners
- Vector object keeping a list of remote control listeners.
-
OFF
- Remote control state OFF identifier.
-
port
- The port number which is to be listened.
-
state
- Remote control state variable.
-
TV
- Remote control state TV identifier.
-
VCR
- Remote control state VCR identifier.
-
RemoteControl(String, int)
- The constructor for RemoteControl.
-
addRemoteControlListener(RemoteControlListener)
- Method to add listeners.
-
getHost()
- Method to get the host of the connection.
-
getPort()
- Method to get the port of the connection.
-
getState()
- Method to get the current state.
-
notifyRemoteControlKeyDown(String)
- Method that notifies the event to all listeners.
-
notifyRemoteControlState(int)
- Method that notifies the event to all listeners.
-
removeRemoteControlListener(RemoteControlListener)
- Method to remove listeners.
-
run()
- Run method that gets commands and notifies to current listeners.
listeners
protected Vector listeners
- Vector object keeping a list of remote control listeners.
host
protected String host
- The host of which port is to be listened.
port
protected int port
- The port number which is to be listened.
state
protected int state
- Remote control state variable.
OFF
public static final int OFF
- Remote control state OFF identifier.
TV
public static final int TV
- Remote control state TV identifier.
VCR
public static final int VCR
- Remote control state VCR identifier.
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.
getPort
public int getPort()
- Method to get the port of the connection.
- Returns:
- The port of the connection.
getHost
public String getHost()
- Method to get the host of the connection.
- Returns:
- The host of the connection.
getState
public int getState()
- Method to get the current state.
- Returns:
- The current state.
run
public void run()
- Run method that gets commands and notifies to current listeners.
addRemoteControlListener
public synchronized void addRemoteControlListener(RemoteControlListener kdl_)
- Method to add listeners.
- Parameters:
- kdl_ - A new RemoteControlListener to be added.
removeRemoteControlListener
public synchronized void removeRemoteControlListener(RemoteControlListener kdl_)
- Method to remove listeners.
- Parameters:
- kdl_ - A RemoteControlListener to be removed.
notifyRemoteControlKeyDown
protected void notifyRemoteControlKeyDown(String command_)
- Method that notifies the event to all listeners.
- Parameters:
- command_ - A command that is notified in keydown event.
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