public class SwingEventMulticaster extends AWTEventMulticaster implements AncestorListener, CaretListener, CellEditorListener, ChangeListener, DocumentListener, HyperlinkListener, InternalFrameListener, ListDataListener, ListSelectionListener, MenuDragMouseListener, MenuKeyListener, MenuListener, PopupMenuListener, TableColumnModelListener, TableModelListener, TreeExpansionListener, TreeModelListener, TreeSelectionListener, TreeWillExpandListener, UndoableEditListener
public myComponent extends JComponent {
ChangeListener changeListener = null;
public synchronized void addChangeListener(ChangeListener l) {
changeListener = SwingEventMulticaster.add(changeListener, l);
}
public synchronized void removeChangeListener(ChangeListener l) {
changeListener = SwingEventMulticaster.remove(changeListener, l);
}
public void processEvent(SwingEvent e) {
// when event occurs which causes "action" semantic
ChangeListener listener = changeListener;
if (listener != null) {
listener.stateChanged(new ChangeEvent());
}
}
}
original source
http://www.fawcette.com/archives/premier/mgznarch/javapro/2001/01jan01/vc0101/vc0101.aspa, b| Modifier | Constructor and Description |
|---|---|
protected |
SwingEventMulticaster(EventListener a,
EventListener b) |
actionPerformed, add, add, add, add, add, add, add, add, add, add, add, add, add, add, add, add, add, adjustmentValueChanged, ancestorMoved, ancestorResized, caretPositionChanged, componentAdded, componentHidden, componentMoved, componentRemoved, componentResized, componentShown, focusGained, focusLost, getListeners, hierarchyChanged, inputMethodTextChanged, itemStateChanged, keyPressed, keyReleased, keyTyped, mouseClicked, mouseDragged, mouseEntered, mouseExited, mouseMoved, mousePressed, mouseReleased, mouseWheelMoved, remove, remove, remove, remove, remove, remove, remove, remove, remove, remove, remove, remove, remove, remove, remove, remove, remove, save, saveInternal, textValueChanged, windowActivated, windowClosed, windowClosing, windowDeactivated, windowDeiconified, windowGainedFocus, windowIconified, windowLostFocus, windowOpened, windowStateChangedprotected SwingEventMulticaster(EventListener a, EventListener b)
protected EventListener remove(EventListener oldl)
remove in class AWTEventMulticasteroldl - the listener to be removedpublic static void dumpList(EventListener l)
public void ancestorAdded(AncestorEvent event)
ancestorAdded in interface AncestorListenerpublic void ancestorRemoved(AncestorEvent event)
ancestorRemoved in interface AncestorListenerpublic void ancestorMoved(AncestorEvent event)
ancestorMoved in interface AncestorListenerpublic static AncestorListener add(AncestorListener a, AncestorListener b)
public static AncestorListener remove(AncestorListener l, AncestorListener oldl)
public void caretUpdate(CaretEvent event)
caretUpdate in interface CaretListenerpublic static CaretListener add(CaretListener a, CaretListener b)
public static CaretListener remove(CaretListener l, CaretListener oldl)
public void editingCanceled(ChangeEvent event)
editingCanceled in interface CellEditorListenerpublic void editingStopped(ChangeEvent event)
editingStopped in interface CellEditorListenerpublic static CellEditorListener add(CellEditorListener a, CellEditorListener b)
public static CellEditorListener remove(CellEditorListener l, CellEditorListener oldl)
public void stateChanged(ChangeEvent event)
stateChanged in interface ChangeListenerpublic static ChangeListener add(ChangeListener a, ChangeListener b)
public static ChangeListener remove(ChangeListener l, ChangeListener oldl)
public void insertUpdate(DocumentEvent event)
insertUpdate in interface DocumentListenerpublic void removeUpdate(DocumentEvent event)
removeUpdate in interface DocumentListenerpublic void changedUpdate(DocumentEvent event)
changedUpdate in interface DocumentListenerpublic static DocumentListener add(DocumentListener a, DocumentListener b)
public static DocumentListener remove(DocumentListener l, DocumentListener oldl)
public void hyperlinkUpdate(HyperlinkEvent event)
hyperlinkUpdate in interface HyperlinkListenerpublic static HyperlinkListener add(HyperlinkListener a, HyperlinkListener b)
public static HyperlinkListener remove(HyperlinkListener l, HyperlinkListener oldl)
public void internalFrameOpened(InternalFrameEvent event)
internalFrameOpened in interface InternalFrameListenerpublic void internalFrameClosing(InternalFrameEvent event)
internalFrameClosing in interface InternalFrameListenerpublic void internalFrameClosed(InternalFrameEvent event)
internalFrameClosed in interface InternalFrameListenerpublic void internalFrameIconified(InternalFrameEvent event)
internalFrameIconified in interface InternalFrameListenerpublic void internalFrameDeiconified(InternalFrameEvent event)
internalFrameDeiconified in interface InternalFrameListenerpublic void internalFrameActivated(InternalFrameEvent event)
internalFrameActivated in interface InternalFrameListenerpublic void internalFrameDeactivated(InternalFrameEvent event)
internalFrameDeactivated in interface InternalFrameListenerpublic static InternalFrameListener add(InternalFrameListener a, InternalFrameListener b)
public static InternalFrameListener remove(InternalFrameListener l, InternalFrameListener oldl)
public void intervalAdded(ListDataEvent event)
intervalAdded in interface ListDataListenerpublic void intervalRemoved(ListDataEvent event)
intervalRemoved in interface ListDataListenerpublic void contentsChanged(ListDataEvent event)
contentsChanged in interface ListDataListenerpublic static ListDataListener add(ListDataListener a, ListDataListener b)
public static ListDataListener remove(ListDataListener l, ListDataListener oldl)
public void valueChanged(ListSelectionEvent event)
valueChanged in interface ListSelectionListenerpublic static ListSelectionListener add(ListSelectionListener a, ListSelectionListener b)
public static ListSelectionListener remove(ListSelectionListener l, ListSelectionListener oldl)
public void menuDragMouseEntered(MenuDragMouseEvent event)
menuDragMouseEntered in interface MenuDragMouseListenerpublic void menuDragMouseExited(MenuDragMouseEvent event)
menuDragMouseExited in interface MenuDragMouseListenerpublic void menuDragMouseDragged(MenuDragMouseEvent event)
menuDragMouseDragged in interface MenuDragMouseListenerpublic void menuDragMouseReleased(MenuDragMouseEvent event)
menuDragMouseReleased in interface MenuDragMouseListenerpublic static MenuDragMouseListener add(MenuDragMouseListener a, MenuDragMouseListener b)
public static MenuDragMouseListener remove(MenuDragMouseListener l, MenuDragMouseListener oldl)
public void menuKeyTyped(MenuKeyEvent event)
menuKeyTyped in interface MenuKeyListenerpublic void menuKeyPressed(MenuKeyEvent event)
menuKeyPressed in interface MenuKeyListenerpublic void menuKeyReleased(MenuKeyEvent event)
menuKeyReleased in interface MenuKeyListenerpublic static MenuKeyListener add(MenuKeyListener a, MenuKeyListener b)
public static MenuKeyListener remove(MenuKeyListener l, MenuKeyListener oldl)
public void menuSelected(MenuEvent event)
menuSelected in interface MenuListenerpublic void menuDeselected(MenuEvent event)
menuDeselected in interface MenuListenerpublic void menuCanceled(MenuEvent event)
menuCanceled in interface MenuListenerpublic static MenuListener add(MenuListener a, MenuListener b)
public static MenuListener remove(MenuListener l, MenuListener oldl)
public void popupMenuWillBecomeVisible(PopupMenuEvent event)
popupMenuWillBecomeVisible in interface PopupMenuListenerpublic void popupMenuWillBecomeInvisible(PopupMenuEvent event)
popupMenuWillBecomeInvisible in interface PopupMenuListenerpublic void popupMenuCanceled(PopupMenuEvent event)
popupMenuCanceled in interface PopupMenuListenerpublic static PopupMenuListener add(PopupMenuListener a, PopupMenuListener b)
public static PopupMenuListener remove(PopupMenuListener l, PopupMenuListener oldl)
public void columnAdded(TableColumnModelEvent event)
columnAdded in interface TableColumnModelListenerpublic void columnRemoved(TableColumnModelEvent event)
columnRemoved in interface TableColumnModelListenerpublic void columnMoved(TableColumnModelEvent event)
columnMoved in interface TableColumnModelListenerpublic void columnMarginChanged(ChangeEvent event)
columnMarginChanged in interface TableColumnModelListenerpublic void columnSelectionChanged(ListSelectionEvent event)
columnSelectionChanged in interface TableColumnModelListenerpublic static TableColumnModelListener add(TableColumnModelListener a, TableColumnModelListener b)
public static TableColumnModelListener remove(TableColumnModelListener l, TableColumnModelListener oldl)
public void tableChanged(TableModelEvent event)
tableChanged in interface TableModelListenerpublic static TableModelListener add(TableModelListener a, TableModelListener b)
public static TableModelListener remove(TableModelListener l, TableModelListener oldl)
public void treeExpanded(TreeExpansionEvent event)
treeExpanded in interface TreeExpansionListenerpublic void treeCollapsed(TreeExpansionEvent event)
treeCollapsed in interface TreeExpansionListenerpublic static TreeExpansionListener add(TreeExpansionListener a, TreeExpansionListener b)
public static TreeExpansionListener remove(TreeExpansionListener l, TreeExpansionListener oldl)
public void treeNodesChanged(TreeModelEvent event)
treeNodesChanged in interface TreeModelListenerpublic void treeNodesInserted(TreeModelEvent event)
treeNodesInserted in interface TreeModelListenerpublic void treeNodesRemoved(TreeModelEvent event)
treeNodesRemoved in interface TreeModelListenerpublic void treeStructureChanged(TreeModelEvent event)
treeStructureChanged in interface TreeModelListenerpublic static TreeModelListener add(TreeModelListener a, TreeModelListener b)
public static TreeModelListener remove(TreeModelListener l, TreeModelListener oldl)
public void valueChanged(TreeSelectionEvent event)
valueChanged in interface TreeSelectionListenerpublic static TreeSelectionListener add(TreeSelectionListener a, TreeSelectionListener b)
public static TreeSelectionListener remove(TreeSelectionListener l, TreeSelectionListener oldl)
public void treeWillExpand(TreeExpansionEvent event) throws ExpandVetoException
treeWillExpand in interface TreeWillExpandListenerExpandVetoExceptionpublic void treeWillCollapse(TreeExpansionEvent event) throws ExpandVetoException
treeWillCollapse in interface TreeWillExpandListenerExpandVetoExceptionpublic static TreeWillExpandListener add(TreeWillExpandListener a, TreeWillExpandListener b)
public static TreeWillExpandListener remove(TreeWillExpandListener l, TreeWillExpandListener oldl)
public void undoableEditHappened(UndoableEditEvent event)
undoableEditHappened in interface UndoableEditListenerpublic static UndoableEditListener add(UndoableEditListener a, UndoableEditListener b)
public static UndoableEditListener remove(UndoableEditListener l, UndoableEditListener oldl)
protected static EventListener addInternal(EventListener a, EventListener b)
protected static EventListener removeInternal(EventListener l, EventListener oldl)
Copyright © 1996-2014 FreeHEP. All Rights Reserved.