Package jpicedt.graphic.event
Class PEEventMulticaster
- java.lang.Object
-
- java.awt.AWTEventMulticaster
-
- jpicedt.graphic.event.PEEventMulticaster
-
- All Implemented Interfaces:
java.awt.event.ActionListener,java.awt.event.AdjustmentListener,java.awt.event.ComponentListener,java.awt.event.ContainerListener,java.awt.event.FocusListener,java.awt.event.HierarchyBoundsListener,java.awt.event.HierarchyListener,java.awt.event.InputMethodListener,java.awt.event.ItemListener,java.awt.event.KeyListener,java.awt.event.MouseListener,java.awt.event.MouseMotionListener,java.awt.event.MouseWheelListener,java.awt.event.TextListener,java.awt.event.WindowFocusListener,java.awt.event.WindowListener,java.awt.event.WindowStateListener,java.util.EventListener,PEMouseInputListener
public class PEEventMulticaster extends java.awt.AWTEventMulticaster implements PEMouseInputListener
An enhanced version ofjava.awt.AWTEventMulticasterthat supports chainingPEMouseInputListener's.- Since:
- jpicedt 1.3.2
- Version:
- $Id: PEEventMulticaster.java,v 1.6.2.1 2007/09/02 11:56:18 reynal Exp $
- Author:
- Sylvain Reynal
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedPEEventMulticaster(java.util.EventListener a, java.util.EventListener b)Creates a PEEventMulticaster instance which chains listener-a with listener-b
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static PEMouseInputListeneradd(PEMouseInputListener a, PEMouseInputListener b)Adds PEMouseInputListener-a with PEMouseInputListener-b and returns the resulting multicast listener.protected static java.util.EventListeneraddInternal(java.util.EventListener a, java.util.EventListener b)Returns the multicast listener resulting from the addition of listener-a and listener-b.
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 PEEventMulticaster instance which chains a with b.voidmouseClicked(PEMouseEvent e)Handles a mouseClicked event by invoking the mouseClicked methods on listener-a and listener-b.voidmouseDragged(PEMouseEvent e)Handles the mouseDragged event by invoking the mouseDragged methods on listener-a and listener-b.voidmouseEntered(PEMouseEvent e)Handles the mouseEntered event by invoking the mouseEntered methods on listener-a and listener-b.voidmouseExited(PEMouseEvent e)Handles the mouseExited event by invoking the mouseExited methods on listener-a and listener-b.voidmouseMoved(PEMouseEvent e)Handles the mouseMoved event by invoking the mouseMoved methods on listener-a and listener-b.voidmousePressed(PEMouseEvent e)Handles the mousePressed event by invoking the mousePressed methods on listener-a and listener-b.voidmouseReleased(PEMouseEvent e)Handles the mouseReleased event by invoking the mouseReleased methods on listener-a and listener-b.protected java.util.EventListenerremove(java.util.EventListener oldl)Removes a listener from this multicaster and returns the resulting multicast listener.static PEMouseInputListenerremove(PEMouseInputListener l, PEMouseInputListener oldl)Removes the old PEMouseInputListener from PEMouseInputListener-l and returns the resulting multicast listener.protected static java.util.EventListenerremoveInternal(java.util.EventListener l, java.util.EventListener oldl)Returns the multicast listener obtained 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 AWTEventMulticaster, then removes the old listener from it.
Else, returns listener l.java.lang.StringtoString()-
Methods inherited from class java.awt.AWTEventMulticaster
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
-
-
-
-
Method Detail
-
add
public static PEMouseInputListener add(PEMouseInputListener a, PEMouseInputListener b)
Adds PEMouseInputListener-a with PEMouseInputListener-b and returns the resulting multicast listener.- Parameters:
a- PEMouseInputListener-ab- PEMouseInputListener-b
-
remove
public static PEMouseInputListener remove(PEMouseInputListener l, PEMouseInputListener oldl)
Removes the old PEMouseInputListener from PEMouseInputListener-l and returns the resulting multicast listener.- Parameters:
l- PEMouseInputListener-loldl- the PEMouseInputListener being removed
-
remove
protected java.util.EventListener remove(java.util.EventListener oldl)
Removes a listener from this multicaster and returns the resulting multicast listener.- Overrides:
removein classjava.awt.AWTEventMulticaster- Parameters:
oldl- the listener to be removed
-
addInternal
protected static java.util.EventListener addInternal(java.util.EventListener a, java.util.EventListener b)Returns the multicast listener resulting from the addition of listener-a and listener-b.
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 PEEventMulticaster instance which chains a with b.- Parameters:
a- event listener-ab- event listener-b
-
removeInternal
protected static java.util.EventListener removeInternal(java.util.EventListener l, java.util.EventListener oldl)Returns the multicast listener obtained 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 AWTEventMulticaster, then removes the old listener from it.
Else, returns listener l.- Parameters:
l- the listener being removed fromoldl- the listener being removed
-
mouseClicked
public void mouseClicked(PEMouseEvent e)
Handles a mouseClicked event by invoking the mouseClicked methods on listener-a and listener-b.- Specified by:
mouseClickedin interfacePEMouseInputListener- Parameters:
e- the mouse event
-
mousePressed
public void mousePressed(PEMouseEvent e)
Handles the mousePressed event by invoking the mousePressed methods on listener-a and listener-b.- Specified by:
mousePressedin interfacePEMouseInputListener- Parameters:
e- the mouse event
-
mouseReleased
public void mouseReleased(PEMouseEvent e)
Handles the mouseReleased event by invoking the mouseReleased methods on listener-a and listener-b.- Specified by:
mouseReleasedin interfacePEMouseInputListener- Parameters:
e- the mouse event
-
mouseEntered
public void mouseEntered(PEMouseEvent e)
Handles the mouseEntered event by invoking the mouseEntered methods on listener-a and listener-b.- Specified by:
mouseEnteredin interfacePEMouseInputListener- Parameters:
e- the mouse event
-
mouseExited
public void mouseExited(PEMouseEvent e)
Handles the mouseExited event by invoking the mouseExited methods on listener-a and listener-b.- Specified by:
mouseExitedin interfacePEMouseInputListener- Parameters:
e- the mouse event
-
mouseDragged
public void mouseDragged(PEMouseEvent e)
Handles the mouseDragged event by invoking the mouseDragged methods on listener-a and listener-b.- Specified by:
mouseDraggedin interfacePEMouseInputListener- Parameters:
e- the mouse event
-
mouseMoved
public void mouseMoved(PEMouseEvent e)
Handles the mouseMoved event by invoking the mouseMoved methods on listener-a and listener-b.- Specified by:
mouseMovedin interfacePEMouseInputListener- Parameters:
e- the mouse event
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-