Module java.desktop
Package java.awt

Class AWTEventMulticaster

java.lang.Object
java.awt.AWTEventMulticaster
所有已实现的接口:
ActionListener, AdjustmentListener, ComponentListener, ContainerListener, FocusListener, HierarchyBoundsListener, HierarchyListener, InputMethodListener, ItemListener, KeyListener, MouseListener, MouseMotionListener, MouseWheelListener, TextListener, WindowFocusListener, WindowListener, WindowStateListener, EventListener

AWTEventMulticaster 实现了对java.awt.event包中定义的AWT事件进行高效且线程安全的多播事件分发。

以下示例说明了如何使用这个类:


 public myComponent extends Component {
     ActionListener actionListener = null;

     public synchronized void addActionListener(ActionListener l) {
         actionListener = AWTEventMulticaster.add(actionListener, l);
     }
     public synchronized void removeActionListener(ActionListener l) {
         actionListener = AWTEventMulticaster.remove(actionListener, l);
     }
     public void processEvent(AWTEvent e) {
         // 当触发导致"动作"语义的事件时
         ActionListener listener = actionListener;
         if (listener != null) {
             listener.actionPerformed(new ActionEvent());
         }
     }
 }
 
需要注意的重要点是addremove方法的第一个参数是维护监听器的字段。此外,您必须将addremove方法的结果分配给维护监听器的字段。

AWTEventMulticaster被实现为一对在构造时设置的EventListenersAWTEventMulticaster是不可变的。 addremove方法不会以任何方式改变AWTEventMulticaster。如果需要,将创建一个新的AWTEventMulticaster。通过这种方式,在事件分发过程中添加和移除监听器是安全的。但是,在事件分发操作过程中添加的事件监听器不会被通知当前正在分发的事件。

所有的add方法都允许null参数。如果第一个参数是null,则返回第二个参数。如果第一个参数不是null且第二个参数是null,则返回第一个参数。如果两个参数都是non-null,则使用这两个参数创建一个新的AWTEventMulticaster并返回。

对于接受两个参数的remove方法,返回如下:

  • null,如果第一个参数是null,或者参数相等,通过==方式。
  • 如果第一个参数不是AWTEventMulticaster的实例,则返回第一个参数。
  • 调用第一个参数上的remove(EventListener),将第二个参数提供给remove(EventListener)方法的结果。

Swing使用EventListenerList进行类似逻辑。有关详细信息,请参考它。

