org.havi.ui
Class HEventMulticaster

java.lang.Object
  extended byorg.havi.ui.HEventMulticaster
All Implemented Interfaces:
java.awt.event.ActionListener, java.util.EventListener, java.awt.event.FocusListener, HActionListener, HAdjustmentListener, HBackgroundImageListener, HFocusListener, HItemListener, HKeyListener, HScreenConfigurationListener, HScreenLocationModifiedListener, HTextListener, java.awt.event.KeyListener, ResourceStatusListener, java.awt.event.WindowListener

public class HEventMulticaster
extends java.lang.Object
implements HBackgroundImageListener, HScreenConfigurationListener, HScreenLocationModifiedListener, java.awt.event.WindowListener, HActionListener, HAdjustmentListener, HFocusListener, HItemListener, HTextListener, HKeyListener, ResourceStatusListener

The HEventMulticaster class is intended to assist platform or subclass implementers with the handling of HAVi events. Implementations are not required to use this class to dispatch HAVi events. Applications should not extend the HEventMulticaster class and implementations are not required to behave correctly if an application does extend this class. If an extended multicaster is desired, AWTEventMulticaster should be used rather than HEventMulticaster

The HEventMulticaster class is intended to handle event dispatching for the following HAVi events:

It is an implementation option for this class to insert other classes in the inheritance tree (for example java.awt.AWTEventMulticaster). It is allowed that this may result in HEventMulticaster inheriting additional methods beyond those specified here. If this class does extend java.awt.AWTEventMulticaster, it is allowed for the fields defined in this class to be inherited from that parent class.

Note: the org.davic.resources.ResourceStatusListener specification does not require EventListener to be present. In a HAVi UI implementation, ResourceStatusListener shall extend EventListener.


The parameters to the constructors are as follows, in cases where parameters are not used, then the constructor should use the default values.

Default parameter values exposed in the constructors

ParameterDescriptionDefault value Set methodGet method
None.

Default parameter values not exposed in the constructors

DescriptionDefault valueSet method Get method
None.

See Also:
HBackgroundImageListener, HScreenConfigurationListener, HScreenLocationModifiedListener, HActionListener, HAdjustmentListener, HFocusListener, HItemListener, HTextListener, HKeyListener, WindowListener, ResourceStatusListener

Field Summary
protected  java.util.EventListener a
           
protected  java.util.EventListener b
           
 
Constructor Summary
protected HEventMulticaster(java.util.EventListener a, java.util.EventListener b)
          Creates an event multicaster instance which chains listener-a with listener-b.
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
          Handles the ActionEvent by invoking the actionPerformed methods on listener-a and listener-b.
static HActionListener add(HActionListener a, HActionListener b)
          Adds HActionListener-a with HActionListener-b and returns the resulting multicast listener.
static HAdjustmentListener add(HAdjustmentListener a, HAdjustmentListener b)
          Adds HAdjustmentListener-a with HAdjustmentListener-b and returns the resulting multicast listener.
static HBackgroundImageListener add(HBackgroundImageListener a, HBackgroundImageListener b)
          Adds HBackgroundImageListener-a with HBackgroundImageListener-b and returns the resulting multicast listener.
static HFocusListener add(HFocusListener a, HFocusListener b)
          Adds HFocusListener-a with HFocusListener-b and returns the resulting multicast listener.
static HItemListener add(HItemListener a, HItemListener b)
          Adds HItemListener-a with HItemListener-b and returns the resulting multicast listener.
static HKeyListener add(HKeyListener a, HKeyListener b)
          Adds HKeyListener-a with HKeyListener-b and returns the resulting multicast listener.
static HScreenConfigurationListener add(HScreenConfigurationListener a, HScreenConfigurationListener b)
          Adds HScreenConfigurationListener-a with HScreenConfigurationListener-b and returns the resulting multicast listener.
static HScreenConfigurationListener add(HScreenConfigurationListener a, HScreenConfigurationListener b, HScreenConfigTemplate tb)
          Adds HScreenConfigurationListener-a with HScreenConfigurationListener-b, which is notified when the HScreenDevice's configuration is modified so that it is no longer compatible with the HScreenConfigTemplate tb.
