Java Code Examples for java.awt.event.HierarchyBoundsListener

The following are top voted examples for showing how to use java.awt.event.HierarchyBoundsListener. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: javify   File: Component.java   View source code 6 votes vote down vote up
/**
 * Adds the specified listener to this component. This is harmless if the
 * listener is null, but if the listener has already been registered, it
 * will now be registered twice.
 *
 * @param listener the new listener to add
 * @see HierarchyEvent
 * @see #removeHierarchyBoundsListener(HierarchyBoundsListener)
 * @see #getHierarchyBoundsListeners()
 * @since 1.3
 */
public synchronized void
  addHierarchyBoundsListener(HierarchyBoundsListener listener)
{
  if (listener != null)
    {
      hierarchyBoundsListener =
        AWTEventMulticaster.add(hierarchyBoundsListener, listener);
      newEventsOnly = true;

      // Need to lock the tree, otherwise we might end up inconsistent.
      synchronized (getTreeLock())
      {
        numHierarchyBoundsListeners++;
        if (parent != null)
          parent.updateHierarchyListenerCount
                                   (AWTEvent.HIERARCHY_BOUNDS_EVENT_MASK, 1);
      }
    }
}
 
Example 2
Project: javify   File: Component.java   View source code 6 votes vote down vote up
/**
 * Removes the specified listener from the component. This is harmless if
 * the listener was not previously registered.
 *
 * @param listener the listener to remove
 * @see HierarchyEvent
 * @see #addHierarchyBoundsListener(HierarchyBoundsListener)
 * @see #getHierarchyBoundsListeners()
 * @since 1.3
 */
public synchronized void
  removeHierarchyBoundsListener(HierarchyBoundsListener listener)
{
  hierarchyBoundsListener =
    AWTEventMulticaster.remove(hierarchyBoundsListener, listener);

  // Need to lock the tree, otherwise we might end up inconsistent.
  synchronized (getTreeLock())
    {
      numHierarchyBoundsListeners--;
      if (parent != null)
        parent.updateHierarchyListenerCount
                                       (AWTEvent.HIERARCHY_BOUNDS_EVENT_MASK,
                                        -1);
    }
}
 
Example 3
Project: jvm-stm   File: Component.java   View source code 6 votes vote down vote up
/**
 * Adds the specified listener to this component. This is harmless if the
 * listener is null, but if the listener has already been registered, it
 * will now be registered twice.
 *
 * @param listener the new listener to add
 * @see HierarchyEvent
 * @see #removeHierarchyBoundsListener(HierarchyBoundsListener)
 * @see #getHierarchyBoundsListeners()
 * @since 1.3
 */
public synchronized void
  addHierarchyBoundsListener(HierarchyBoundsListener listener)
{
  if (listener != null)
    {
      hierarchyBoundsListener =
        AWTEventMulticaster.add(hierarchyBoundsListener, listener);
      newEventsOnly = true;

      // Need to lock the tree, otherwise we might end up inconsistent.
      synchronized (getTreeLock())
      {
        numHierarchyBoundsListeners++;
        if (parent != null)
          parent.updateHierarchyListenerCount
                                   (AWTEvent.HIERARCHY_BOUNDS_EVENT_MASK, 1);
      }
    }
}
 
Example 4
Project: jvm-stm   File: Component.java   View source code 6 votes vote down vote up
/**
 * Removes the specified listener from the component. This is harmless if
 * the listener was not previously registered.
 *
 * @param listener the listener to remove
 * @see HierarchyEvent
 * @see #addHierarchyBoundsListener(HierarchyBoundsListener)
 * @see #getHierarchyBoundsListeners()
 * @since 1.3
 */
