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, windowStateChanged
protected SwingEventMulticaster(EventListener a, EventListener b)
protected EventListener remove(EventListener oldl)
remove
in class AWTEventMulticaster
oldl
- the listener to be removedpublic static void dumpList(EventListener l)
public void ancestorAdded(AncestorEvent event)
ancestorAdded
in interface AncestorListener
public void ancestorRemoved(AncestorEvent event)
ancestorRemoved
in interface AncestorListener
public void ancestorMoved(AncestorEvent event)
ancestorMoved
in interface AncestorListener
public static AncestorListener add(AncestorListener a, AncestorListener b)
public static AncestorListener remove(AncestorListener l, AncestorListener oldl)
public void caretUpdate(CaretEvent event)
caretUpdate
in interface CaretListener
public static CaretListener add(CaretListener a, CaretListener b)
public static CaretListener remove(CaretListener l, CaretListener oldl)
public void editingCanceled(ChangeEvent event)
editingCanceled
in interface CellEditorListener
public void editingStopped(ChangeEvent event)
editingStopped
in interface CellEditorListener
public static CellEditorListener add(CellEditorListener a, CellEditorListener b)
public static CellEditorListener remove(CellEditorListener l, CellEditorListener oldl)
public void stateChanged(ChangeEvent event)
stateChanged
in interface ChangeListener
public static ChangeListener add(ChangeListener a, ChangeListener b)
public static ChangeListener remove(ChangeListener l, ChangeListener oldl)
public void insertUpdate(DocumentEvent event)
insertUpdate
in interface DocumentListener
public void removeUpdate(DocumentEvent event)
removeUpdate
in interface DocumentListener
public void changedUpdate(DocumentEvent event)
changedUpdate
in interface DocumentListener
public static DocumentListener add(DocumentListener a, DocumentListener b)
public static DocumentListener remove(DocumentListener l, DocumentListener oldl)
public void hyperlinkUpdate(HyperlinkEvent event)
hyperlinkUpdate
in interface HyperlinkListener
public static HyperlinkListener add(HyperlinkListener a, HyperlinkListener b)
public static HyperlinkListener remove(HyperlinkListener l, HyperlinkListener oldl)
public void internalFrameOpened(InternalFrameEvent event)
internalFrameOpened
in interface InternalFrameListener
public void internalFrameClosing(InternalFrameEvent event)
internalFrameClosing
in interface InternalFrameListener
public void internalFrameClosed(InternalFrameEvent event)
internalFrameClosed
in interface InternalFrameListener
public void internalFrameIconified(InternalFrameEvent event)
internalFrameIconified
in interface InternalFrameListener
public void internalFrameDeiconified(InternalFrameEvent event)
internalFrameDeiconified
in interface InternalFrameListener
public void internalFrameActivated(InternalFrameEvent event)
internalFrameActivated
in interface InternalFrameListener
public void internalFrameDeactivated(InternalFrameEvent event)
internalFrameDeactivated
in interface InternalFrameListener
public static InternalFrameListener add(InternalFrameListener a, InternalFrameListener b)
public static InternalFrameListener remove(InternalFrameListener l, InternalFrameListener oldl)
public void intervalAdded(ListDataEvent event)
intervalAdded
in interface ListDataListener
public void intervalRemoved(ListDataEvent event)
intervalRemoved
in interface ListDataListener
public void contentsChanged(ListDataEvent event)
contentsChanged
in interface ListDataListener
public static ListDataListener add(ListDataListener a, ListDataListener b)
public static ListDataListener remove(ListDataListener l, ListDataListener oldl)
public void valueChanged(ListSelectionEvent event)
valueChanged
in interface ListSelectionListener
public static ListSelectionListener add(ListSelectionListener a, ListSelectionListener b)
public static ListSelectionListener remove(ListSelectionListener l, ListSelectionListener oldl)
public void menuDragMouseEntered(MenuDragMouseEvent event)
menuDragMouseEntered
in interface MenuDragMouseListener
public void menuDragMouseExited(MenuDragMouseEvent event)
menuDragMouseExited
in interface MenuDragMouseListener
public void menuDragMouseDragged(MenuDragMouseEvent event)
menuDragMouseDragged
in interface MenuDragMouseListener
public void menuDragMouseReleased(MenuDragMouseEvent event)
menuDragMouseReleased
in interface MenuDragMouseListener
public static MenuDragMouseListener add(MenuDragMouseListener a, MenuDragMouseListener b)
public static MenuDragMouseListener remove(MenuDragMouseListener l, MenuDragMouseListener oldl)
public void menuKeyTyped(MenuKeyEvent event)
menuKeyTyped
in interface MenuKeyListener
public void menuKeyPressed(MenuKeyEvent event)
menuKeyPressed
in interface MenuKeyListener
public void menuKeyReleased(MenuKeyEvent event)
menuKeyReleased
in interface MenuKeyListener
public static MenuKeyListener add(MenuKeyListener a, MenuKeyListener b)
public static MenuKeyListener remove(MenuKeyListener l, MenuKeyListener oldl)
public void menuSelected(MenuEvent event)
menuSelected
in interface MenuListener
public void menuDeselected(MenuEvent event)
menuDeselected
in interface MenuListener
public void menuCanceled(MenuEvent event)
menuCanceled
in interface MenuListener
public static MenuListener add(MenuListener a, MenuListener b)
public static MenuListener remove(MenuListener l, MenuListener oldl)
public void popupMenuWillBecomeVisible(PopupMenuEvent event)
popupMenuWillBecomeVisible
in interface PopupMenuListener
public void popupMenuWillBecomeInvisible(PopupMenuEvent event)
popupMenuWillBecomeInvisible
in interface PopupMenuListener
public void popupMenuCanceled(PopupMenuEvent event)
popupMenuCanceled
in interface PopupMenuListener
public static PopupMenuListener add(PopupMenuListener a, PopupMenuListener b)
public static PopupMenuListener remove(PopupMenuListener l, PopupMenuListener oldl)
public void columnAdded(TableColumnModelEvent event)
columnAdded
in interface TableColumnModelListener
public void columnRemoved(TableColumnModelEvent event)
columnRemoved
in interface TableColumnModelListener
public void columnMoved(TableColumnModelEvent event)
columnMoved
in interface TableColumnModelListener
public void columnMarginChanged(ChangeEvent event)
columnMarginChanged
in interface TableColumnModelListener
public void columnSelectionChanged(ListSelectionEvent event)
columnSelectionChanged
in interface TableColumnModelListener
public static TableColumnModelListener add(TableColumnModelListener a, TableColumnModelListener b)
public static TableColumnModelListener remove(TableColumnModelListener l, TableColumnModelListener oldl)
public void tableChanged(TableModelEvent event)
tableChanged
in interface TableModelListener
public static TableModelListener add(TableModelListener a, TableModelListener b)
public static TableModelListener remove(TableModelListener l, TableModelListener oldl)
public void treeExpanded(TreeExpansionEvent event)
treeExpanded
in interface TreeExpansionListener
public void treeCollapsed(TreeExpansionEvent event)
treeCollapsed
in interface TreeExpansionListener
public static TreeExpansionListener add(TreeExpansionListener a, TreeExpansionListener b)
public static TreeExpansionListener remove(TreeExpansionListener l, TreeExpansionListener oldl)
public void treeNodesChanged(TreeModelEvent event)
treeNodesChanged
in interface TreeModelListener
public void treeNodesInserted(TreeModelEvent event)
treeNodesInserted
in interface TreeModelListener
public void treeNodesRemoved(TreeModelEvent event)
treeNodesRemoved
in interface TreeModelListener
public void treeStructureChanged(TreeModelEvent event)
treeStructureChanged
in interface TreeModelListener
public static TreeModelListener add(TreeModelListener a, TreeModelListener b)
public static TreeModelListener remove(TreeModelListener l, TreeModelListener oldl)
public void valueChanged(TreeSelectionEvent event)
valueChanged
in interface TreeSelectionListener
public 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 TreeWillExpandListener
ExpandVetoException
public void treeWillCollapse(TreeExpansionEvent event) throws ExpandVetoException
treeWillCollapse
in interface TreeWillExpandListener
ExpandVetoException
public static TreeWillExpandListener add(TreeWillExpandListener a, TreeWillExpandListener b)
public static TreeWillExpandListener remove(TreeWillExpandListener l, TreeWillExpandListener oldl)
public void undoableEditHappened(UndoableEditEvent event)
undoableEditHappened
in interface UndoableEditListener
public 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.