static HScreenLocationModifiedListener add(HScreenLocationModifiedListener a, HScreenLocationModifiedListener b)
          Adds HScreenLocationModifiedListener-a with HScreenLocationModifiedListener-b and returns the resulting multicast listener.
static HTextListener add(HTextListener a, HTextListener b)
          Adds HTextListener-a with HTextListener-b and returns the resulting multicast listener.
static ResourceStatusListener add(ResourceStatusListener a, ResourceStatusListener b)
          Adds ResourceStatusListener-a with listener-b and returns the resulting multicast listener.
static java.awt.event.WindowListener add(java.awt.event.WindowListener a, java.awt.event.WindowListener b)
          Adds WindowListener-a with WindowListener-b and returns the resulting multicast listener.
protected static java.util.EventListener addInternal(java.util.EventListener a, java.util.EventListener b)
          Returns the resulting multicast listener from adding listener-a and listener-b together.
 void caretMoved(HTextEvent e)
          Handles the HTextEvent by invoking the caretMoved methods on listener-a and listener-b.
 void currentItemChanged(HItemEvent e)
          Handles the HItemEvent by invoking the currentItemChanged methods on listener-a and listener-b.
 void focusGained(java.awt.event.FocusEvent e)
          Handles the FocusEvent by invoking the focusGained methods on listener-a and listener-b.
 void focusLost(java.awt.event.FocusEvent e)
          Handles the FocusEvent by invoking the focusLost methods on listener-a and listener-b.
 void imageLoaded(HBackgroundImageEvent e)
          Handles the HBackgroundImageEvent by invoking the imageLoaded methods on listener-a and listener-b.
 void imageLoadFailed(HBackgroundImageEvent e)
          Handles the HBackgroundImageEvent by invoking the imageLoadFailed methods on listener-a and listener-b.
 void keyPressed(java.awt.event.KeyEvent e)
          Handles the HKeyEvent by invoking the keyPressed methods on listener-a and listener-b.
 void keyReleased(java.awt.event.KeyEvent e)
          Handles the HKeyEvent by invoking the keyReleased methods on listener-a and listener-b.
 void keyTyped(java.awt.event.KeyEvent e)
          Handles the HKeyEvent by invoking the keyTyped methods on listener-a and listener-b.
protected  java.util.EventListener remove(java.util.EventListener oldl)
          Removes a listener from this multicaster and returns the result.
static HActionListener remove(HActionListener l, HActionListener oldl)
          Removes the old HActionListener from HActionListener-l and returns the resulting multicast listener.
static HAdjustmentListener remove(HAdjustmentListener l, HAdjustmentListener oldl)
          Removes the old HAdjustmentListener from HAdjustmentListener-l and returns the resulting multicast listener.
static HBackgroundImageListener remove(HBackgroundImageListener l, HBackgroundImageListener oldl)
          Removes the old HBackgroundImageListener from HBackgroundImageListener-l and returns the resulting multicast listener.
static HFocusListener remove(HFocusListener l, HFocusListener oldl)
          Removes the old HFocusListener from HFocusListener-l and returns the resulting multicast listener.
static HItemListener remove(HItemListener l, HItemListener oldl)
          Removes the old HItemListener from HItemListener-l and returns the resulting multicast listener.
static HKeyListener remove(HKeyListener l, HKeyListener oldl)
          Removes the old HKeyListener from HKeyListener-l and returns the resulting multicast listener.
static HScreenConfigurationListener remove(HScreenConfigurationListener l, HScreenConfigurationListener oldl)
          Removes the old HScreenConfigurationListener from HScreenConfigurationListener-l and returns the resulting multicast listener.
static HScreenLocationModifiedListener remove(HScreenLocationModifiedListener l, HScreenLocationModifiedListener oldl)
          Removes the old HScreenLocationModifiedListener from HScreenLocationModifiedListener-l and returns the resulting multicast listener.
static HTextListener remove(HTextListener l, HTextListener oldl)
          Removes the old HTextListener from HTextListener-l and returns the resulting multicast listener.
static ResourceStatusListener remove(ResourceStatusListener l, ResourceStatusListener oldl)
          Removes the old ResourceStatusListener from ResourceStatusListener-l and returns the resulting multicast listener.