public synchronized void
  removeHierarchyBoundsListener(HierarchyBoundsListener listener)
{
  hierarchyBoundsListener =
    AWTEventMulticaster.remove(hierarchyBoundsListener, listener);

  // Need to lock the tree, otherwise we might end up inconsistent.
  synchronized (getTreeLock())
    {
      numHierarchyBoundsListeners--;
      if (parent != null)
        parent.updateHierarchyListenerCount
                                       (AWTEvent.HIERARCHY_BOUNDS_EVENT_MASK,
                                        -1);
    }
}
 
Example 5
Project: cn1   File: Component.java   View source code 6 votes vote down vote up
@SuppressWarnings("unchecked")
public <T extends EventListener> T[] getListeners(Class<T> listenerType) {
    if (ComponentListener.class.isAssignableFrom(listenerType)) {
        return (T[]) getComponentListeners();
    } else if (FocusListener.class.isAssignableFrom(listenerType)) {
        return (T[]) getFocusListeners();
    } else if (HierarchyBoundsListener.class.isAssignableFrom(listenerType)) {
        return (T[]) getHierarchyBoundsListeners();
    } else if (HierarchyListener.class.isAssignableFrom(listenerType)) {
        return (T[]) getHierarchyListeners();
    } else if (InputMethodListener.class.isAssignableFrom(listenerType)) {
        return (T[]) getInputMethodListeners();
    } else if (KeyListener.class.isAssignableFrom(listenerType)) {
        return (T[]) getKeyListeners();
    } else if (MouseWheelListener.class.isAssignableFrom(listenerType)) {
        return (T[]) getMouseWheelListeners();
    } else if (MouseMotionListener.class.isAssignableFrom(listenerType)) {
        return (T[]) getMouseMotionListeners();
    } else if (MouseListener.class.isAssignableFrom(listenerType)) {
        return (T[]) getMouseListeners();
    } else if (PropertyChangeListener.class.isAssignableFrom(listenerType)) {
        return (T[]) getPropertyChangeListeners();
    }
    return (T[]) Array.newInstance(listenerType, 0);
}
 
Example 6
Project: JamVM-PH   File: Component.java   View source code 6 votes vote down vote up
/**
 * Adds the specified listener to this component. This is harmless if the
 * listener is null, but if the listener has already been registered, it
 * will now be registered twice.
 *
 * @param listener the new listener to add
 * @see HierarchyEvent
 * @see #removeHierarchyBoundsListener(HierarchyBoundsListener)
 * @see #getHierarchyBoundsListeners()
 * @since 1.3
 */
public synchronized void
  addHierarchyBoundsListener(HierarchyBoundsListener listener)
{
  if (listener != null)
    {
      hierarchyBoundsListener =
        AWTEventMulticaster.add(hierarchyBoundsListener, listener);
      newEventsOnly = true;

      // Need to lock the tree, otherwise we might end up inconsistent.
      synchronized (getTreeLock())
      {
        numHierarchyBoundsListeners++;
        if (parent != null)
          parent.updateHierarchyListenerCount
                                   (AWTEvent.HIERARCHY_BOUNDS_EVENT_MASK, 1);
      }
    }
}
 
Example 7
Project: JamVM-PH   File: Component.java   View source code 6 votes vote down vote up
/**
 * Removes the specified listener from the component. This is harmless if
 * the listener was not previously registered.
 *
 * @param listener the listener to remove
 * @see HierarchyEvent
 * @see #addHierarchyBoundsListener(HierarchyBoundsListener)
 * @see #getHierarchyBoundsListeners()
 * @since 1.3
 */
public synchronized void
  removeHierarchyBoundsListener(HierarchyBoundsListener listener)
{
  hierarchyBoundsListener =
    AWTEventMulticaster.remove(hierarchyBoundsListener, listener);

  // Need to lock the tree, otherwise we might end up inconsistent.
  synchronized (getTreeLock())
    {
      numHierarchyBoundsListeners--;
      if (parent != null)
        parent.updateHierarchyListenerCount
                                       (AWTEvent.HIERARCHY_BOUNDS_EVENT_MASK,
                                        -1);
    }
}
 
