com.phidgets
Class DictionaryKeyListener

java.lang.Object
  extended bycom.phidgets.DictionaryKeyListener

public class DictionaryKeyListener
extends java.lang.Object

This class represents a key listener.

This key listener is used, along with the Dictionary object, to set up listener for specific keys, or groups of keys. Events are available for key add or change, and for key removal.


Field Summary
 long listenerhandle
           
 
Constructor Summary
DictionaryKeyListener(Dictionary dict, java.lang.String pattern)
          Creates a new key listener, for a specific pattern, on a specific dictionary object.
 
Method Summary
 void addKeyChangeListener(KeyChangeListener l)
          Add a new listener for key change events.
 void addKeyRemovalListener(KeyRemovalListener l)
          Add a new listener for key removal events.
 Dictionary getDictionary()
          Returns the Dictionary object that this listener is listening on.
 void removeKeyChangeListener(KeyChangeListener l)
          Removes a key change listener.
 void removeKeyRemovalListener(KeyRemovalListener l)
          removes a key removal listener.
 void start()
          Start this key listener.
 void stop()
          Stop this key listener.
 java.lang.String toString()
          Return a Sring describing this dictionary key listener.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

listenerhandle

public long listenerhandle
Constructor Detail

DictionaryKeyListener

public DictionaryKeyListener(Dictionary dict,
                             java.lang.String pattern)
Creates a new key listener, for a specific pattern, on a specific dictionary object. The pattern is a regular expression.

Method Detail

start

public void start()
           throws PhidgetException
Start this key listener. This method should not be called until the coresponding dictionary is connected.

Throws:
PhidgetException

stop

public void stop()
Stop this key listener.


getDictionary

public Dictionary getDictionary()
Returns the Dictionary object that this listener is listening on.


addKeyChangeListener

public final void addKeyChangeListener(KeyChangeListener l)
Add a new listener for key change events. This also applies for key add events..


removeKeyChangeListener

public final void removeKeyChangeListener(KeyChangeListener l)
Removes a key change listener.


addKeyRemovalListener

public final void addKeyRemovalListener(KeyRemovalListener l)
Add a new listener for key removal events.


removeKeyRemovalListener

public final void removeKeyRemovalListener(KeyRemovalListener l)
removes a key removal listener.


toString

public java.lang.String toString()
Return a Sring describing this dictionary key listener.