static java.awt.event.WindowListener remove(java.awt.event.WindowListener l, java.awt.event.WindowListener oldl)
          Removes the old WindowListener from WindowListener-l and returns the resulting multicast listener.
protected static java.util.EventListener removeInternal(java.util.EventListener l, java.util.EventListener oldl)
          Returns the resulting multicast listener after removing the old listener from listener-l.
 void report(HScreenConfigurationEvent e)
          Handles the HScreenConfigurationEvent by invoking the report methods on listener-a and listener-b.
 void report(HScreenLocationModifiedEvent e)
          Handles the HScreenLocationModifiedEvent by invoking the report methods on listener-a and listener-b.
 void selectionChanged(HItemEvent e)
          Handles the HItemEvent by invoking the selectionChanged methods on listener-a and listener-b.
 void statusChanged(ResourceStatusEvent e)
          Handles the ResourceStatusEvent by invoking the statusChanged methods on listener-a and listener-b.
 void textChanged(HTextEvent e)
          Handles the HTextEvent by invoking the textChanged methods on listener-a and listener-b.
 void valueChanged(HAdjustmentEvent e)
          Handles the HAdjustmentEvent by invoking the valueChanged methods on listener-a and listener-b.
 void windowActivated(java.awt.event.WindowEvent e)
          Handles the windowActivated event by invoking the windowActivated methods on listener-a and listener-b.
 void windowClosed(java.awt.event.WindowEvent e)
          Handles the windowClosed event by invoking the windowClosed methods on listener-a and listener-b.
 void windowClosing(java.awt.event.WindowEvent e)
          Handles the windowClosing event by invoking the windowClosing methods on listener-a and listener-b.
 void windowDeactivated(java.awt.event.WindowEvent e)
          Handles the windowDeactivated event by invoking the windowDeactivated methods on listener-a and listener-b.
 void windowDeiconified(java.awt.event.WindowEvent e)
          Handles the windowDeiconified event by invoking the windowDeiconified methods on listener-a and listener-b.
 void windowIconified(java.awt.event.WindowEvent e)
          Handles the windowIconified event by invoking the windowIconified methods on listener-a and listener-b.
 void windowOpened(java.awt.event.WindowEvent e)
          Handles the windowOpened event by invoking the windowOpened methods on listener-a and listener-b.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

a

protected final java.util.EventListener a

b

protected final java.util.EventListener b
Constructor Detail

HEventMulticaster

protected HEventMulticaster(java.util.EventListener a,
                            java.util.EventListener b)
Creates an event multicaster instance which chains listener-a with listener-b. The parameters a and b passed to the constructor shall be used to populate the fields a and b of the instance.

Parameters:
a - listener-a
b - listener-b
Method Detail

remove

protected java.util.EventListener remove(java.util.EventListener oldl)
Removes a listener from this multicaster and returns the result.

Parameters:
oldl - the listener to be removed

addInternal

protected static java.util.EventListener addInternal(java.util.EventListener a,
                                                     java.util.EventListener b)
Returns the resulting multicast listener from adding listener-a and listener-b together. If listener-a is null, it returns listener-b; If listener-b is null, it returns listener-a If neither are null, then it creates and returns a new HEventMulticaster instance which chains a with b.

Parameters:
a - event listener-a
b - event listener-b

removeInternal

protected static java.util.EventListener removeInternal(java.util.EventListener l,
                                                        java.util.EventListener oldl)
Returns the resulting multicast listener after removing the old listener from listener-l. If listener-l equals the old listener OR listener-l is null, returns null. Else if listener-l is an instance of HEventMulticaster, then it removes the old listener from it. Else, returns listener l.

Parameters:
l - the listener being removed from
oldl - the listener being removed

add

public static HBackgroundImageListener add(HBackgroundImageListener a,
                                           HBackgroundImageListener b)
Adds HBackgroundImageListener-a with HBackgroundImageListener-b and returns the resulting multicast listener.

Parameters:
a - HBackgroundImageListener-a
b - HBackgroundImageListener-b

remove

public static HBackgroundImageListener remove(HBackgroundImageListener l,
                                              HBackgroundImageListener oldl)