Example 8
Project: classpath   File: Component.java   View source code 6 votes vote down vote up
/**
 * Adds the specified listener to this component. This is harmless if the
 * listener is null, but if the listener has already been registered, it
 * will now be registered twice.
 *
 * @param listener the new listener to add
 * @see HierarchyEvent
 * @see #removeHierarchyBoundsListener(HierarchyBoundsListener)
 * @see #getHierarchyBoundsListeners()
 * @since 1.3
 */
public synchronized void
  addHierarchyBoundsListener(HierarchyBoundsListener listener)
{
  if (listener != null)
    {
      hierarchyBoundsListener =
        AWTEventMulticaster.add(hierarchyBoundsListener, listener);
      newEventsOnly = true;

      // Need to lock the tree, otherwise we might end up inconsistent.
      synchronized (getTreeLock())
      {
        numHierarchyBoundsListeners++;
        if (parent != null)
          parent.updateHierarchyListenerCount
                                   (AWTEvent.HIERARCHY_BOUNDS_EVENT_MASK, 1);
      }
    }
}
 
Example 9
Project: classpath   File: Component.java   View source code 6 votes vote down vote up
/**
 * Removes the specified listener from the component. This is harmless if
 * the listener was not previously registered.
 *
 * @param listener the listener to remove
 * @see HierarchyEvent
 * @see #addHierarchyBoundsListener(HierarchyBoundsListener)
 * @see #getHierarchyBoundsListeners()
 * @since 1.3
 */
public synchronized void
  removeHierarchyBoundsListener(HierarchyBoundsListener listener)
{
  hierarchyBoundsListener =
    AWTEventMulticaster.remove(hierarchyBoundsListener, listener);

  // Need to lock the tree, otherwise we might end up inconsistent.
  synchronized (getTreeLock())
    {
      numHierarchyBoundsListeners--;
      if (parent != null)
        parent.updateHierarchyListenerCount
                                       (AWTEvent.HIERARCHY_BOUNDS_EVENT_MASK,
                                        -1);
    }
}
 
Example 10
Project: freeVM   File: Component.java   View source code 6 votes vote down vote up
@SuppressWarnings("unchecked")
public <T extends EventListener> T[] getListeners(Class<T> listenerType) {
    if (ComponentListener.class.isAssignableFrom(listenerType)) {
        return (T[]) getComponentListeners();
    } else if (FocusListener.class.isAssignableFrom(listenerType)) {
        return (T[]) getFocusListeners();
    } else if (HierarchyBoundsListener.class.isAssignableFrom(listenerType)) {
        return (T[]) getHierarchyBoundsListeners();
    } else if (HierarchyListener.class.isAssignableFrom(listenerType)) {
        return (T[]) getHierarchyListeners();
    } else if (InputMethodListener.class.isAssignableFrom(listenerType)) {
        return (T[]) getInputMethodListeners();
    } else if (KeyListener.class.isAssignableFrom(listenerType)) {
        return (T[]) getKeyListeners();
    } else if (MouseWheelListener.class.isAssignableFrom(listenerType)) {
        return (T[]) getMouseWheelListeners();
    } else if (MouseMotionListener.class.isAssignableFrom(listenerType)) {
        return (T[]) getMouseMotionListeners();
    } else if (MouseListener.class.isAssignableFrom(listenerType)) {
        return (T[]) getMouseListeners();
    } else if (PropertyChangeListener.class.isAssignableFrom(listenerType)) {
        return (T[]) getPropertyChangeListeners();
    }
    return (T[]) Array.newInstance(listenerType, 0);
}
 
