http://www.jpicedt.org

jpicedt.graphic.event
Class PEEventMulticaster

java.lang.Object
  extended by java.awt.AWTEventMulticaster
      extended by jpicedt.graphic.event.PEEventMulticaster
All Implemented Interfaces:
ActionListener, AdjustmentListener, ComponentListener, ContainerListener, FocusListener, HierarchyBoundsListener, HierarchyListener, InputMethodListener, ItemListener, KeyListener, MouseListener, MouseMotionListener, MouseWheelListener, TextListener, WindowFocusListener, WindowListener, WindowStateListener, EventListener, PEMouseInputListener

public class PEEventMulticaster
extends AWTEventMulticaster
implements PEMouseInputListener

An enhanced version of java.awt.AWTEventMulticaster that supports chaining PEMouseInputListener's.

Since:
jpicedt 1.3.2
Version:
$Id: PEEventMulticaster.java,v 1.9 2013/03/27 07:06:32 vincentb1 Exp $
Author:
Sylvain Reynal

Field Summary
 
Fields inherited from class java.awt.AWTEventMulticaster
a, b
 
Constructor Summary
protected PEEventMulticaster(EventListener a, EventListener b)
          Creates a PEEventMulticaster instance which chains listener-a with listener-b
 
Method Summary
static PEMouseInputListener add(PEMouseInputListener a, PEMouseInputListener b)
          Adds PEMouseInputListenera” with PEMouseInputListenerb” and returns the resulting multicast listener.
protected static EventListener addInternal(EventListener a, EventListener b)
          Returns the multicast listener resulting from the addition of listener-a and listener-b.
 void mouseClicked(PEMouseEvent e)
          Handles a mouseClicked event by invoking the mouseClicked methods on listener-a and listener-b.
 void mouseDragged(PEMouseEvent e)
          Handles the mouseDragged event by invoking the mouseDragged methods on listener-a and listener-b.
 void mouseEntered(PEMouseEvent e)
          Handles the mouseEntered event by invoking the mouseEntered methods on listener-a and listener-b.
 void mouseExited(PEMouseEvent e)
          Handles the mouseExited event by invoking the mouseExited methods on listener-a and listener-b.
 void mouseMoved(PEMouseEvent e)
          Handles the mouseMoved event by invoking the mouseMoved methods on listener-a and listener-b.
 void mousePressed(PEMouseEvent e)
          Handles the mousePressed event by invoking the mousePressed methods on listener-a and listener-b.
 void mouseReleased(PEMouseEvent e)
          Handles the mouseReleased event by invoking the mouseReleased methods on listener-a and listener-b.
protected  EventListener remove(EventListener oldl)
          Removes a listener from this multicaster and returns the resulting multicast listener.
static PEMouseInputListener remove(PEMouseInputListener l, PEMouseInputListener oldl)
          Removes the old PEMouseInputListener from PEMouseInputListener-l and returns the resulting multicast listener.
protected static EventListener removeInternal(EventListener l, EventListener oldl)
          Returns the multicast listener obtained after removing the old listener from listener-l.
 String toString()
           
 
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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PEEventMulticaster

protected PEEventMulticaster(EventListener a,
                             EventListener b)
Creates a PEEventMulticaster instance which chains listener-a with listener-b

Method Detail

add

public static PEMouseInputListener add(PEMouseInputListener a,
                                       PEMouseInputListener b)
Adds PEMouseInputListenera” with PEMouseInputListenerb” and returns the resulting multicast listener.

Parameters:
a - PEMouseInputListenera
b - PEMouseInputListenerb

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-l
oldl - the PEMouseInputListener being removed

remove

protected EventListener remove(EventListener oldl)
Removes a listener from this multicaster and returns the resulting multicast listener.

Overrides:
remove in class AWTEventMulticaster
Parameters:
oldl - the listener to be removed

addInternal

protected static EventListener addInternal(EventListener a,
                                           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-a
b - event listener-b

removeInternal

protected static EventListener removeInternal(EventListener l,
                                              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 from
oldl - 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:
mouseClicked in interface PEMouseInputListener
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:
mousePressed in interface PEMouseInputListener
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:
mouseReleased in interface PEMouseInputListener
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:
mouseEntered in interface PEMouseInputListener
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:
mouseExited in interface PEMouseInputListener
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:
mouseDragged in interface PEMouseInputListener
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:
mouseMoved in interface PEMouseInputListener
Parameters:
e - the mouse event

toString

public String toString()
Overrides:
toString in class Object

http://www.jpicedt.org

Submit a bug : syd@jpicedt.org