Removes the old HBackgroundImageListener from HBackgroundImageListener-l and returns the resulting multicast listener.

Parameters:
l - HBackgroundImageListener-l
oldl - the HBackgroundImageListener being removed

add

public static java.awt.event.WindowListener add(java.awt.event.WindowListener a,
                                                java.awt.event.WindowListener b)
Adds WindowListener-a with WindowListener-b and returns the resulting multicast listener.

Parameters:
a - WindowListener-a
b - WindowListener-b

remove

public static java.awt.event.WindowListener remove(java.awt.event.WindowListener l,
                                                   java.awt.event.WindowListener oldl)
Removes the old WindowListener from WindowListener-l and returns the resulting multicast listener.

Parameters:
l - WindowListener-l
oldl - the WindowListener being removed

add

public static HScreenConfigurationListener add(HScreenConfigurationListener a,
                                               HScreenConfigurationListener b)
Adds HScreenConfigurationListener-a with HScreenConfigurationListener-b and returns the resulting multicast listener.

Parameters:
a - HScreenConfigurationListener-a
b - HScreenConfigurationListener-b

add

public static HScreenConfigurationListener add(HScreenConfigurationListener a,
                                               HScreenConfigurationListener b,
                                               HScreenConfigTemplate tb)
Adds HScreenConfigurationListener-a with HScreenConfigurationListener-b, which is notified when the HScreenDevice's configuration is modified so that it is no longer compatible with the HScreenConfigTemplate tb. It returns the resulting multicast listener.

Parameters:
a - HScreenConfigurationListener-a
b - HScreenConfigurationListener-b
tb - HScreenConfigTemplate associated with HScreenConfigurationListener-b

remove

public static HScreenConfigurationListener remove(HScreenConfigurationListener l,
                                                  HScreenConfigurationListener oldl)
Removes the old HScreenConfigurationListener from HScreenConfigurationListener-l and returns the resulting multicast listener.

Parameters:
l - HScreenConfigurationListener-l
oldl - the HScreenConfigurationListener being removed

add

public static HScreenLocationModifiedListener add(HScreenLocationModifiedListener a,
                                                  HScreenLocationModifiedListener b)
Adds HScreenLocationModifiedListener-a with HScreenLocationModifiedListener-b and returns the resulting multicast listener.

Parameters:
a - HScreenLocationModifiedListener-a
b - HScreenLocationModifiedListener-b

remove

public static HScreenLocationModifiedListener remove(HScreenLocationModifiedListener l,
                                                     HScreenLocationModifiedListener oldl)
Removes the old HScreenLocationModifiedListener from HScreenLocationModifiedListener-l and returns the resulting multicast listener.

Parameters:
l - HScreenLocationModifiedListener-l
oldl - the HScreenLocationModifiedListener being removed

imageLoaded

public void imageLoaded(HBackgroundImageEvent e)
Handles the HBackgroundImageEvent by invoking the imageLoaded methods on listener-a and listener-b.

Specified by:
imageLoaded in interface HBackgroundImageListener
Parameters:
e - the HBackgroundImageEvent event

imageLoadFailed

public void imageLoadFailed(HBackgroundImageEvent e)
Handles the HBackgroundImageEvent by invoking the imageLoadFailed methods on listener-a and listener-b.

Specified by:
imageLoadFailed in interface HBackgroundImageListener
Parameters:
e - the HBackgroundImageEvent event

report

public void report(HScreenConfigurationEvent e)
Handles the HScreenConfigurationEvent by invoking the report methods on listener-a and listener-b.

Specified by:
report in interface HScreenConfigurationListener
Parameters:
e - the HScreenConfigurationEvent event

report

public void report(HScreenLocationModifiedEvent e)
Handles the HScreenLocationModifiedEvent by invoking the report methods on listener-a and listener-b.

Specified by:
report in interface HScreenLocationModifiedListener
Parameters:
e - the HScreenLocationModifiedEvent event

windowOpened

public void windowOpened(java.awt.event.WindowEvent e)
Handles the windowOpened event by invoking the windowOpened methods on listener-a and listener-b.

Specified by:
windowOpened in interface java.awt.event.WindowListener
Parameters:
e - the window event

windowClosing