Example 11
Project: freeVM   File: Component.java   View source code 6 votes vote down vote up
@SuppressWarnings("unchecked")
public <T extends EventListener> T[] getListeners(Class<T> listenerType) {
    if (ComponentListener.class.isAssignableFrom(listenerType)) {
        return (T[]) getComponentListeners();
    } else if (FocusListener.class.isAssignableFrom(listenerType)) {
        return (T[]) getFocusListeners();
    } else if (HierarchyBoundsListener.class.isAssignableFrom(listenerType)) {
        return (T[]) getHierarchyBoundsListeners();
    } else if (HierarchyListener.class.isAssignableFrom(listenerType)) {
        return (T[]) getHierarchyListeners();
    } else if (InputMethodListener.class.isAssignableFrom(listenerType)) {
        return (T[]) getInputMethodListeners();
    } else if (KeyListener.class.isAssignableFrom(listenerType)) {
        return (T[]) getKeyListeners();
    } else if (MouseWheelListener.class.isAssignableFrom(listenerType)) {
        return (T[]) getMouseWheelListeners();
    } else if (MouseMotionListener.class.isAssignableFrom(listenerType)) {
        return (T[]) getMouseMotionListeners();
    } else if (MouseListener.class.isAssignableFrom(listenerType)) {
        return (T[]) getMouseListeners();
    } else if (PropertyChangeListener.class.isAssignableFrom(listenerType)) {
        return (T[]) getPropertyChangeListeners();
    }
    return (T[]) Array.newInstance(listenerType, 0);
}
 
Example 12
Project: javify   File: Component.java   View source code 5 votes vote down vote up
/**
 * Deserializes this component. This regenerates all serializable listeners
 * which were registered originally.
 *
 * @param s the stream to read from
 * @throws ClassNotFoundException if deserialization fails
 * @throws IOException if the stream fails
 */
private void readObject(ObjectInputStream s)
  throws ClassNotFoundException, IOException
{
  s.defaultReadObject();
  String key = (String) s.readObject();
  while (key != null)
    {
      Object listener = s.readObject();
      if ("componentL".equals(key))
        addComponentListener((ComponentListener) listener);
      else if ("focusL".equals(key))
        addFocusListener((FocusListener) listener);
      else if ("keyL".equals(key))
        addKeyListener((KeyListener) listener);
      else if ("mouseL".equals(key))
        addMouseListener((MouseListener) listener);
      else if ("mouseMotionL".equals(key))
        addMouseMotionListener((MouseMotionListener) listener);
      else if ("inputMethodL".equals(key))
        addInputMethodListener((InputMethodListener) listener);
      else if ("hierarchyL".equals(key))
        addHierarchyListener((HierarchyListener) listener);
      else if ("hierarchyBoundsL".equals(key))
        addHierarchyBoundsListener((HierarchyBoundsListener) listener);
      else if ("mouseWheelL".equals(key))
        addMouseWheelListener((MouseWheelListener) listener);
      key = (String) s.readObject();
    }
}
 
Example 13
Project: javify   File: StandaloneAppletWindow.java   View source code 5 votes vote down vote up
/**
 * Called when an ancestor component of the source is moved.
 *
 * @param e the event describing the ancestor's motion
 */
public void ancestorMoved(HierarchyEvent e)
{
  if (applet != null)
    {
      HierarchyBoundsListener[] l = applet.getHierarchyBoundsListeners();
      for (int i = 0; i < l.length; i++)
        l[i].ancestorMoved(e);
    }
}
 
Example 14
Project: javify   File: StandaloneAppletWindow.java   View source code 5 votes vote down vote up
/**
 * Called when an ancestor component is resized.
 *
 * @param e the event describing the ancestor's resizing
 */
public void ancestorResized(HierarchyEvent e)
{
  if (applet != null)
    {
      HierarchyBoundsListener[] l = applet.getHierarchyBoundsListeners();
      for (int i = 0; i < l.length; i++)
        l[i].ancestorResized(e);
    }
}
 
Example 15
Project: javify   File: PluginAppletWindow.java   View source code 5 votes vote down vote up
/**
 * Called when an ancestor component of the source is moved.
 *
 * @param e the event describing the ancestor's motion
 */
