Java 类javax.swing.event.AncestorListener 实例源码

项目:openjdk-jdk10    文件:JComponentOperator.java   
/**
 * Maps {@code JComponent.addAncestorListener(AncestorListener)}
 * through queue
 */
public void addAncestorListener(final AncestorListener ancestorListener) {
    runMapping(new MapVoidAction("addAncestorListener") {
        @Override
        public void map() {
            ((JComponent) getSource()).addAncestorListener(ancestorListener);
        }
    });
}
项目:openjdk-jdk10    文件:JComponentOperator.java   
/**
 * Maps {@code JComponent.removeAncestorListener(AncestorListener)}
 * through queue
 */
public void removeAncestorListener(final AncestorListener ancestorListener) {
    runMapping(new MapVoidAction("removeAncestorListener") {
        @Override
        public void map() {
            ((JComponent) getSource()).removeAncestorListener(ancestorListener);
        }
    });
}
项目:openjdk9    文件:JComponentOperator.java   
/**
 * Maps {@code JComponent.addAncestorListener(AncestorListener)}
 * through queue
 */
public void addAncestorListener(final AncestorListener ancestorListener) {
    runMapping(new MapVoidAction("addAncestorListener") {
        @Override
        public void map() {
            ((JComponent) getSource()).addAncestorListener(ancestorListener);
        }
    });
}
项目:openjdk9    文件:JComponentOperator.java   
/**
 * Maps {@code JComponent.removeAncestorListener(AncestorListener)}
 * through queue
 */
public void removeAncestorListener(final AncestorListener ancestorListener) {
    runMapping(new MapVoidAction("removeAncestorListener") {
        @Override
        public void map() {
            ((JComponent) getSource()).removeAncestorListener(ancestorListener);
        }
    });
}
项目:javify    文件:JComponent.java   
/**
 * Fires an AncestorEvent to this component's and all of its child
 * component's AncestorListeners.
 *
 * @param ancestor the component that triggered the event
 * @param id the kind of ancestor event that should be fired
 */
void fireAncestorEvent(JComponent ancestor, int id)
{
  // Fire event for registered ancestor listeners of this component.
  AncestorListener[] listeners = getAncestorListeners();
  if (listeners.length > 0)
    {
      AncestorEvent ev = new AncestorEvent(this, id,
                                           ancestor, ancestor.getParent());
      for (int i = 0; i < listeners.length; i++)
        {
          switch (id)
            {
            case AncestorEvent.ANCESTOR_MOVED:
              listeners[i].ancestorMoved(ev);
              break;
            case AncestorEvent.ANCESTOR_ADDED:
              listeners[i].ancestorAdded(ev);
              break;
            case AncestorEvent.ANCESTOR_REMOVED:
              listeners[i].ancestorRemoved(ev);
              break;
            }
        }
    }
  // Dispatch event to all children.
  int numChildren = getComponentCount();
  for (int i = 0; i < numChildren; i++)
    {
      Component child = getComponent(i);
      if (! (child instanceof JComponent))
        continue;
      JComponent jc = (JComponent) child;
      jc.fireAncestorEvent(ancestor, id);
    }
}
项目:jvm-stm    文件:JComponent.java   
/**
 * Fires an AncestorEvent to this component's and all of its child
 * component's AncestorListeners.
 *
 * @param ancestor the component that triggered the event
 * @param id the kind of ancestor event that should be fired
 */