public void windowClosing(java.awt.event.WindowEvent e)
Handles the windowClosing event by invoking the windowClosing methods on listener-a and listener-b.

Specified by:
windowClosing in interface java.awt.event.WindowListener
Parameters:
e - the window event

windowClosed

public void windowClosed(java.awt.event.WindowEvent e)
Handles the windowClosed event by invoking the windowClosed methods on listener-a and listener-b.

Specified by:
windowClosed in interface java.awt.event.WindowListener
Parameters:
e - the window event

windowIconified

public void windowIconified(java.awt.event.WindowEvent e)
Handles the windowIconified event by invoking the windowIconified methods on listener-a and listener-b.

Specified by:
windowIconified in interface java.awt.event.WindowListener
Parameters:
e - the window event

windowDeiconified

public void windowDeiconified(java.awt.event.WindowEvent e)
Handles the windowDeiconified event by invoking the windowDeiconified methods on listener-a and listener-b.

Specified by:
windowDeiconified in interface java.awt.event.WindowListener
Parameters:
e - the window event

windowActivated

public void windowActivated(java.awt.event.WindowEvent e)
Handles the windowActivated event by invoking the windowActivated methods on listener-a and listener-b.

Specified by:
windowActivated in interface java.awt.event.WindowListener
Parameters:
e - the window event

windowDeactivated

public void windowDeactivated(java.awt.event.WindowEvent e)
Handles the windowDeactivated event by invoking the windowDeactivated methods on listener-a and listener-b.

Specified by:
windowDeactivated in interface java.awt.event.WindowListener
Parameters:
e - the window event

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
Handles the ActionEvent by invoking the actionPerformed methods on listener-a and listener-b.

Specified by:
actionPerformed in interface java.awt.event.ActionListener
Parameters:
e - the ActionEvent event

focusLost

public void focusLost(java.awt.event.FocusEvent e)
Handles the FocusEvent by invoking the focusLost methods on listener-a and listener-b.

Specified by:
focusLost in interface java.awt.event.FocusListener
Parameters:
e - the FocusEvent event

focusGained

public void focusGained(java.awt.event.FocusEvent e)
Handles the FocusEvent by invoking the focusGained methods on listener-a and listener-b.

Specified by:
focusGained in interface java.awt.event.FocusListener
Parameters:
e - the FocusEvent event

valueChanged

public void valueChanged(HAdjustmentEvent e)
Handles the HAdjustmentEvent by invoking the valueChanged methods on listener-a and listener-b.

Specified by:
valueChanged in interface HAdjustmentListener
Parameters:
e - the HAdjustmentEvent event

selectionChanged

public void selectionChanged(HItemEvent e)
Handles the HItemEvent by invoking the selectionChanged methods on listener-a and listener-b.

Specified by:
selectionChanged in interface HItemListener
Parameters:
e - the HItemEvent event

currentItemChanged

public void currentItemChanged(HItemEvent e)
Handles the HItemEvent by invoking the currentItemChanged methods on listener-a and listener-b.

Specified by:
currentItemChanged in interface HItemListener
Parameters:
e - the HItemEvent event

textChanged

public void textChanged(HTextEvent e)
Handles the HTextEvent by invoking the textChanged methods on listener-a and listener-b.

Specified by:
textChanged in interface HTextListener
Parameters:
e - the HTextEvent event

caretMoved

public void caretMoved(HTextEvent e)
Handles the HTextEvent by invoking the caretMoved methods on listener-a and listener-b.

Specified by:
caretMoved in interface HTextListener
Parameters:
e - the HTextEvent event

keyTyped

public void keyTyped(java.awt.event.KeyEvent e)
Handles the HKeyEvent by invoking the keyTyped methods on listener-a and listener-b.

Specified by:
keyTyped in interface java.awt.event.KeyListener
Parameters:
e - the HKeyEvent event

keyPressed

public void keyPressed(java.awt.event.KeyEvent e)
Handles the HKeyEvent by invoking the keyPressed methods on listener-a and listener-b.

Specified by:
keyPressed in interface java.awt.event.KeyListener
Parameters:
e - the HKeyEvent event

keyReleased