public void ancestorMoved(HierarchyEvent e)
{
  if (applet != null)
    {
      HierarchyBoundsListener[] l = applet.getHierarchyBoundsListeners();
      for (int i = 0; i < l.length; i++)
        l[i].ancestorMoved(e);
    }
}
 
Example 16
Project: javify   File: PluginAppletWindow.java   View source code 5 votes vote down vote up
/**
 * Called when an ancestor component is resized.
 *
 * @param e the event describing the ancestor's resizing
 */
public void ancestorResized(HierarchyEvent e)
{
  if (applet != null)
    {
      HierarchyBoundsListener[] l = applet.getHierarchyBoundsListeners();
      for (int i = 0; i < l.length; i++)
        l[i].ancestorResized(e);
    }
}
 
Example 17
Project: jvm-stm   File: Component.java   View source code 5 votes vote down vote up
/**
 * Deserializes this component. This regenerates all serializable listeners
 * which were registered originally.
 *
 * @param s the stream to read from
 * @throws ClassNotFoundException if deserialization fails
 * @throws IOException if the stream fails
 */
private void readObject(ObjectInputStream s)
  throws ClassNotFoundException, IOException
{
  s.defaultReadObject();
  String key = (String) s.readObject();
  while (key != null)
    {
      Object listener = s.readObject();
      if ("componentL".equals(key))
        addComponentListener((ComponentListener) listener);
      else if ("focusL".equals(key))
        addFocusListener((FocusListener) listener);
      else if ("keyL".equals(key))
        addKeyListener((KeyListener) listener);
      else if ("mouseL".equals(key))
        addMouseListener((MouseListener) listener);
      else if ("mouseMotionL".equals(key))
        addMouseMotionListener((MouseMotionListener) listener);
      else if ("inputMethodL".equals(key))
        addInputMethodListener((InputMethodListener) listener);
      else if ("hierarchyL".equals(key))
        addHierarchyListener((HierarchyListener) listener);
      else if ("hierarchyBoundsL".equals(key))
        addHierarchyBoundsListener((HierarchyBoundsListener) listener);
      else if ("mouseWheelL".equals(key))
        addMouseWheelListener((MouseWheelListener) listener);
      key = (String) s.readObject();
    }
}
 
Example 18
Project: jvm-stm   File: StandaloneAppletWindow.java   View source code 5 votes vote down vote up
/**
 * Called when an ancestor component of the source is moved.
 *
 * @param e the event describing the ancestor's motion
 */
public void ancestorMoved(HierarchyEvent e)
{
  if (applet != null)
    {
      HierarchyBoundsListener[] l = applet.getHierarchyBoundsListeners();
      for (int i = 0; i < l.length; i++)
        l[i].ancestorMoved(e);
    }
}
 
Example 19
Project: jvm-stm   File: StandaloneAppletWindow.java   View source code 5 votes vote down vote up
/**
 * Called when an ancestor component is resized.
 *
 * @param e the event describing the ancestor's resizing
 */
public void ancestorResized(HierarchyEvent e)
{
  if (applet != null)
    {
      HierarchyBoundsListener[] l = applet.getHierarchyBoundsListeners();
      for (int i = 0; i < l.length; i++)
        l[i].ancestorResized(e);
    }
}
 
Example 20
Project: jvm-stm   File: PluginAppletWindow.java   View source code 5 votes vote down vote up
/**
 * Called when an ancestor component of the source is moved.
 *
 * @param e the event describing the ancestor's motion
 */
public void ancestorMoved(HierarchyEvent e)
{
  if (applet != null)
    {
      HierarchyBoundsListener[] l = applet.getHierarchyBoundsListeners();
      for (int i = 0; i < l.length; i++)
        l[i].ancestorMoved(e);
    }
}
 
Example 21
Project: jvm-stm   File: PluginAppletWindow.java   View source code 5 votes vote down vote up
/**
 * Called when an ancestor component is resized.
 *
 * @param e the event describing the ancestor's resizing
 */
