Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.tuneology.irremote
Class LircComponent  view LircComponent download LircComponent.java

java.lang.Object
  extended bycom.tuneology.irremote.LircComponent
All Implemented Interfaces:
IRComponent

public class LircComponent
extends java.lang.Object
implements IRComponent

A high-level interface to Linux Infrared Remote Control. The application instantiates a LircComponent object and registers listeners with it.


Field Summary
private  java.util.HashMap actionMap
           
private  java.util.Vector allEventListeners
           
private  LircClient client
           
private  java.util.HashMap cmdMap
           
private  java.lang.Thread lircThread
           
private  java.util.Vector listeners
           
 
Fields inherited from interface com.tuneology.irremote.IRComponent
IR_BINDING, IR_COMMAND
 
Constructor Summary
LircComponent(java.lang.String arg)
          Create a component that listens for IR events and dispatches actions.
 
Method Summary
 void addActionListener(javax.swing.AbstractAction listener)
          Add a callback for an IR command.
 boolean contains(javax.swing.AbstractAction listener)
          Returns true if the listener is registered.
 java.util.Vector getAllEventListeners()
           
 java.lang.String[] getCommands()
          Returns an array of all the possible IR commands.
 java.lang.String getConfigPath()
           
 java.lang.String getIrwCmd()
           
 javax.swing.AbstractAction getListener(java.lang.String action)
          Returns the listener registered to receive the specified action.
 java.util.Vector getListeners()
          Returns a vector of all event listeners.
private  void init()
           
private  void notifyActionListeners(java.lang.String evt)
           
 void removeActionListener(javax.swing.AbstractAction listener)
           
private  void scanEvents()
           
 void setConfigPath(java.lang.String p)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

lircThread

private java.lang.Thread lircThread

client

private LircClient client

cmdMap

private java.util.HashMap cmdMap

actionMap

private java.util.HashMap actionMap

listeners

private java.util.Vector listeners

allEventListeners

private java.util.Vector allEventListeners
Constructor Detail

LircComponent

public LircComponent(java.lang.String arg)
              throws java.io.IOException
Create a component that listens for IR events and dispatches actions.

Method Detail

addActionListener

public void addActionListener(javax.swing.AbstractAction listener)
Add a callback for an IR command. The command corresponding to the action is stored in the IR_BINDING value of the listener.

Specified by:
addActionListener in interface IRComponent

removeActionListener

public void removeActionListener(javax.swing.AbstractAction listener)
Specified by:
removeActionListener in interface IRComponent

getListener

public javax.swing.AbstractAction getListener(java.lang.String action)
Description copied from interface: IRComponent
Returns the listener registered to receive the specified action.

Specified by:
getListener in interface IRComponent

getListeners

public java.util.Vector getListeners()
Description copied from interface: IRComponent
Returns a vector of all event listeners.

Specified by:
getListeners in interface IRComponent

getAllEventListeners

public java.util.Vector getAllEventListeners()

getCommands

public java.lang.String[] getCommands()
Description copied from interface: IRComponent
Returns an array of all the possible IR commands.

Specified by:
getCommands in interface IRComponent

contains

public boolean contains(javax.swing.AbstractAction listener)
Description copied from interface: IRComponent
Returns true if the listener is registered.

Specified by:
contains in interface IRComponent

getIrwCmd

public java.lang.String getIrwCmd()

getConfigPath

public java.lang.String getConfigPath()

setConfigPath

public void setConfigPath(java.lang.String p)

scanEvents

private void scanEvents()
                 throws java.io.IOException

init

private void init()

notifyActionListeners

private void notifyActionListeners(java.lang.String evt)