当前位置: 首页>>代码示例>>Java>>正文


Java AncestorListener类代码示例

本文整理汇总了Java中javax.swing.event.AncestorListener的典型用法代码示例。如果您正苦于以下问题:Java AncestorListener类的具体用法?Java AncestorListener怎么用?Java AncestorListener使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


AncestorListener类属于javax.swing.event包,在下文中一共展示了AncestorListener类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: addAncestorListener

import javax.swing.event.AncestorListener; //导入依赖的package包/类
/**
 * 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);
        }
    });
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:13,代码来源:JComponentOperator.java

示例2: removeAncestorListener

import javax.swing.event.AncestorListener; //导入依赖的package包/类
/**
 * 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);
        }
    });
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:13,代码来源:JComponentOperator.java

示例3: fireAncestorEvent

import javax.swing.event.AncestorListener; //导入依赖的package包/类
/**
 * 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);
    }
}
 
开发者ID:vilie,项目名称:javify,代码行数:43,代码来源:JComponent.java

示例4: fireAncestorEvent

import javax.swing.event.AncestorListener; //导入依赖的package包/类
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);
        }
    }
}
 
开发者ID:shannah,项目名称:cn1,代码行数:15,代码来源:JComponent.java

示例5: uninstall

import javax.swing.event.AncestorListener; //导入依赖的package包/类
/**
 * 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 );
        }
    }
}
 
开发者ID:pyros2097,项目名称:WebLookAndFeelLite,代码行数:15,代码来源:UpdateTimer.java

示例6: isInstalled

import javax.swing.event.AncestorListener; //导入依赖的package包/类
/**
 * 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;
}
 
开发者ID:pyros2097,项目名称:WebLookAndFeelLite,代码行数:16,代码来源:UpdateTimer.java

示例7: getAncestorListener

import javax.swing.event.AncestorListener; //导入依赖的package包/类
public AncestorListener getAncestorListener() {
    return ancestorListener;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:4,代码来源:FindInQuerySupport.java

示例8: addAncestorListener

import javax.swing.event.AncestorListener; //导入依赖的package包/类
/** Overridden to do nothing for performance reasons */
public @Override void addAncestorListener(AncestorListener l) {
    if (swingRendering) {
        super.addAncestorListener(l);
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:7,代码来源:HtmlRendererImpl.java

示例9: addAncestorListener

import javax.swing.event.AncestorListener; //导入依赖的package包/类
void addAncestorListener(AncestorListener l) {
}
 
开发者ID:javalovercn,项目名称:j2se_for_android,代码行数:3,代码来源:AncestorNotifier.java

示例10: removeAncestorListener

import javax.swing.event.AncestorListener; //导入依赖的package包/类
void removeAncestorListener(AncestorListener l) {
}
 
开发者ID:javalovercn,项目名称:j2se_for_android,代码行数:3,代码来源:AncestorNotifier.java

示例11: getAncestorListeners

import javax.swing.event.AncestorListener; //导入依赖的package包/类
AncestorListener[] getAncestorListeners() {
	return null;
}
 
开发者ID:javalovercn,项目名称:j2se_for_android,代码行数:4,代码来源:AncestorNotifier.java

示例12: addAncestorListener

import javax.swing.event.AncestorListener; //导入依赖的package包/类
public void addAncestorListener(final AncestorListener listener) {
	if(listener == null){
		return;
	}
	list.add(AncestorListener.class, listener);
}
 
开发者ID:javalovercn,项目名称:j2se_for_android,代码行数:7,代码来源:JComponent.java

示例13: removeAncestorListener

import javax.swing.event.AncestorListener; //导入依赖的package包/类
public void removeAncestorListener(final AncestorListener listener) {
	if(listener == null){
		return;
	}
	list.remove(AncestorListener.class, listener);
}
 
开发者ID:javalovercn,项目名称:j2se_for_android,代码行数:7,代码来源:JComponent.java

示例14: getAncestorListeners

import javax.swing.event.AncestorListener; //导入依赖的package包/类
public AncestorListener[] getAncestorListeners() {
	return list.getListeners(AncestorListener.class);
}
 
开发者ID:javalovercn,项目名称:j2se_for_android,代码行数:4,代码来源:JComponent.java

示例15: getAncestorListeners

import javax.swing.event.AncestorListener; //导入依赖的package包/类
@Override
public AncestorListener[] getAncestorListeners() {
  return JBroTableHeader.this.getAncestorListeners();
}
 
开发者ID:Qualtagh,项目名称:JBroTable,代码行数:5,代码来源:JBroTableHeader.java


注:本文中的javax.swing.event.AncestorListener类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。