public void keyReleased(java.awt.event.KeyEvent e)
Handles the HKeyEvent by invoking the keyReleased methods on listener-a and listener-b.

Specified by:
keyReleased in interface java.awt.event.KeyListener
Parameters:
e - the HKeyEvent event

add

public static HTextListener add(HTextListener a,
                                HTextListener b)
Adds HTextListener-a with HTextListener-b and returns the resulting multicast listener.

Parameters:
a - HTextListener-a
b - HTextListener-b

remove

public static HTextListener remove(HTextListener l,
                                   HTextListener oldl)
Removes the old HTextListener from HTextListener-l and returns the resulting multicast listener.

Parameters:
l - HTextListener-l
oldl - the HTextListener being removed

add

public static HItemListener add(HItemListener a,
                                HItemListener b)
Adds HItemListener-a with HItemListener-b and returns the resulting multicast listener.

Parameters:
a - HItemListener-a
b - HItemListener-b

remove

public static HItemListener remove(HItemListener l,
                                   HItemListener oldl)
Removes the old HItemListener from HItemListener-l and returns the resulting multicast listener.

Parameters:
l - HItemListener-l
oldl - the HItemListener being removed

add

public static HFocusListener add(HFocusListener a,
                                 HFocusListener b)
Adds HFocusListener-a with HFocusListener-b and returns the resulting multicast listener.

Parameters:
a - HFocusListener-a
b - HFocusListener-b

remove

public static HFocusListener remove(HFocusListener l,
                                    HFocusListener oldl)
Removes the old HFocusListener from HFocusListener-l and returns the resulting multicast listener.

Parameters:
l - HFocusListener-l
oldl - the HFocusListener being removed

add

public static HAdjustmentListener add(HAdjustmentListener a,
                                      HAdjustmentListener b)
Adds HAdjustmentListener-a with HAdjustmentListener-b and returns the resulting multicast listener.

Parameters:
a - HAdjustmentListener-a
b - HAdjustmentListener-b

remove

public static HAdjustmentListener remove(HAdjustmentListener l,
                                         HAdjustmentListener oldl)
Removes the old HAdjustmentListener from HAdjustmentListener-l and returns the resulting multicast listener.

Parameters:
l - HAdjustmentListener-l
oldl - the HAdjustmentListener being removed

add

public static HActionListener add(HActionListener a,
                                  HActionListener b)
Adds HActionListener-a with HActionListener-b and returns the resulting multicast listener.

Parameters:
a - HActionListener-a
b - HActionListener-b

remove

public static HActionListener remove(HActionListener l,
                                     HActionListener oldl)
Removes the old HActionListener from HActionListener-l and returns the resulting multicast listener.

Parameters:
l - HActionListener-l
oldl - the HActionListener being removed

add

public static HKeyListener add(HKeyListener a,
                               HKeyListener b)
Adds HKeyListener-a with HKeyListener-b and returns the resulting multicast listener.

Parameters:
a - HKeyListener-a
b - HKeyListener-b

remove

public static HKeyListener remove(HKeyListener l,
                                  HKeyListener oldl)
Removes the old HKeyListener from HKeyListener-l and returns the resulting multicast listener.

Parameters:
l - HKeyListener-l
oldl - the HKeyListener being removed

statusChanged

public void statusChanged(ResourceStatusEvent e)
Handles the ResourceStatusEvent by invoking the statusChanged methods on listener-a and listener-b.

Specified by:
statusChanged in interface ResourceStatusListener
Parameters:
e - the ResourceStatusEvent event

add

public static ResourceStatusListener add(ResourceStatusListener a,
                                         ResourceStatusListener b)
Adds ResourceStatusListener-a with listener-b and returns the resulting multicast listener. In a HAVi UI implementation, ResourceStatusListener shall extend EventListener.

Parameters:
a - listener-a
b - listener-b

remove

public static ResourceStatusListener remove(ResourceStatusListener l,
                                            ResourceStatusListener oldl)
Removes the old ResourceStatusListener from ResourceStatusListener-l and returns the resulting multicast listener. In a HAVi UI implementation, ResourceStatusListener shall extend EventListener.

Parameters:
l - ResourceStatusListener-l
oldl - the ResourceStatusListener being removed