自版本:
1.1
参见:
  • Field Details

    • a

      protected final EventListener a
      事件链中的一个变量(监听器a)。
    • b

      protected final EventListener b
      事件链中的一个变量(监听器b)。
  • Constructor Details

    • AWTEventMulticaster

      protected AWTEventMulticaster(EventListener a, EventListener b)
      创建一个事件多路广播器实例,将监听器a与监听器b链接起来。输入参数ab不应为null,尽管在这种情况下是否选择抛出NullPointerException的实现可能有所不同。
      参数:
      a - 监听器a
      b - 监听器b
  • Method Details

    • remove

      protected EventListener remove(EventListener oldl)
      从此多路广播器中移除一个监听器。

      返回的多路广播器包含此多路广播器中所有监听器,但不包括所有oldl的出现。如果结果的多路广播器只包含一个常规监听器,则可能返回该常规监听器。如果结果的多路广播器为空,则可能返回null

      如果oldlnull,则不会抛出异常。

      参数:
      oldl - 要移除的监听器
      返回:
      结果监听器
    • componentResized

      public void componentResized(ComponentEvent e)
      通过调用监听器a和监听器b的componentResized方法处理componentResized事件。
      指定者:
      componentResized 在接口 ComponentListener
      参数:
      e - 组件事件
    • componentMoved

      public void componentMoved(ComponentEvent e)
      通过调用监听器a和监听器b的componentMoved方法处理componentMoved事件。
      指定者:
      componentMoved 在接口 ComponentListener
      参数:
      e - 组件事件
    • componentShown

      public void componentShown(ComponentEvent e)
      通过调用监听器a和监听器b的componentShown方法处理componentShown事件。
      指定者:
      componentShown 在接口 ComponentListener
      参数:
      e - 组件事件
    • componentHidden

      public void componentHidden(ComponentEvent e)
      通过调用监听器a和监听器b的componentHidden方法处理componentHidden事件。
      指定者:
      componentHidden 在接口 ComponentListener
      参数:
      e - 组件事件
    • componentAdded

      public void componentAdded(ContainerEvent e)
      通过调用监听器a和监听器b的componentAdded方法处理componentAdded容器事件。
      指定者:
      componentAdded 在接口 ContainerListener
      参数:
      e - 组件事件
    • componentRemoved

      public void componentRemoved(ContainerEvent e)
      通过调用监听器a和监听器b的componentRemoved方法处理componentRemoved容器事件。
      指定者:
      componentRemoved 在接口 ContainerListener
      参数:
      e - 组件事件
    • focusGained

      public void focusGained(FocusEvent e)
      通过调用监听器a和监听器b的focusGained方法处理focusGained事件。
      指定者:
      focusGained 在接口 FocusListener
      参数:
      e - 焦点事件
    • focusLost

      public void focusLost(FocusEvent e)
      通过调用监听器a和监听器b的focusLost方法处理focusLost事件。
      指定者:
      focusLost 在接口 FocusListener
      参数:
      e - 焦点事件
    • keyTyped

      public void keyTyped(KeyEvent e)
      通过调用监听器a和监听器b的keyTyped方法处理keyTyped事件。
      指定者:
      keyTyped 在接口 KeyListener
      参数:
      e - 键盘事件
    • keyPressed

      public void keyPressed(KeyEvent e)
      通过调用监听器a和监听器b的keyPressed方法处理keyPressed事件。
      指定者:
      keyPressed 在接口 KeyListener
      参数:
      e - 键盘事件
    • keyReleased

      public void keyReleased(KeyEvent e)
      通过调用监听器a和监听器b的keyReleased方法处理keyReleased事件。
      指定者:
      keyReleased 在接口 KeyListener
      参数:
      e - 键盘事件
    • mouseClicked

      public void mouseClicked(MouseEvent e)
      通过调用监听器a和监听器b的mouseClicked方法处理mouseClicked事件。
      指定者:
      mouseClicked 在接口 MouseListener
      参数:
      e - 鼠标事件
    • mousePressed

      public void mousePressed(MouseEvent e)
      通过调用监听器a和监听器b的mousePressed方法处理mousePressed事件。
      指定者:
      mousePressed 在接口 MouseListener
      参数:
      e - 鼠标事件
    • mouseReleased

      public void mouseReleased(MouseEvent e)
      Handles the mouseReleased event by invoking the mouseReleased methods on listener-a and listener-b.
      指定者:
      mouseReleased 在接口 MouseListener
      参数:
      e - 鼠标事件
    • mouseEntered

      public void mouseEntered(MouseEvent e)
      通过调用监听器a和监听器b上的mouseEntered方法处理mouseEntered事件。
      指定者:
      mouseEntered 在接口 MouseListener
      参数:
      e - 鼠标事件
    • mouseExited

      public void mouseExited(MouseEvent e)
      通过调用监听器a和监听器b上的mouseExited方法处理mouseExited事件。
      指定者:
      mouseExited 在接口 MouseListener
      参数:
      e - 鼠标事件
    • mouseDragged

      public void mouseDragged(MouseEvent e)
      通过调用监听器a和监听器b上的mouseDragged方法处理mouseDragged事件。
      指定者:
      mouseDragged 在接口 MouseMotionListener
      参数:
      e - 鼠标事件
    • mouseMoved

      public void mouseMoved(MouseEvent e)
      通过调用监听器a和监听器b上的mouseMoved方法处理mouseMoved事件。
      指定者:
      mouseMoved 在接口 MouseMotionListener
      参数:
      e - 鼠标事件
    • windowOpened

      public void windowOpened(WindowEvent e)
      通过调用监听器a和监听器b上的windowOpened方法处理windowOpened事件。
      指定者:
      windowOpened 在接口 WindowListener
      参数:
      e - 窗口事件
    • windowClosing

      public void windowClosing(WindowEvent e)
      通过调用监听器a和监听器b上的windowClosing方法处理windowClosing事件。
      指定者:
      windowClosing 在接口 WindowListener
      参数:
      e - 窗口事件
    • windowClosed

      public void windowClosed(WindowEvent e)
      通过调用监听器a和监听器b上的windowClosed方法处理windowClosed事件。
      指定者:
      windowClosed 在接口 WindowListener
      参数:
      e - 窗口事件
    • windowIconified

      public void windowIconified(WindowEvent e)
      通过调用监听器a和监听器b上的windowIconified方法处理windowIconified事件。
      指定者:
      windowIconified 在接口 WindowListener
      参数:
      e - 窗口事件
      参见:
    • windowDeiconified

      public void windowDeiconified(WindowEvent e)
      通过调用监听器a和监听器b上的windowDeiconified方法处理windowDeiconified事件。
      指定者:
      windowDeiconified 在接口 WindowListener
      参数:
      e - 窗口事件
    • windowActivated

      public void windowActivated(WindowEvent e)
      通过调用监听器a和监听器b上的windowActivated方法处理windowActivated事件。
      指定者:
      windowActivated 在接口 WindowListener
      参数:
      e - 窗口事件
    • windowDeactivated

      public void windowDeactivated(WindowEvent e)
      通过调用监听器a和监听器b上的windowDeactivated方法处理windowDeactivated事件。
      指定者:
      windowDeactivated 在接口 WindowListener
      参数:
      e - 窗口事件
    • windowStateChanged

      public void windowStateChanged(WindowEvent e)
      通过调用监听器a和监听器b上的windowStateChanged方法处理windowStateChanged事件。
      指定者:
      windowStateChanged 在接口 WindowStateListener
      参数:
      e - 窗口事件
      自:
      1.4
    • windowGainedFocus

      public void windowGainedFocus(WindowEvent e)
      通过调用监听器a和监听器b上的windowGainedFocus方法处理windowGainedFocus事件。
      指定者:
      windowGainedFocus 在接口 WindowFocusListener
      参数:
      e - 窗口事件
      自:
      1.4
    • windowLostFocus

      public void windowLostFocus(WindowEvent e)
      通过调用监听器a和监听器b上的windowLostFocus方法处理windowLostFocus事件。
      指定者:
      windowLostFocus 在接口 WindowFocusListener
      参数:
      e - 窗口事件
      自:
      1.4
    • actionPerformed

      public void actionPerformed(ActionEvent e)
      通过调用监听器a和监听器b上的actionPerformed方法处理actionPerformed事件。
      指定者:
      actionPerformed 在接口 ActionListener
      参数:
      e - 动作事件
    • itemStateChanged

      public void itemStateChanged(ItemEvent e)
      通过调用监听器a和监听器b上的itemStateChanged方法处理itemStateChanged事件。
      指定者:
      itemStateChanged 在接口 ItemListener
      参数:
      e - 项目事件
    • adjustmentValueChanged

      public void adjustmentValueChanged(AdjustmentEvent e)
      通过调用监听器a和监听器b上的adjustmentValueChanged方法处理adjustmentValueChanged事件。
      指定者:
      adjustmentValueChanged 在接口 AdjustmentListener
      参数:
      e - 调整事件
    • textValueChanged

      public void textValueChanged(TextEvent e)
      从接口复制的描述: TextListener
      当文本值发生变化时调用。为此方法编写的代码执行文本更改时需要发生的操作。
      指定者:
      textValueChanged 在接口 TextListener
      参数:
      e - 要处理的事件
    • inputMethodTextChanged

      public void inputMethodTextChanged(InputMethodEvent e)
      通过调用监听器a和监听器b上的inputMethodTextChanged方法处理inputMethodTextChanged事件。
      指定者:
      inputMethodTextChanged 在接口 InputMethodListener
      参数:
      e - 项目事件
    • caretPositionChanged

      public void caretPositionChanged(InputMethodEvent e)
      通过调用监听器a和监听器b上的caretPositionChanged方法处理caretPositionChanged事件。
      指定者:
      caretPositionChanged 在接口 InputMethodListener
      参数:
      e - 项目事件
    • hierarchyChanged

      public void hierarchyChanged(HierarchyEvent e)
      通过调用监听器a和监听器b上的hierarchyChanged方法处理hierarchyChanged事件。
      指定由:
      hierarchyChanged 在接口 HierarchyListener
      参数:
      e - 项目事件
      自:
      1.3
      参见:
    • ancestorMoved

      public void ancestorMoved(HierarchyEvent e)
      通过调用侦听器a和侦听器b上的ancestorMoved方法处理ancestorMoved事件。
      指定由:
      ancestorMoved 在接口 HierarchyBoundsListener
      参数:
      e - 项目事件
      自:
      1.3
    • ancestorResized

      public void ancestorResized(HierarchyEvent e)
      通过调用侦听器a和侦听器b上的ancestorResized方法处理ancestorResized事件。
      指定由:
      ancestorResized 在接口 HierarchyBoundsListener
      参数:
      e - 项目事件
      自:
      1.3
    • mouseWheelMoved

      public void mouseWheelMoved(MouseWheelEvent e)
      通过调用侦听器a和侦听器b上的mouseWheelMoved方法处理mouseWheelMoved事件。
      指定由:
      mouseWheelMoved 在接口 MouseWheelListener
      参数:
      e - 鼠标事件
      自:
      1.4
      参见:
    • add

      将组件侦听器a与组件侦听器b相结合,并返回生成的多路广播侦听器。
      参数:
      a - 组件侦听器a
      b - 组件侦听器b
      返回:
      生成的侦听器
    • add

      将容器侦听器a与容器侦听器b相结合,并返回生成的多路广播侦听器。
      参数:
      a - 容器侦听器a
      b - 容器侦听器b
      返回:
      生成的侦听器
    • add

      public static FocusListener add(FocusListener a, FocusListener b)
      将焦点侦听器a与焦点侦听器b相结合,并返回生成的多路广播侦听器。
      参数:
      a - 焦点侦听器a
      b - 焦点侦听器b
      返回:
      生成的侦听器
    • add

      public static KeyListener add(KeyListener a, KeyListener b)
      将键盘侦听器a与键盘侦听器b相结合,并返回生成的多路广播侦听器。
      参数:
      a - 键盘侦听器a
      b - 键盘侦听器b
      返回:
      生成的侦听器
    • add

      public static MouseListener add(MouseListener a, MouseListener b)
      将鼠标侦听器a与鼠标侦听器b相结合,并返回生成的多路广播侦听器。
      参数:
      a - 鼠标侦听器a
      b - 鼠标侦听器b
      返回:
      生成的侦听器
    • add

      将鼠标移动侦听器a与鼠标移动侦听器b相结合,并返回生成的多路广播侦听器。
      参数:
      a - 鼠标移动侦听器a
      b - 鼠标移动侦听器b
      返回:
      生成的侦听器
    • add

      public static WindowListener add(WindowListener a, WindowListener b)
      将窗口侦听器a与窗口侦听器b相结合,并返回生成的多路广播侦听器。
      参数:
      a - 窗口侦听器a
      b - 窗口侦听器b
      返回:
      生成的侦听器
    • add

      将窗口状态侦听器a与窗口状态侦听器b相结合,并返回生成的多路广播侦听器。
      参数:
      a - 窗口状态侦听器a
      b - 窗口状态侦听器b
      返回:
      生成的侦听器
      自:
      1.4
    • add

      将窗口焦点侦听器a与窗口焦点侦听器b相结合,并返回生成的多路广播侦听器。
      参数:
      a - 窗口焦点侦听器a
      b - 窗口焦点侦听器b
      返回:
      生成的侦听器
      自:
      1.4
    • add

      public static ActionListener add(ActionListener a, ActionListener b)
      将动作侦听器a与动作侦听器b相结合,并返回生成的多路广播侦听器。
      参数:
      a - 动作侦听器a
      b - 动作侦听器b
      返回:
      生成的侦听器
    • add

      public static ItemListener add(ItemListener a, ItemListener b)
      将项目侦听器a与项目侦听器b相结合,并返回生成的多路广播侦听器。
      参数:
      a - 项目侦听器a
      b - 项目侦听器b
      返回:
      生成的侦听器
    • add

      将调整侦听器a与调整侦听器b相结合,并返回生成的多路广播侦听器。
      参数:
      a - 调整侦听器a
      b - 调整侦听器b
      返回:
      生成的侦听器
    • add

      public static TextListener add(TextListener a, TextListener b)
      将文本侦听器a与文本侦听器b相结合,并返回生成的多路广播侦听器。
      参数:
      a - 文本侦听器a
      b - 文本侦听器b
      返回:
      生成的侦听器
    • add

      将输入法侦听器a与输入法侦听器b相结合,并返回生成的多路广播侦听器。
      参数:
      a - 输入法侦听器a
      b - 输入法侦听器b
      返回:
      生成的侦听器
    • add

      将层次侦听器a与层次侦听器b相结合,并返回生成的多路广播侦听器。
      参数:
      a - 层次侦听器a
      b - 层次侦听器b
      返回:
      生成的侦听器
      自:
      1.3
    • add

      将层次边界侦听器a与层次边界侦听器b相结合,并返回生成的多路广播侦听器。
      参数:
      a - 层次边界侦听器a
      b - 层次边界侦听器b
      返回:
      生成的侦听器
      自:
      1.3
    • add

      将鼠标滚轮侦听器a与鼠标滚轮侦听器b相结合,并返回生成的多路广播侦听器。
      参数:
      a - 鼠标滚轮侦听器a
      b - 鼠标滚轮侦听器b
      返回:
      生成的侦听器
      自:
      1.4
    • remove

      public static ComponentListener remove(ComponentListener l, ComponentListener oldl)
      从组件侦听器l中移除旧的组件侦听器oldl,并返回生成的多路广播侦听器。
      参数:
      l - 组件侦听器l
      oldl - 要移除的组件侦听器
      返回:
      生成的侦听器
    • remove

      public static ContainerListener remove(ContainerListener l, ContainerListener oldl)
      从容器侦听器l中移除旧的容器侦听器oldl,并返回生成的多路广播侦听器。
      参数:
      l - 容器侦听器l
      oldl - 要移除的容器侦听器
      返回:
      生成的侦听器
    • remove

      public static FocusListener remove(FocusListener l, FocusListener oldl)
      从焦点侦听器l中移除旧的焦点侦听器oldl,并返回生成的多路广播侦听器。
      参数:
      l - 焦点侦听器l
      oldl - 要移除的焦点侦听器
      返回:
      生成的侦听器
    • remove

      public static KeyListener remove(KeyListener l, KeyListener oldl)
      从键盘侦听器l中移除旧的键盘侦听器oldl,并返回生成的多路广播侦听器。
      参数:
      l - 键盘侦听器l
      oldl - 要移除的键盘侦听器
      返回:
      生成的侦听器
    • remove

      public static MouseListener remove(MouseListener l, MouseListener oldl)
      从鼠标侦听器l中移除旧的鼠标侦听器oldl,并返回生成的多路广播侦听器。
      参数:
      l - 鼠标侦听器l
      oldl - 要移除的鼠标侦听器
      返回:
      生成的侦听器
    • remove

      public static MouseMotionListener remove(MouseMotionListener l, MouseMotionListener oldl)
      从鼠标移动侦听器l中移除旧的鼠标移动侦听器oldl,并返回生成的多路广播侦听器。
      参数:
      l - 鼠标移动侦听器l
      oldl - 要移除的鼠标移动侦听器
    • remove

      public static WindowListener remove(WindowListener l, WindowListener oldl)
      Removes the old window-listener from window-listener-l and returns the resulting multicast listener.
      Parameters:
      l - window-listener-l
      oldl - the window-listener being removed
      Returns:
      the resulting listener
    • remove

      public static WindowStateListener remove(WindowStateListener l, WindowStateListener oldl)
      Removes the old window-state-listener from window-state-listener-l and returns the resulting multicast listener.
      Parameters:
      l - window-state-listener-l
      oldl - the window-state-listener being removed
      Returns:
      the resulting listener
      Since:
      1.4
    • remove

      public static WindowFocusListener remove(WindowFocusListener l, WindowFocusListener oldl)
      Removes the old window-focus-listener from window-focus-listener-l and returns the resulting multicast listener.
      参数:
      l - 窗口焦点监听器-l
      oldl - 要移除的窗口焦点监听器
      返回:
      结果监听器
      自版本:
      1.4
    • remove

      public static ActionListener remove(ActionListener l, ActionListener oldl)
      从动作监听器-l中移除旧动作监听器,并返回结果的多路广播监听器。
      参数:
      l - 动作监听器-l
      oldl - 要移除的动作监听器
      返回:
      结果监听器
    • remove

      public static ItemListener remove(ItemListener l, ItemListener oldl)
      从项目监听器-l中移除旧项目监听器,并返回结果的多路广播监听器。
      参数:
      l - 项目监听器-l
      oldl - 要移除的项目监听器
      返回:
      结果监听器
    • remove

      public static AdjustmentListener remove(AdjustmentListener l, AdjustmentListener oldl)
      从调整监听器-l中移除旧调整监听器,并返回结果的多路广播监听器。
      参数:
      l - 调整监听器-l
      oldl - 要移除的调整监听器
      返回:
      结果监听器
    • remove

      public static TextListener remove(TextListener l, TextListener oldl)
      从文本监听器-l中移除旧文本监听器,并返回结果的多路广播监听器。
      参数:
      l - 文本监听器-l
      oldl - 要移除的文本监听器
      返回:
      结果监听器
    • remove

      public static InputMethodListener remove(InputMethodListener l, InputMethodListener oldl)
      从输入法监听器-l中移除旧输入法监听器,并返回结果的多路广播监听器。
      参数:
      l - 输入法监听器-l
      oldl - 要移除的输入法监听器
      返回:
      结果监听器
    • remove

      public static HierarchyListener remove(HierarchyListener l, HierarchyListener oldl)
      从层次结构监听器-l中移除旧层次结构监听器,并返回结果的多路广播监听器。
      参数:
      l - 层次结构监听器-l
      oldl - 要移除的层次结构监听器
      返回:
      结果监听器
      自版本:
      1.3
    • remove

      从层次结构边界监听器-l中移除旧层次结构边界监听器,并返回结果的多路广播监听器。
      参数:
      l - 层次结构边界监听器-l
      oldl - 要移除的层次结构边界监听器
      返回:
      结果监听器
      自版本:
      1.3
    • remove

      public static MouseWheelListener remove(MouseWheelListener l, MouseWheelListener oldl)
      从鼠标滚轮监听器-l中移除旧鼠标滚轮监听器,并返回结果的多路广播监听器。
      参数:
      l - 鼠标滚轮监听器-l
      oldl - 要移除的鼠标滚轮监听器
      返回:
      结果监听器
      自版本:
      1.4
    • addInternal

      protected static EventListener addInternal(EventListener a, EventListener b)
      从监听器-a和监听器-b中返回结果的多路广播监听器。如果监听器-a为null,则返回监听器-b;如果监听器-b为null,则返回监听器-a;如果两者都不为null,则创建并返回一个新的AWTEventMulticaster实例,将a与b链接起来。
      参数:
      a - 事件监听器-a
      b - 事件监听器-b
      返回:
      结果监听器
    • removeInternal

      protected static EventListener removeInternal(EventListener l, EventListener oldl)
      从监听器-l中移除旧监听器后返回结果的多路广播监听器。如果监听器-l等于旧监听器或监听器-l为null,则返回null。否则,如果监听器-l是AWTEventMulticaster的实例,则从中移除旧监听器。否则,返回监听器l。
      参数:
      l - 要移除的监听器
      oldl - 要移除的监听器
      返回:
      结果监听器
    • saveInternal

      protected void saveInternal(ObjectOutputStream s, String k) throws IOException
      序列化支持。将所有可序列化的监听器保存到序列化流中。
      参数:
      s - 要保存到的流
      k - 要放在每个可序列化监听器之前的前缀流
      抛出:
      IOException - 如果序列化失败
    • save

      protected static void save(ObjectOutputStream s, String k, EventListener l) throws IOException
      将可序列化的监听器链保存到序列化流中。
      参数:
      s - 要保存到的流
      k - 要放在每个可序列化监听器之前的前缀流
      l - 要保存的监听器链
      抛出:
      IOException - 如果序列化失败
    • getListeners

      public static <T extends EventListener> T[] getListeners(EventListener l, Class<T> listenerType)
      返回由指定的java.util.EventListener链中的所有对象组成的数组。通过AWTEventMulticaster使用addFooListener方法将FooListener链接在一起。如果指定了null监听器,则此方法返回一个空数组。如果指定的监听器不是AWTEventMulticaster的实例,则此方法返回一个仅包含指定监听器的数组。如果没有这样的监听器被链接,则此方法返回一个空数组。
      类型参数:
      T - 监听器类型
      参数:
      l - 指定的java.util.EventListener
      listenerType - 请求的监听器类型;此参数应指定一个从java.util.EventListener继承的接口
      返回:
      由指定的多路广播监听器链接的所有对象组成的数组,如果没有被指定的多路广播监听器链接,则返回一个空数组
      抛出:
      NullPointerException - 如果指定的listenertype参数为null
      ClassCastException - 如果listenerType未指定实现java.util.EventListener的类或接口
      自版本:
      1.4