Class 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 of java.awt.AWTEventMulticaster that supports chaining PEMouseInputListener'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
    • Field Summary

      • Fields inherited from class java.awt.AWTEventMulticaster

        a, b
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected PEEventMulticaster​(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 PEMouseInputListener add​(PEMouseInputListener a, PEMouseInputListener b)
      Adds PEMouseInputListener-a with PEMouseInputListener-b and returns the resulting multicast listener.
      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.
      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 java.util.EventListener remove​(java.util.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 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.
      java.lang.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​(java.util.EventListener a,
                                     java.util.EventListener b)
        Creates a PEEventMulticaster instance which chains listener-a with listener-b
    • Method Detail

      • 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 java.util.EventListener remove​(java.util.EventListener oldl)
        Removes a listener from this multicaster and returns the resulting multicast listener.
        Overrides:
        remove in class java.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-a
        b - 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 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 java.lang.String toString()
        Overrides:
        toString in class java.lang.Object