當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。