public void ancestorResized(HierarchyEvent e)
{
  if (applet != null)
    {
      HierarchyBoundsListener[] l = applet.getHierarchyBoundsListeners();
      for (int i = 0; i < l.length; i++)
        l[i].ancestorResized(e);
    }
}
 
Example 22
Project: cn1   File: AWTEventMulticaster.java   View source code 5 votes vote down vote up
public void ancestorMoved(HierarchyEvent e) {
    if ((a != null) && (a instanceof HierarchyBoundsListener)) {
        ((HierarchyBoundsListener) a).ancestorMoved(e);
    }
    if ((b != null) && (b instanceof HierarchyBoundsListener)) {
        ((HierarchyBoundsListener) b).ancestorMoved(e);
    }
}
 
Example 23
Project: cn1   File: AWTEventMulticaster.java   View source code 5 votes vote down vote up
public void ancestorResized(HierarchyEvent e) {
    if ((a != null) && (a instanceof HierarchyBoundsListener)) {
        ((HierarchyBoundsListener) a).ancestorResized(e);
    }
    if ((b != null) && (b instanceof HierarchyBoundsListener)) {
        ((HierarchyBoundsListener) b).ancestorResized(e);
    }
}
 
Example 24
Project: cn1   File: Component.java   View source code 5 votes vote down vote up
protected void processHierarchyBoundsEvent(HierarchyEvent e) {
    for (HierarchyBoundsListener listener : hierarchyBoundsListeners.getUserListeners()) {
        switch (e.getID()) {
            case HierarchyEvent.ANCESTOR_MOVED:
                listener.ancestorMoved(e);
                break;
            case HierarchyEvent.ANCESTOR_RESIZED:
                listener.ancestorResized(e);
                break;
        }
    }
}
 
Example 25
Project: JamVM-PH   File: Component.java   View source code 5 votes vote down vote up
/**
 * Deserializes this component. This regenerates all serializable listeners
 * which were registered originally.
 *
 * @param s the stream to read from
 * @throws ClassNotFoundException if deserialization fails
 * @throws IOException if the stream fails
 */
private void readObject(ObjectInputStream s)
  throws ClassNotFoundException, IOException
{
  s.defaultReadObject();
  String key = (String) s.readObject();
  while (key != null)
    {
      Object listener = s.readObject();
      if ("componentL".equals(key))
        addComponentListener((ComponentListener) listener);
      else if ("focusL".equals(key))
        addFocusListener((FocusListener) listener);
      else if ("keyL".equals(key))
        addKeyListener((KeyListener) listener);
      else if ("mouseL".equals(key))
        addMouseListener((MouseListener) listener);
      else if ("mouseMotionL".equals(key))
        addMouseMotionListener((MouseMotionListener) listener);
      else if ("inputMethodL".equals(key))
        addInputMethodListener((InputMethodListener) listener);
      else if ("hierarchyL".equals(key))
        addHierarchyListener((HierarchyListener) listener);
      else if ("hierarchyBoundsL".equals(key))
        addHierarchyBoundsListener((HierarchyBoundsListener) listener);
      else if ("mouseWheelL".equals(key))
        addMouseWheelListener((MouseWheelListener) listener);
      key = (String) s.readObject();
    }
}
 
Example 26
Project: JamVM-PH   File: StandaloneAppletWindow.java   View source code 5 votes vote down vote up
/**
 * Called when an ancestor component of the source is moved.
 *
 * @param e the event describing the ancestor's motion
 */
public void ancestorMoved(HierarchyEvent e)
{
  if (applet != null)
    {
      HierarchyBoundsListener[] l = applet.getHierarchyBoundsListeners();
      for (int i = 0; i < l.length; i++)
        l[i].ancestorMoved(e);
    }
}
 
Example 27
Project: JamVM-PH   File: StandaloneAppletWindow.java   View source code 5 votes vote down vote up
/**
 * Called when an ancestor component is resized.
 *
 * @param e the event describing the ancestor's resizing
 */