void fireAncestorEvent(JComponent ancestor, int id)
{
  // Fire event for registered ancestor listeners of this component.
  AncestorListener[] listeners = getAncestorListeners();
  if (listeners.length > 0)
    {
      AncestorEvent ev = new AncestorEvent(this, id,
                                           ancestor, ancestor.getParent());
      for (int i = 0; i < listeners.length; i++)
        {
          switch (id)
            {
            case AncestorEvent.ANCESTOR_MOVED:
              listeners[i].ancestorMoved(ev);
              break;
            case AncestorEvent.ANCESTOR_ADDED:
              listeners[i].ancestorAdded(ev);
              break;
            case AncestorEvent.ANCESTOR_REMOVED:
              listeners[i].ancestorRemoved(ev);
              break;
            }
        }
    }
  // Dispatch event to all children.
  int numChildren = getComponentCount();
  for (int i = 0; i < numChildren; i++)
    {
      Component child = getComponent(i);
      if (! (child instanceof JComponent))
        continue;
      JComponent jc = (JComponent) child;
      jc.fireAncestorEvent(ancestor, id);
    }
}
项目:cn1    文件:JComponent.java   
private void fireAncestorEvent(int eventID, Container ancestor, Container ancestorParent) {
    final AncestorListener[] listeners = getAncestorListeners();
    AncestorEvent ancestorEvent = new AncestorEvent(JComponent.this, eventID, ancestor,
            ancestorParent);
    for (int i = 0; i < listeners.length; i++) {
        if (eventID == AncestorEvent.ANCESTOR_ADDED) {
            listeners[i].ancestorAdded(ancestorEvent);
        } else if (eventID == AncestorEvent.ANCESTOR_REMOVED) {
            listeners[i].ancestorRemoved(ancestorEvent);
        } else if (eventID == AncestorEvent.ANCESTOR_MOVED) {
            listeners[i].ancestorMoved(ancestorEvent);
        }
    }
}
项目:JamVM-PH    文件:JComponent.java   
/**
 * Fires an AncestorEvent to this component's and all of its child
 * component's AncestorListeners.
 *
 * @param ancestor the component that triggered the event
 * @param id the kind of ancestor event that should be fired
 */
void fireAncestorEvent(JComponent ancestor, int id)
{
  // Fire event for registered ancestor listeners of this component.
  AncestorListener[] listeners = getAncestorListeners();
  if (listeners.length > 0)
    {
      AncestorEvent ev = new AncestorEvent(this, id,
                                           ancestor, ancestor.getParent());
      for (int i = 0; i < listeners.length; i++)
        {
          switch (id)
            {
            case AncestorEvent.ANCESTOR_MOVED:
              listeners[i].ancestorMoved(ev);
              break;
            case AncestorEvent.ANCESTOR_ADDED:
              listeners[i].ancestorAdded(ev);
              break;
            case AncestorEvent.ANCESTOR_REMOVED:
              listeners[i].ancestorRemoved(ev);
              break;
            }
        }
    }
  // Dispatch event to all children.
  int numChildren = getComponentCount();
  for (int i = 0; i < numChildren; i++)
    {
      Component child = getComponent(i);
      if (! (child instanceof JComponent))
        continue;
      JComponent jc = (JComponent) child;
      jc.fireAncestorEvent(ancestor, id);
    }
}
项目:classpath    文件:JComponent.java   
/**
 * Fires an AncestorEvent to this component's and all of its child
 * component's AncestorListeners.
 *
 * @param ancestor the component that triggered the event
 * @param id the kind of ancestor event that should be fired
 */
void fireAncestorEvent(JComponent ancestor, int id)
{
  // Fire event for registered ancestor listeners of this component.
  AncestorListener[] listeners = getAncestorListeners();
  if (listeners.length > 0)
    {
      AncestorEvent ev = new AncestorEvent(this, id,
                                           ancestor, ancestor.getParent());
      for (int i = 0; i < listeners.length; i++)
        {
          switch (id)
            {
            case AncestorEvent.ANCESTOR_MOVED:
              listeners[i].ancestorMoved(ev);
              break;
            case AncestorEvent.ANCESTOR_ADDED:
              listeners[i].ancestorAdded(ev);
              break;
            case AncestorEvent.ANCESTOR_REMOVED:
              listeners[i].ancestorRemoved(ev);
              break;
            }
        }
    }
  // Dispatch event to all children.
  int numChildren = getComponentCount();
  for (int i = 0; i < numChildren; i++)
    {
      Component child = getComponent(i);
      if (! (child instanceof JComponent))
        continue;
      JComponent jc = (JComponent) child;
      jc.fireAncestorEvent(ancestor, id);
    }
}
项目:freeVM    文件:JComponent.java   
private void fireAncestorEvent(int eventID, Container ancestor, Container ancestorParent) {
    final AncestorListener[] listeners = getAncestorListeners();
    AncestorEvent ancestorEvent = new AncestorEvent(JComponent.this, eventID, ancestor,
            ancestorParent);
    for (int i = 0; i < listeners.length; i++) {
        if (eventID == AncestorEvent.ANCESTOR_ADDED) {
            listeners[i].ancestorAdded(ancestorEvent);
        } else if (eventID == AncestorEvent.ANCESTOR_REMOVED) {
            listeners[i].ancestorRemoved(ancestorEvent);
        } else if (eventID == AncestorEvent.ANCESTOR_MOVED) {
            listeners[i].ancestorMoved(ancestorEvent);
        }
    }
}
项目:freeVM    文件:JComponent.java   
private void fireAncestorEvent(int eventID, Container ancestor, Container ancestorParent) {
    final AncestorListener[] listeners = getAncestorListeners();
    AncestorEvent ancestorEvent = new AncestorEvent(JComponent.this, eventID, ancestor,
            ancestorParent);
    for (int i = 0; i < listeners.length; i++) {
        if (eventID == AncestorEvent.ANCESTOR_ADDED) {
            listeners[i].ancestorAdded(ancestorEvent);
        } else if (eventID == AncestorEvent.ANCESTOR_REMOVED) {
            listeners[i].ancestorRemoved(ancestorEvent);
        } else if (eventID == AncestorEvent.ANCESTOR_MOVED) {
            listeners[i].ancestorMoved(ancestorEvent);
        }
    }
}
项目:WebLookAndFeelLite    文件:UpdateTimer.java   
/**
 * Uninstalls any existing component updater from component
 */

