java.lang.Object
java.awt.AWTEventMulticaster
- 所有已实现的接口:
-
ActionListener,AdjustmentListener,ComponentListener,ContainerListener,FocusListener,HierarchyBoundsListener,HierarchyListener,InputMethodListener,ItemListener,KeyListener,MouseListener,MouseMotionListener,MouseWheelListener,TextListener,WindowFocusListener,WindowListener,WindowStateListener,EventListener
public class AWTEventMulticaster extends Object implements ComponentListener, ContainerListener, FocusListener, KeyListener, MouseListener, MouseMotionListener, WindowListener, WindowFocusListener, WindowStateListener, ActionListener, ItemListener, AdjustmentListener, TextListener, InputMethodListener, HierarchyListener, HierarchyBoundsListener, MouseWheelListener
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());
}
}
}
需要注意的重要点是add和remove方法的第一个参数是维护监听器的字段。此外,您必须将add和remove方法的结果分配给维护监听器的字段。
AWTEventMulticaster被实现为一对在构造时设置的EventListeners。 AWTEventMulticaster是不可变的。 add和remove方法不会以任何方式改变AWTEventMulticaster。如果需要,将创建一个新的AWTEventMulticaster。通过这种方式,在事件分发过程中添加和移除监听器是安全的。但是,在事件分发操作过程中添加的事件监听器不会被通知当前正在分发的事件。
所有的add方法都允许null参数。如果第一个参数是null,则返回第二个参数。如果第一个参数不是null且第二个参数是null,则返回第一个参数。如果两个参数都是non-null,则使用这两个参数创建一个新的AWTEventMulticaster并返回。
对于接受两个参数的remove方法,返回如下:
null,如果第一个参数是null,或者参数相等,通过==方式。- 如果第一个参数不是
AWTEventMulticaster的实例,则返回第一个参数。 - 调用第一个参数上的
remove(EventListener),将第二个参数提供给remove(EventListener)方法的结果。
Swing使用EventListenerList进行类似逻辑。有关详细信息,请参考它。
- 自版本:
- 1.1
- 参见:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final EventListener事件链中的变量(监听器-a)protected final EventListener事件链中的变量(监听器-b) -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected创建一个事件多播器实例,将监听器-a与监听器-b链接在一起。 -
Method Summary
Modifier and TypeMethodDescriptionvoid通过调用监听器-a和监听器-b的actionPerformed方法来处理actionPerformed事件。static ActionListeneradd(ActionListener a, ActionListener b) 添加action-listener-a与action-listener-b,并返回结果的多播监听器。static AdjustmentListener添加adjustment-listener-a与adjustment-listener-b,并返回结果的多播监听器。static ComponentListener添加component-listener-a与component-listener-b,并返回结果的多播监听器。static ContainerListener添加container-listener-a与container-listener-b,并返回结果的多播监听器。static FocusListeneradd(FocusListener a, FocusListener b) 添加focus-listener-a与focus-listener-b,并返回结果的多播监听器。static HierarchyBoundsListener添加hierarchy-bounds-listener-a与hierarchy-bounds-listener-b,并返回结果的多播监听器。static HierarchyListener添加hierarchy-listener-a与hierarchy-listener-b,并返回结果的多播监听器。static InputMethodListener添加input-method-listener-a与input-method-listener-b,并返回结果的多播监听器。static ItemListeneradd(ItemListener a, ItemListener b) 添加item-listener-a与item-listener-b,并返回结果的多播监听器。static KeyListeneradd(KeyListener a, KeyListener b) 添加key-listener-a与key-listener-b,并返回结果的多播监听器。static MouseListeneradd(MouseListener a, MouseListener b) 添加mouse-listener-a与mouse-listener-b,并返回结果的多播监听器。static MouseMotionListener添加mouse-motion-listener-a与mouse-motion-listener-b,并返回结果的多播监听器。static MouseWheelListener添加mouse-wheel-listener-a与mouse-wheel-listener-b,并返回结果的多播监听器。static TextListeneradd(TextListener a, TextListener b) 添加text-listener-a与text-listener-b,并返回结果的多播监听器。static WindowFocusListener添加window-focus-listener-a与window-focus-listener-b,并返回结果的多播监听器。static WindowListeneradd(WindowListener a, WindowListener b) 添加window-listener-a与window-listener-b,并返回结果的多播监听器。static WindowStateListener添加window-state-listener-a与window-state-listener-b,并返回结果的多播监听器。protected static EventListener从将监听器-a和监听器-b添加在一起中返回结果的多播监听器。void通过调用监听器-a和监听器-b的adjustmentValueChanged方法来处理adjustmentValueChanged事件。void通过调用监听器-a和监听器-b的ancestorMoved方法来处理ancestorMoved事件。void通过调用监听器-a和监听器-b的ancestorResized方法来处理ancestorResized事件。void通过调用监听器-a和监听器-b的caretPositionChanged方法来处理caretPositionChanged事件。void通过调用监听器-a和监听器-b的componentAdded方法来处理componentAdded容器事件。void通过调用监听器-a和监听器-b的componentHidden方法来处理componentHidden事件。void通过调用监听器-a和监听器-b的componentMoved方法来处理componentMoved事件。void通过调用监听器-a和监听器-b的componentRemoved方法来处理componentRemoved容器事件。void通过调用监听器-a和监听器-b的componentResized方法来处理componentResized事件。void通过调用监听器-a和监听器-b的componentShown方法来处理componentShown事件。void通过调用监听器-a和监听器-b的focusGained方法来处理focusGained事件。void通过调用监听器-a和监听器-b的focusLost方法来处理focusLost事件。static <T extends EventListener>
T[]getListeners(EventListener l, Class<T> listenerType) 返回由指定的java.util.EventListener链式连接为FooListener的所有对象的数组。void通过调用监听器-a和监听器-b的hierarchyChanged方法来处理hierarchyChanged事件。void通过调用监听器-a和监听器-b的inputMethodTextChanged方法来处理inputMethodTextChanged事件。void通过调用监听器-a和监听器-b的itemStateChanged方法来处理itemStateChanged事件。void通过调用监听器-a和监听器-b的keyPressed方法来处理keyPressed事件。void通过调用监听器-a和监听器-b的keyReleased方法来处理keyReleased事件。void通过调用监听器-a和监听器-b的keyTyped方法来处理keyTyped事件。void通过调用监听器-a和监听器-b的mouseClicked方法来处理mouseClicked事件。void通过调用监听器-a和监听器-b的mouseDragged方法来处理mouseDragged事件。void通过调用监听器-a和监听器-b的mouseEntered方法来处理mouseEntered事件。void通过调用监听器-a和监听器-b的mouseExited方法来处理mouseExited事件。void通过调用监听器-a和监听器-b的mouseMoved方法来处理mouseMoved事件。void通过调用监听器-a和监听器-b的mousePressed方法来处理mousePressed事件。void通过调用监听器-a和监听器-b的mouseReleased方法来处理mouseReleased事件。void通过调用监听器-a和监听器-b的mouseWheelMoved方法来处理mouseWheelMoved事件。static ActionListenerremove(ActionListener l, ActionListener oldl) 从action-listener-l中移除旧的action-listener并返回结果的多播监听器。static AdjustmentListenerremove(AdjustmentListener l, AdjustmentListener oldl) 从adjustment-listener-l中移除旧的adjustment-listener并返回结果的多播监听器。static ComponentListenerremove(ComponentListener l, ComponentListener oldl) 从组件监听器列表中移除旧的组件监听器,并返回结果的多路广播监听器。static ContainerListenerremove(ContainerListener l, ContainerListener oldl) 从容器监听器列表中移除旧的容器监听器,并返回结果的多路广播监听器。static FocusListenerremove(FocusListener l, FocusListener oldl) 从焦点监听器列表中移除旧的焦点监听器,并返回结果的多路广播监听器。static HierarchyBoundsListener从层次边界监听器列表中移除旧的层次边界监听器,并返回结果的多路广播监听器。static HierarchyListenerremove(HierarchyListener l, HierarchyListener oldl) 从层次监听器列表中移除旧的层次监听器,并返回结果的多路广播监听器。static InputMethodListenerremove(InputMethodListener l, InputMethodListener oldl) 从输入法监听器列表中移除旧的输入法监听器,并返回结果的多路广播监听器。static ItemListenerremove(ItemListener l, ItemListener oldl) 从项目监听器列表中移除旧的项目监听器,并返回结果的多路广播监听器。static KeyListenerremove(KeyListener l, KeyListener oldl) 从键盘监听器列表中移除旧的键盘监听器,并返回结果的多路广播监听器。static MouseListenerremove(MouseListener l, MouseListener oldl) 从鼠标监听器列表中移除旧的鼠标监听器,并返回结果的多路广播监听器。static MouseMotionListenerremove(MouseMotionListener l, MouseMotionListener oldl) 从鼠标移动监听器列表中移除旧的鼠标移动监听器,并返回结果的多路广播监听器。static MouseWheelListenerremove(MouseWheelListener l, MouseWheelListener oldl) 从鼠标滚轮监听器列表中移除旧的鼠标滚轮监听器,并返回结果的多路广播监听器。static TextListenerremove(TextListener l, TextListener oldl) 从文本监听器列表中移除旧的文本监听器,并返回结果的多路广播监听器。static WindowFocusListenerremove(WindowFocusListener l, WindowFocusListener oldl) 从窗口焦点监听器列表中移除旧的窗口焦点监听器,并返回结果的多路广播监听器。static WindowListenerremove(WindowListener l, WindowListener oldl) 从窗口监听器列表中移除旧的窗口监听器,并返回结果的多路广播监听器。static WindowStateListenerremove(WindowStateListener l, WindowStateListener oldl) 从窗口状态监听器列表中移除旧的窗口状态监听器,并返回结果的多路广播监听器。protected EventListenerremove(EventListener oldl) 从此多路广播器中移除一个监听器。protected static EventListenerremoveInternal(EventListener l, EventListener oldl) 从监听器列表中移除旧的监听器后返回结果的多路广播监听器。protected static voidsave(ObjectOutputStream s, String k, EventListener l) 将可序列化的监听器链保存到序列化流中。protected void序列化支持。void当文本的值发生变化时调用。void通过调用监听器a和监听器b的windowActivated方法处理windowActivated事件。void通过调用监听器a和监听器b的windowClosed方法处理windowClosed事件。void通过调用监听器a和监听器b的windowClosing方法处理windowClosing事件。void通过调用监听器a和监听器b的windowDeactivated方法处理windowDeactivated事件。void通过调用监听器a和监听器b的windowDeiconified方法处理windowDeiconified事件。void通过调用监听器a和监听器b的windowGainedFocus方法处理windowGainedFocus事件。void通过调用监听器a和监听器b的windowIconified方法处理windowIconified事件。void通过调用监听器a和监听器b的windowLostFocus方法处理windowLostFocus事件。void通过调用监听器a和监听器b的windowOpened方法处理windowOpened事件。void通过调用监听器a和监听器b的windowStateChanged方法处理windowStateChanged事件。
-
Field Details
-
a
事件链中的一个变量(监听器a)。 -
b
事件链中的一个变量(监听器b)。
-
-
Constructor Details
-
AWTEventMulticaster
创建一个事件多路广播器实例,将监听器a与监听器b链接起来。输入参数a和b不应为null,尽管在这种情况下是否选择抛出NullPointerException的实现可能有所不同。- 参数:
-
a- 监听器a -
b- 监听器b
-
-
Method Details
-
remove
从此多路广播器中移除一个监听器。返回的多路广播器包含此多路广播器中所有监听器,但不包括所有
oldl的出现。如果结果的多路广播器只包含一个常规监听器,则可能返回该常规监听器。如果结果的多路广播器为空,则可能返回null。如果
oldl为null,则不会抛出异常。- 参数:
-
oldl- 要移除的监听器 - 返回:
- 结果监听器
-
componentResized
通过调用监听器a和监听器b的componentResized方法处理componentResized事件。- 指定者:
-
componentResized在接口ComponentListener中 - 参数:
-
e- 组件事件
-
componentMoved
通过调用监听器a和监听器b的componentMoved方法处理componentMoved事件。- 指定者:
-
componentMoved在接口ComponentListener中 - 参数:
-
e- 组件事件
-
componentShown
通过调用监听器a和监听器b的componentShown方法处理componentShown事件。- 指定者:
-
componentShown在接口ComponentListener中 - 参数:
-
e- 组件事件
-
componentHidden
通过调用监听器a和监听器b的componentHidden方法处理componentHidden事件。- 指定者:
-
componentHidden在接口ComponentListener中 - 参数:
-
e- 组件事件
-
componentAdded
通过调用监听器a和监听器b的componentAdded方法处理componentAdded容器事件。- 指定者:
-
componentAdded在接口ContainerListener中 - 参数:
-
e- 组件事件
-
componentRemoved
通过调用监听器a和监听器b的componentRemoved方法处理componentRemoved容器事件。- 指定者:
-
componentRemoved在接口ContainerListener中 - 参数:
-
e- 组件事件
-
focusGained
通过调用监听器a和监听器b的focusGained方法处理focusGained事件。- 指定者:
-
focusGained在接口FocusListener中 - 参数:
-
e- 焦点事件
-
focusLost
通过调用监听器a和监听器b的focusLost方法处理focusLost事件。- 指定者:
-
focusLost在接口FocusListener中 - 参数:
-
e- 焦点事件
-
keyTyped
通过调用监听器a和监听器b的keyTyped方法处理keyTyped事件。- 指定者:
-
keyTyped在接口KeyListener中 - 参数:
-
e- 键盘事件
-
keyPressed
通过调用监听器a和监听器b的keyPressed方法处理keyPressed事件。- 指定者:
-
keyPressed在接口KeyListener中 - 参数:
-
e- 键盘事件
-
keyReleased
通过调用监听器a和监听器b的keyReleased方法处理keyReleased事件。- 指定者:
-
keyReleased在接口KeyListener中 - 参数:
-
e- 键盘事件
-
mouseClicked
通过调用监听器a和监听器b的mouseClicked方法处理mouseClicked事件。- 指定者:
-
mouseClicked在接口MouseListener中 - 参数:
-
e- 鼠标事件
-
mousePressed
通过调用监听器a和监听器b的mousePressed方法处理mousePressed事件。- 指定者:
-
mousePressed在接口MouseListener中 - 参数:
-
e- 鼠标事件
-
mouseReleased
Handles the mouseReleased event by invoking the mouseReleased methods on listener-a and listener-b.- 指定者:
-
mouseReleased在接口MouseListener中 - 参数:
-
e- 鼠标事件
-
mouseEntered
通过调用监听器a和监听器b上的mouseEntered方法处理mouseEntered事件。- 指定者:
-
mouseEntered在接口MouseListener中 - 参数:
-
e- 鼠标事件
-
mouseExited
通过调用监听器a和监听器b上的mouseExited方法处理mouseExited事件。- 指定者:
-
mouseExited在接口MouseListener中 - 参数:
-
e- 鼠标事件
-
mouseDragged
通过调用监听器a和监听器b上的mouseDragged方法处理mouseDragged事件。- 指定者:
-
mouseDragged在接口MouseMotionListener中 - 参数:
-
e- 鼠标事件
-
mouseMoved
通过调用监听器a和监听器b上的mouseMoved方法处理mouseMoved事件。- 指定者:
-
mouseMoved在接口MouseMotionListener中 - 参数:
-
e- 鼠标事件
-
windowOpened
通过调用监听器a和监听器b上的windowOpened方法处理windowOpened事件。- 指定者:
-
windowOpened在接口WindowListener中 - 参数:
-
e- 窗口事件
-
windowClosing
通过调用监听器a和监听器b上的windowClosing方法处理windowClosing事件。- 指定者:
-
windowClosing在接口WindowListener中 - 参数:
-
e- 窗口事件
-
windowClosed
通过调用监听器a和监听器b上的windowClosed方法处理windowClosed事件。- 指定者:
-
windowClosed在接口WindowListener中 - 参数:
-
e- 窗口事件
-
windowIconified
通过调用监听器a和监听器b上的windowIconified方法处理windowIconified事件。- 指定者:
-
windowIconified在接口WindowListener中 - 参数:
-
e- 窗口事件 - 参见:
-
windowDeiconified
通过调用监听器a和监听器b上的windowDeiconified方法处理windowDeiconified事件。- 指定者:
-
windowDeiconified在接口WindowListener中 - 参数:
-
e- 窗口事件
-
windowActivated
通过调用监听器a和监听器b上的windowActivated方法处理windowActivated事件。- 指定者:
-
windowActivated在接口WindowListener中 - 参数:
-
e- 窗口事件
-
windowDeactivated
通过调用监听器a和监听器b上的windowDeactivated方法处理windowDeactivated事件。- 指定者:
-
windowDeactivated在接口WindowListener中 - 参数:
-
e- 窗口事件
-
windowStateChanged
通过调用监听器a和监听器b上的windowStateChanged方法处理windowStateChanged事件。- 指定者:
-
windowStateChanged在接口WindowStateListener中 - 参数:
-
e- 窗口事件 - 自:
- 1.4
-
windowGainedFocus
通过调用监听器a和监听器b上的windowGainedFocus方法处理windowGainedFocus事件。- 指定者:
-
windowGainedFocus在接口WindowFocusListener中 - 参数:
-
e- 窗口事件 - 自:
- 1.4
-
windowLostFocus
通过调用监听器a和监听器b上的windowLostFocus方法处理windowLostFocus事件。- 指定者:
-
windowLostFocus在接口WindowFocusListener中 - 参数:
-
e- 窗口事件 - 自:
- 1.4
-
actionPerformed
通过调用监听器a和监听器b上的actionPerformed方法处理actionPerformed事件。- 指定者:
-
actionPerformed在接口ActionListener中 - 参数:
-
e- 动作事件
-
itemStateChanged
通过调用监听器a和监听器b上的itemStateChanged方法处理itemStateChanged事件。- 指定者:
-
itemStateChanged在接口ItemListener中 - 参数:
-
e- 项目事件
-
adjustmentValueChanged
通过调用监听器a和监听器b上的adjustmentValueChanged方法处理adjustmentValueChanged事件。- 指定者:
-
adjustmentValueChanged在接口AdjustmentListener中 - 参数:
-
e- 调整事件
-
textValueChanged
从接口复制的描述:TextListener当文本值发生变化时调用。为此方法编写的代码执行文本更改时需要发生的操作。- 指定者:
-
textValueChanged在接口TextListener中 - 参数:
-
e- 要处理的事件
-
inputMethodTextChanged
通过调用监听器a和监听器b上的inputMethodTextChanged方法处理inputMethodTextChanged事件。- 指定者:
-
inputMethodTextChanged在接口InputMethodListener中 - 参数:
-
e- 项目事件
-
caretPositionChanged
通过调用监听器a和监听器b上的caretPositionChanged方法处理caretPositionChanged事件。- 指定者:
-
caretPositionChanged在接口InputMethodListener中 - 参数:
-
e- 项目事件
-
hierarchyChanged
通过调用监听器a和监听器b上的hierarchyChanged方法处理hierarchyChanged事件。- 指定由:
-
hierarchyChanged在接口HierarchyListener - 参数:
-
e- 项目事件 - 自:
- 1.3
- 参见:
-
ancestorMoved
通过调用侦听器a和侦听器b上的ancestorMoved方法处理ancestorMoved事件。- 指定由:
-
ancestorMoved在接口HierarchyBoundsListener - 参数:
-
e- 项目事件 - 自:
- 1.3
-
ancestorResized
通过调用侦听器a和侦听器b上的ancestorResized方法处理ancestorResized事件。- 指定由:
-
ancestorResized在接口HierarchyBoundsListener - 参数:
-
e- 项目事件 - 自:
- 1.3
-
mouseWheelMoved
通过调用侦听器a和侦听器b上的mouseWheelMoved方法处理mouseWheelMoved事件。- 指定由:
-
mouseWheelMoved在接口MouseWheelListener - 参数:
-
e- 鼠标事件 - 自:
- 1.4
- 参见:
-
add
将组件侦听器a与组件侦听器b相结合,并返回生成的多路广播侦听器。- 参数:
-
a- 组件侦听器a -
b- 组件侦听器b - 返回:
- 生成的侦听器
-
add
将容器侦听器a与容器侦听器b相结合,并返回生成的多路广播侦听器。- 参数:
-
a- 容器侦听器a -
b- 容器侦听器b - 返回:
- 生成的侦听器
-
add
将焦点侦听器a与焦点侦听器b相结合,并返回生成的多路广播侦听器。- 参数:
-
a- 焦点侦听器a -
b- 焦点侦听器b - 返回:
- 生成的侦听器
-
add
将键盘侦听器a与键盘侦听器b相结合,并返回生成的多路广播侦听器。- 参数:
-
a- 键盘侦听器a -
b- 键盘侦听器b - 返回:
- 生成的侦听器
-
add
将鼠标侦听器a与鼠标侦听器b相结合,并返回生成的多路广播侦听器。- 参数:
-
a- 鼠标侦听器a -
b- 鼠标侦听器b - 返回:
- 生成的侦听器
-
add
将鼠标移动侦听器a与鼠标移动侦听器b相结合,并返回生成的多路广播侦听器。- 参数:
-
a- 鼠标移动侦听器a -
b- 鼠标移动侦听器b - 返回:
- 生成的侦听器
-
add
将窗口侦听器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
将动作侦听器a与动作侦听器b相结合,并返回生成的多路广播侦听器。- 参数:
-
a- 动作侦听器a -
b- 动作侦听器b - 返回:
- 生成的侦听器
-
add
将项目侦听器a与项目侦听器b相结合,并返回生成的多路广播侦听器。- 参数:
-
a- 项目侦听器a -
b- 项目侦听器b - 返回:
- 生成的侦听器
-
add
将调整侦听器a与调整侦听器b相结合,并返回生成的多路广播侦听器。- 参数:
-
a- 调整侦听器a -
b- 调整侦听器b - 返回:
- 生成的侦听器
-
add
将文本侦听器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
从组件侦听器l中移除旧的组件侦听器oldl,并返回生成的多路广播侦听器。- 参数:
-
l- 组件侦听器l -
oldl- 要移除的组件侦听器 - 返回:
- 生成的侦听器
-
remove
从容器侦听器l中移除旧的容器侦听器oldl,并返回生成的多路广播侦听器。- 参数:
-
l- 容器侦听器l -
oldl- 要移除的容器侦听器 - 返回:
- 生成的侦听器
-
remove
从焦点侦听器l中移除旧的焦点侦听器oldl,并返回生成的多路广播侦听器。- 参数:
-
l- 焦点侦听器l -
oldl- 要移除的焦点侦听器 - 返回:
- 生成的侦听器
-
remove
从键盘侦听器l中移除旧的键盘侦听器oldl,并返回生成的多路广播侦听器。- 参数:
-
l- 键盘侦听器l -
oldl- 要移除的键盘侦听器 - 返回:
- 生成的侦听器
-
remove
从鼠标侦听器l中移除旧的鼠标侦听器oldl,并返回生成的多路广播侦听器。- 参数:
-
l- 鼠标侦听器l -
oldl- 要移除的鼠标侦听器 - 返回:
- 生成的侦听器
-
remove
从鼠标移动侦听器l中移除旧的鼠标移动侦听器oldl,并返回生成的多路广播侦听器。- 参数:
-
l- 鼠标移动侦听器l -
oldl- 要移除的鼠标移动侦听器
-
remove
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
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
Removes the old window-focus-listener from window-focus-listener-l and returns the resulting multicast listener.- 参数:
-
l- 窗口焦点监听器-l -
oldl- 要移除的窗口焦点监听器 - 返回:
- 结果监听器
- 自版本:
- 1.4
-
remove
从动作监听器-l中移除旧动作监听器,并返回结果的多路广播监听器。- 参数:
-
l- 动作监听器-l -
oldl- 要移除的动作监听器 - 返回:
- 结果监听器
-
remove
从项目监听器-l中移除旧项目监听器,并返回结果的多路广播监听器。- 参数:
-
l- 项目监听器-l -
oldl- 要移除的项目监听器 - 返回:
- 结果监听器
-
remove
从调整监听器-l中移除旧调整监听器,并返回结果的多路广播监听器。- 参数:
-
l- 调整监听器-l -
oldl- 要移除的调整监听器 - 返回:
- 结果监听器
-
remove
从文本监听器-l中移除旧文本监听器,并返回结果的多路广播监听器。- 参数:
-
l- 文本监听器-l -
oldl- 要移除的文本监听器 - 返回:
- 结果监听器
-
remove
从输入法监听器-l中移除旧输入法监听器,并返回结果的多路广播监听器。- 参数:
-
l- 输入法监听器-l -
oldl- 要移除的输入法监听器 - 返回:
- 结果监听器
-
remove
从层次结构监听器-l中移除旧层次结构监听器,并返回结果的多路广播监听器。- 参数:
-
l- 层次结构监听器-l -
oldl- 要移除的层次结构监听器 - 返回:
- 结果监听器
- 自版本:
- 1.3
-
remove
public static HierarchyBoundsListener remove(HierarchyBoundsListener l, HierarchyBoundsListener oldl) 从层次结构边界监听器-l中移除旧层次结构边界监听器,并返回结果的多路广播监听器。- 参数:
-
l- 层次结构边界监听器-l -
oldl- 要移除的层次结构边界监听器 - 返回:
- 结果监听器
- 自版本:
- 1.3
-
remove
从鼠标滚轮监听器-l中移除旧鼠标滚轮监听器,并返回结果的多路广播监听器。- 参数:
-
l- 鼠标滚轮监听器-l -
oldl- 要移除的鼠标滚轮监听器 - 返回:
- 结果监听器
- 自版本:
- 1.4
-
addInternal
从监听器-a和监听器-b中返回结果的多路广播监听器。如果监听器-a为null,则返回监听器-b;如果监听器-b为null,则返回监听器-a;如果两者都不为null,则创建并返回一个新的AWTEventMulticaster实例,将a与b链接起来。- 参数:
-
a- 事件监听器-a -
b- 事件监听器-b - 返回:
- 结果监听器
-
removeInternal
从监听器-l中移除旧监听器后返回结果的多路广播监听器。如果监听器-l等于旧监听器或监听器-l为null,则返回null。否则,如果监听器-l是AWTEventMulticaster的实例,则从中移除旧监听器。否则,返回监听器l。- 参数:
-
l- 要移除的监听器 -
oldl- 要移除的监听器 - 返回:
- 结果监听器
-
saveInternal
序列化支持。将所有可序列化的监听器保存到序列化流中。- 参数:
-
s- 要保存到的流 -
k- 要放在每个可序列化监听器之前的前缀流 - 抛出:
-
IOException- 如果序列化失败
-
save
将可序列化的监听器链保存到序列化流中。- 参数:
-
s- 要保存到的流 -
k- 要放在每个可序列化监听器之前的前缀流 -
l- 要保存的监听器链 - 抛出:
-
IOException- 如果序列化失败
-
getListeners
返回由指定的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
-