public void ancestorResized(HierarchyEvent e)
{
  if (applet != null)
    {
      HierarchyBoundsListener[] l = applet.getHierarchyBoundsListeners();
      for (int i = 0; i < l.length; i++)
        l[i].ancestorResized(e);
    }
}
 
Example 28
Project: JamVM-PH   File: PluginAppletWindow.java   View source code 5 votes vote down vote up
/**
 * Called when an ancestor component of the source is moved.
 *
 * @param e the event describing the ancestor's motion
 */
public void ancestorMoved(HierarchyEvent e)
{
  if (applet != null)
    {
      HierarchyBoundsListener[] l = applet.getHierarchyBoundsListeners();
      for (int i = 0; i < l.length; i++)
        l[i].ancestorMoved(e);
    }
}
 
Example 29
Project: JamVM-PH   File: PluginAppletWindow.java   View source code 5 votes vote down vote up
/**
 * Called when an ancestor component is resized.
 *
 * @param e the event describing the ancestor's resizing
 */
public void ancestorResized(HierarchyEvent e)
{
  if (applet != null)
    {
      HierarchyBoundsListener[] l = applet.getHierarchyBoundsListeners();
      for (int i = 0; i < l.length; i++)
        l[i].ancestorResized(e);
    }
}
 
Example 30
Project: classpath   File: Component.java   View source code 5 votes vote down vote up
/**
 * Deserializes this component. This regenerates all serializable listeners
 * which were registered originally.
 *
 * @param s the stream to read from
 * @throws ClassNotFoundException if deserialization fails
 * @throws IOException if the stream fails
 */
private void readObject(ObjectInputStream s)
  throws ClassNotFoundException, IOException
{
  s.defaultReadObject();
  String key = (String) s.readObject();
  while (key != null)
    {
      Object listener = s.readObject();
      if ("componentL".equals(key))
        addComponentListener((ComponentListener) listener);
      else if ("focusL".equals(key))
        addFocusListener((FocusListener) listener);
      else if ("keyL".equals(key))
        addKeyListener((KeyListener) listener);
      else if ("mouseL".equals(key))
        addMouseListener((MouseListener) listener);
      else if ("mouseMotionL".equals(key))
        addMouseMotionListener((MouseMotionListener) listener);
      else if ("inputMethodL".equals(key))
        addInputMethodListener((InputMethodListener) listener);
      else if ("hierarchyL".equals(key))
        addHierarchyListener((HierarchyListener) listener);
      else if ("hierarchyBoundsL".equals(key))
        addHierarchyBoundsListener((HierarchyBoundsListener) listener);
      else if ("mouseWheelL".equals(key))
        addMouseWheelListener((MouseWheelListener) listener);
      key = (String) s.readObject();
    }
}
 
Example 31
Project: classpath   File: StandaloneAppletWindow.java   View source code 5 votes vote down vote up
/**
 * Called when an ancestor component of the source is moved.
 *
 * @param e the event describing the ancestor's motion
 */
public void ancestorMoved(HierarchyEvent e)
{
  if (applet != null)
    {
      HierarchyBoundsListener[] l = applet.getHierarchyBoundsListeners();
      for (int i = 0; i < l.length; i++)
        l[i].ancestorMoved(e);
    }
}
 
Example 32
Project: classpath   File: StandaloneAppletWindow.java   View source code 5 votes vote down vote up
/**
 * Called when an ancestor component is resized.
 *
 * @param e the event describing the ancestor's resizing
 */
public void ancestorResized(HierarchyEvent e)
{
  if (applet != null)
    {
      HierarchyBoundsListener[] l = applet.getHierarchyBoundsListeners();
      for (int i = 0; i < l.length; i++)
        l[i].ancestorResized(e);
    }
}
 
