Jitsi: the OpenSource Java VoIP and Instant Messaging client.

net.java.sip.communicator.impl.gui.main.call
Class DTMFHandler

java.lang.Object
  extended by net.java.sip.communicator.impl.gui.main.call.DTMFHandler
All Implemented Interfaces:
KeyEventDispatcher

public class DTMFHandler
extends Object
implements KeyEventDispatcher

Handles DTMF sending and playing sound notifications for that.

Author:
Damian Minkov, Lyubomir Marinov

Nested Class Summary
static class DTMFHandler.DTMFToneInfo
          DTMF extended information.
 
Field Summary
static DTMFHandler.DTMFToneInfo[] AVAILABLE_TONES
          All available tones and its properties like images for buttons, and sounds to be played during send.
 
Constructor Summary
DTMFHandler()
          Creates DTMF handler for a call.
DTMFHandler(CallPanel callContainer)
          Creates DTMF handler for a call.
 
Method Summary
 void addParent(Window parent)
          Adds a Window on which key presses and releases are to be monitored for the purposes of this DTMFHandler.
 boolean dispatchKeyEvent(KeyEvent e)
          Dispatches a specific KeyEvent.
 void removeParent(Window parent)
          Removes a Window on which key presses and releases are to no longer be monitored for the purposes of this DTMFHandler.
 void startSendingDtmfTone(String toneValue)
          Sends a DTMF tone to the current DTMF operation set.
 void stopSendingDtmfTone()
          Stop sending DTMF tone.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

AVAILABLE_TONES

public static final DTMFHandler.DTMFToneInfo[] AVAILABLE_TONES
All available tones and its properties like images for buttons, and sounds to be played during send.

Constructor Detail

DTMFHandler

public DTMFHandler()
Creates DTMF handler for a call.


DTMFHandler

public DTMFHandler(CallPanel callContainer)
Creates DTMF handler for a call.

Parameters:
callContainer - the CallContainer where this handler is registered
Method Detail

addParent

public void addParent(Window parent)
Adds a Window on which key presses and releases are to be monitored for the purposes of this DTMFHandler.

Parameters:
parent - the Window on which key presses and releases are to be monitored for the purposes of this DTMFHandler

removeParent

public void removeParent(Window parent)
Removes a Window on which key presses and releases are to no longer be monitored for the purposes of this DTMFHandler.

Parameters:
parent - the Window on which key presses and releases are to no longer be monitored for the purposes of this DTMFHandler

dispatchKeyEvent

public boolean dispatchKeyEvent(KeyEvent e)
Dispatches a specific KeyEvent. If one of the parents registered with this DTMFHandler is focused, starts or stops sending a respective DTMF tone.

Specified by:
dispatchKeyEvent in interface KeyEventDispatcher
Parameters:
e - the KeyEvent to be dispatched
Returns:
true to stop dispatching the event or false to continue dispatching it. DTMFHandler always returns false

startSendingDtmfTone

public void startSendingDtmfTone(String toneValue)
Sends a DTMF tone to the current DTMF operation set.

Parameters:
toneValue - the value of the DTMF tone to send.

stopSendingDtmfTone

public void stopSendingDtmfTone()
Stop sending DTMF tone.


Jitsi: the OpenSource Java VoIP and Instant Messaging client.

Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under LGPL license.