public static void uninstall ( JComponent component )
{
    for ( AncestorListener listener : component.getAncestorListeners () )
    {
        if ( listener instanceof UpdateTimer )
        {
            component.removeAncestorListener ( listener );
        }
    }
}
项目:WebLookAndFeelLite    文件:UpdateTimer.java   
/**
 * Checks if component has any component updater installed
 */

public static boolean isInstalled ( JComponent component )
{
    for ( AncestorListener listener : component.getAncestorListeners () )
    {
        if ( listener instanceof UpdateTimer )
        {
            return true;
        }
    }
    return false;
}
项目:incubator-netbeans    文件:FindInQuerySupport.java   
public AncestorListener getAncestorListener() {
    return ancestorListener;
}
项目:incubator-netbeans    文件:HtmlRendererImpl.java   
/** Overridden to do nothing for performance reasons */
public @Override void addAncestorListener(AncestorListener l) {
    if (swingRendering) {
        super.addAncestorListener(l);
    }
}
项目:j2se_for_android    文件:AncestorNotifier.java   
void addAncestorListener(AncestorListener l) {
}
项目:j2se_for_android    文件:AncestorNotifier.java   
void removeAncestorListener(AncestorListener l) {
}
项目:j2se_for_android    文件:AncestorNotifier.java   
AncestorListener[] getAncestorListeners() {
    return null;
}
项目:j2se_for_android    文件:JComponent.java   
public void addAncestorListener(final AncestorListener listener) {
    if(listener == null){
        return;
    }
    list.add(AncestorListener.class, listener);
}
项目:j2se_for_android    文件:JComponent.java   
public void removeAncestorListener(final AncestorListener listener) {
    if(listener == null){
        return;
    }
    list.remove(AncestorListener.class, listener);
}
项目:j2se_for_android    文件:JComponent.java   
public AncestorListener[] getAncestorListeners() {
    return list.getListeners(AncestorListener.class);
}
项目:JBroTable    文件:JBroTableHeader.java   
@Override
public AncestorListener[] getAncestorListeners() {
  return JBroTableHeader.this.getAncestorListeners();
}
项目:JBroTable    文件:JBroTableHeader.java   
@Override
public void removeAncestorListener( AncestorListener listener ) {
  JBroTableHeader.this.removeAncestorListener( listener );
}
项目:JBroTable    文件:JBroTableHeader.java   
@Override
public void addAncestorListener( AncestorListener listener ) {
  JBroTableHeader.this.addAncestorListener( listener );
}
项目:cn1    文件:JComponent.java   
public void removeAncestorListener(AncestorListener ancestorListener) {
    listenerList.remove(AncestorListener.class, ancestorListener);
    removeAncestorComponentNotifier();
}
项目:cn1    文件:JComponent.java   
public void addAncestorListener(AncestorListener ancestorListener) {
    addAncestorComponentNotifier();
    listenerList.add(AncestorListener.class, ancestorListener);
}
项目:cn1    文件:JComponent.java   
public AncestorListener[] getAncestorListeners() {
    return getListeners(AncestorListener.class);
}
项目:GUITester-core    文件:GUIModelExtractor_JFC.java   
public String convertToString(Object comp, String key, Object value) {
  Accessible component = (Accessible) comp;
  if (value == null)
    return "null";

  if ("actionlisteners".equals(key))
    return JFCUtil.getListenerNames(ActionListener.class, value);
  else if ("ancestorlisteners".equals(key))
    return JFCUtil.getListenerNames(AncestorListener.class, value);
  else if ("componentlisteners".equals(key))
    return JFCUtil.getListenerNames(ComponentListener.class, value);
  else if ("windowlisteners".equals(key))
    return JFCUtil.getListenerNames(WindowListener.class, value);
  else if ("containerlisteners".equals(key))
    return JFCUtil.getListenerNames(ContainerListener.class, value);
  else if ("focuslisteners".equals(key))
    return JFCUtil.getListenerNames(FocusListener.class, value);
  else if ("hierarchyboundslisteners".equals(key))
    return JFCUtil.getListenerNames(HierarchyBoundsListener.class, value);
  else if ("hierarchylisteners".equals(key))
    return JFCUtil.getListenerNames(HierarchyListener.class, value);
  else if ("inputmethodlisteners".equals(key))
    return JFCUtil.getListenerNames(InputMethodListener.class, value);
  else if ("keylisteners".equals(key))
    return JFCUtil.getListenerNames(KeyListener.class, value);
  else if ("mouselisteners".equals(key))
    return JFCUtil.getListenerNames(MouseListener.class, value);
  else if ("mousemotionlisteners".equals(key))
    return JFCUtil.getListenerNames(MouseMotionListener.class, value);
  else if ("mousewheellisteners".equals(key))
    return JFCUtil.getListenerNames(MouseWheelListener.class, value);
  else if ("propertychangelisteners".equals(key))
    return JFCUtil.getListenerNames(PropertyChangeListener.class, value);
  else if ("vetoablechangelisteners".equals(key))
    return JFCUtil.getListenerNames(VetoableChangeListener.class, value);
  else if ("class".equals(key))
    return JFCUtil.getComponentClassName(component);
  else if ("icon".equals(key))
    return JFCUtil.getIconName(component);
  else if ("layout".equals(key))
    return JFCUtil.getLayoutName(component);

  return value.toString();
}
项目:freeVM    文件:JComponent.java   
public void removeAncestorListener(AncestorListener ancestorListener) {
    listenerList.remove(AncestorListener.class, ancestorListener);
    removeAncestorComponentNotifier();
}
项目:freeVM    文件:JComponent.java   
public void addAncestorListener(AncestorListener ancestorListener) {
    addAncestorComponentNotifier();
    listenerList.add(AncestorListener.class, ancestorListener);
}
项目:freeVM    文件:JComponent.java   
public AncestorListener[] getAncestorListeners() {
    return getListeners(AncestorListener.class);
}
项目:freeVM    文件:JComponent.java   
public void removeAncestorListener(AncestorListener ancestorListener) {
    listenerList.remove(AncestorListener.class, ancestorListener);
    removeAncestorComponentNotifier();
}
项目:freeVM    文件:JComponent.java   
public void addAncestorListener(AncestorListener ancestorListener) {
    addAncestorComponentNotifier();
    listenerList.add(AncestorListener.class, ancestorListener);
}
项目:freeVM    文件:JComponent.java   
public AncestorListener[] getAncestorListeners() {
    return getListeners(AncestorListener.class);
}
项目:freeVM    文件:InstrumentedAbstractButton.java   
public void addAncestorListener(AncestorListener arg0) {
    InstrumentedUILog.add("1");
    super.addAncestorListener(arg0);
}
项目:freeVM    文件:InstrumentedAbstractButton.java   
public AncestorListener[] getAncestorListeners() {
    InstrumentedUILog.add("25");
    return super.getAncestorListeners();
}
项目:freeVM    文件:InstrumentedAbstractButton.java   
public void removeAncestorListener(AncestorListener arg0) {
    InstrumentedUILog.add("89");
    super.removeAncestorListener(arg0);
}
项目:freeVM    文件:InstrumentedJTextComponent.java   
public AncestorListener[] getAncestorListeners() {
    InstrumentedUILog
            .add(new Object[] { "JTextComponent.getAncestorListeners" });
    return super.getAncestorListeners();
}
项目:freeVM    文件:InstrumentedJTextComponent.java   
public void addAncestorListener(AncestorListener arg0) {
    InstrumentedUILog.add(new Object[] {
            "JTextComponent.addAncestorListener", arg0 });
    super.addAncestorListener(arg0);
}
项目:freeVM    文件:InstrumentedJTextComponent.java   
public void removeAncestorListener(AncestorListener arg0) {
    InstrumentedUILog.add(new Object[] {
            "JTextComponent.removeAncestorListener", arg0 });
    super.removeAncestorListener(arg0);
}