Example 33
Project: classpath   File: PluginAppletWindow.java   View source code 5 votes vote down vote up
/**
 * Called when an ancestor component of the source is moved.
 *
 * @param e the event describing the ancestor's motion
 */
public void ancestorMoved(HierarchyEvent e)
{
  if (applet != null)
    {
      HierarchyBoundsListener[] l = applet.getHierarchyBoundsListeners();
      for (int i = 0; i < l.length; i++)
        l[i].ancestorMoved(e);
    }
}
 
Example 34
Project: classpath   File: PluginAppletWindow.java   View source code 5 votes vote down vote up
/**
 * Called when an ancestor component is resized.
 *
 * @param e the event describing the ancestor's resizing
 */
public void ancestorResized(HierarchyEvent e)
{
  if (applet != null)
    {
      HierarchyBoundsListener[] l = applet.getHierarchyBoundsListeners();
      for (int i = 0; i < l.length; i++)
        l[i].ancestorResized(e);
    }
}
 
Example 35
Project: freeVM   File: AWTEventMulticaster.java   View source code 5 votes vote down vote up
public void ancestorMoved(HierarchyEvent e) {
    if ((a != null) && (a instanceof HierarchyBoundsListener)) {
        ((HierarchyBoundsListener) a).ancestorMoved(e);
    }
    if ((b != null) && (b instanceof HierarchyBoundsListener)) {
        ((HierarchyBoundsListener) b).ancestorMoved(e);
    }
}
 
Example 36
Project: freeVM   File: AWTEventMulticaster.java   View source code 5 votes vote down vote up
public void ancestorResized(HierarchyEvent e) {
    if ((a != null) && (a instanceof HierarchyBoundsListener)) {
        ((HierarchyBoundsListener) a).ancestorResized(e);
    }
    if ((b != null) && (b instanceof HierarchyBoundsListener)) {
        ((HierarchyBoundsListener) b).ancestorResized(e);
    }
}
 
Example 37
Project: freeVM   File: Component.java   View source code 5 votes vote down vote up
protected void processHierarchyBoundsEvent(HierarchyEvent e) {
    for (HierarchyBoundsListener listener : hierarchyBoundsListeners.getUserListeners()) {
        switch (e.getID()) {
            case HierarchyEvent.ANCESTOR_MOVED:
                listener.ancestorMoved(e);
                break;
            case HierarchyEvent.ANCESTOR_RESIZED:
                listener.ancestorResized(e);
                break;
        }
    }
}
 
Example 38
Project: freeVM   File: AWTEventMulticaster.java   View source code 5 votes vote down vote up
public void ancestorMoved(HierarchyEvent e) {
    if ((a != null) && (a instanceof HierarchyBoundsListener)) {
        ((HierarchyBoundsListener) a).ancestorMoved(e);
    }
    if ((b != null) && (b instanceof HierarchyBoundsListener)) {
        ((HierarchyBoundsListener) b).ancestorMoved(e);
    }
}
 
Example 39
Project: freeVM   File: AWTEventMulticaster.java   View source code 5 votes vote down vote up
public void ancestorResized(HierarchyEvent e) {
    if ((a != null) && (a instanceof HierarchyBoundsListener)) {
        ((HierarchyBoundsListener) a).ancestorResized(e);
    }
    if ((b != null) && (b instanceof HierarchyBoundsListener)) {
        ((HierarchyBoundsListener) b).ancestorResized(e);
    }
}
 
Example 40
Project: freeVM   File: Component.java   View source code 5 votes vote down vote up
protected void processHierarchyBoundsEvent(HierarchyEvent e) {
    for (HierarchyBoundsListener listener : hierarchyBoundsListeners.getUserListeners()) {
        switch (e.getID()) {
            case HierarchyEvent.ANCESTOR_MOVED:
                listener.ancestorMoved(e);
                break;
            case HierarchyEvent.ANCESTOR_RESIZED:
                listener.ancestorResized(e);
                break;
        }
    }
}