當前位置: 首頁>>代碼示例>>Java>>正文


Java Container.isFocusTraversalPolicyProvider方法代碼示例

本文整理匯總了Java中java.awt.Container.isFocusTraversalPolicyProvider方法的典型用法代碼示例。如果您正苦於以下問題:Java Container.isFocusTraversalPolicyProvider方法的具體用法?Java Container.isFocusTraversalPolicyProvider怎麽用?Java Container.isFocusTraversalPolicyProvider使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在java.awt.Container的用法示例。


在下文中一共展示了Container.isFocusTraversalPolicyProvider方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: enumerateCycle

import java.awt.Container; //導入方法依賴的package包/類
private void enumerateCycle(Container container, List<Component> cycle) {
    if (!(container.isVisible() && container.isDisplayable())) {
        return;
    }

    cycle.add(container);

    Component[] components = container.getComponents();
    for (Component comp : components) {
        if (comp instanceof Container) {
            Container cont = (Container)comp;

            if (!cont.isFocusCycleRoot() &&
                !cont.isFocusTraversalPolicyProvider() &&
                !((cont instanceof JComponent) && ((JComponent)cont).isManagingFocus()))
            {
                enumerateCycle(cont, cycle);
                continue;
            }
        }
        cycle.add(comp);
    }
}
 
開發者ID:SunburstApps,項目名稱:OpenJSharp,代碼行數:24,代碼來源:SortingFocusTraversalPolicy.java

示例2: enumerateCycle

import java.awt.Container; //導入方法依賴的package包/類
@SuppressWarnings("deprecation")
private void enumerateCycle(Container container, List<Component> cycle) {
    if (!(container.isVisible() && container.isDisplayable())) {
        return;
    }

    cycle.add(container);

    Component[] components = container.getComponents();
    for (Component comp : components) {
        if (comp instanceof Container) {
            Container cont = (Container)comp;

            if (!cont.isFocusCycleRoot() &&
                !cont.isFocusTraversalPolicyProvider() &&
                !((cont instanceof JComponent) && ((JComponent)cont).isManagingFocus()))
            {
                enumerateCycle(cont, cycle);
                continue;
            }
        }
        cycle.add(comp);
    }
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:25,代碼來源:SortingFocusTraversalPolicy.java

示例3: getTopmostProvider

import java.awt.Container; //導入方法依賴的package包/類
Container getTopmostProvider(Container focusCycleRoot, Component aComponent) {
    Container aCont = aComponent.getParent();
    Container ftp = null;
    while (aCont  != focusCycleRoot && aCont != null) {
        if (aCont.isFocusTraversalPolicyProvider()) {
            ftp = aCont;
        }
        aCont = aCont.getParent();
    }
    if (aCont == null) {
        return null;
    }
    return ftp;
}
 
開發者ID:SunburstApps,項目名稱:OpenJSharp,代碼行數:15,代碼來源:SortingFocusTraversalPolicy.java

示例4: getComponentDownCycle

import java.awt.Container; //導入方法依賴的package包/類
private Component getComponentDownCycle(Component comp, int traversalDirection) {
    Component retComp = null;

    if (comp instanceof Container) {
        Container cont = (Container)comp;

        if (cont.isFocusCycleRoot()) {
            if (getImplicitDownCycleTraversal()) {
                retComp = cont.getFocusTraversalPolicy().getDefaultComponent(cont);

                if (retComp != null && log.isLoggable(PlatformLogger.Level.FINE)) {
                    log.fine("### Transfered focus down-cycle to " + retComp +
                             " in the focus cycle root " + cont);
                }
            } else {
                return null;
            }
        } else if (cont.isFocusTraversalPolicyProvider()) {
            retComp = (traversalDirection == FORWARD_TRAVERSAL ?
                       cont.getFocusTraversalPolicy().getDefaultComponent(cont) :
                       cont.getFocusTraversalPolicy().getLastComponent(cont));

            if (retComp != null && log.isLoggable(PlatformLogger.Level.FINE)) {
                log.fine("### Transfered focus to " + retComp + " in the FTP provider " + cont);
            }
        }
    }
    return retComp;
}
 
開發者ID:SunburstApps,項目名稱:OpenJSharp,代碼行數:30,代碼來源:SortingFocusTraversalPolicy.java

示例5: getLastComponent

import java.awt.Container; //導入方法依賴的package包/類
/**
 * Returns the last Component in the traversal cycle. This method is used
 * to determine the next Component to focus when traversal wraps in the
 * reverse direction.
 *
 * @param aContainer a focus cycle root of aComponent or a focus traversal policy provider whose
 *        last Component is to be returned
 * @return the last Component in the traversal cycle of aContainer,
 *         or null if no suitable Component can be found
 * @throws IllegalArgumentException if aContainer is null
 */
public Component getLastComponent(Container aContainer) {
    List<Component> cycle;
    if (log.isLoggable(PlatformLogger.Level.FINE)) {
        log.fine("### Getting last component in " + aContainer);
    }

    if (aContainer == null) {
        throw new IllegalArgumentException("aContainer cannot be null");
    }

    if (this.cachedRoot == aContainer) {
        cycle = this.cachedCycle;
    } else {
        cycle = getFocusTraversalCycle(aContainer);
    }

    if (cycle.size() == 0) {
        if (log.isLoggable(PlatformLogger.Level.FINE)) {
            log.fine("### Cycle is empty");
        }
        return null;
    }
    if (log.isLoggable(PlatformLogger.Level.FINE)) {
        log.fine("### Cycle is " + cycle);
    }

    for (int i= cycle.size() - 1; i >= 0; i--) {
        Component comp = cycle.get(i);
        if (accept(comp)) {
            return comp;
        } else if (comp instanceof Container && comp != aContainer) {
            Container cont = (Container)comp;
            if (cont.isFocusTraversalPolicyProvider()) {
                return cont.getFocusTraversalPolicy().getLastComponent(cont);
            }
        }
    }
    return null;
}
 
開發者ID:SunburstApps,項目名稱:OpenJSharp,代碼行數:51,代碼來源:SortingFocusTraversalPolicy.java

示例6: getLastComponent

import java.awt.Container; //導入方法依賴的package包/類
/**
 * Returns the last Component in the traversal cycle. This method is used
 * to determine the next Component to focus when traversal wraps in the
 * reverse direction.
 *
 * @param aContainer a focus cycle root of aComponent or a focus traversal policy provider whose
 *        last Component is to be returned
 * @return the last Component in the traversal cycle of aContainer,
 *         or null if no suitable Component can be found
 * @throws IllegalArgumentException if aContainer is null
 */
public Component getLastComponent(Container aContainer) {
    List<Component> cycle;
    if (log.isLoggable(PlatformLogger.Level.FINE)) {
        log.fine("### Getting last component in " + aContainer);
    }

    if (aContainer == null) {
        throw new IllegalArgumentException("aContainer cannot be null");
    }

    if (this.cachedRoot == aContainer) {
        cycle = this.cachedCycle;
    } else {
        cycle = getFocusTraversalCycle(aContainer);
    }

    if (cycle.size() == 0) {
        if (log.isLoggable(PlatformLogger.Level.FINE)) {
            log.fine("### Cycle is empty");
        }
        return null;
    }
    if (log.isLoggable(PlatformLogger.Level.FINE)) {
        log.fine("### Cycle is " + cycle);
    }

    for (int i= cycle.size() - 1; i >= 0; i--) {
        Component comp = cycle.get(i);
        if (accept(comp)) {
            return comp;
        } else if (comp instanceof Container && comp != aContainer) {
            Container cont = (Container)comp;
            if (cont.isFocusTraversalPolicyProvider()) {
                Component retComp = cont.getFocusTraversalPolicy().getLastComponent(cont);
                if (retComp != null) {
                    return retComp;
                }
            }
        }
    }
    return null;
}
 
開發者ID:lambdalab-mirror,項目名稱:jdk8u-jdk,代碼行數:54,代碼來源:SortingFocusTraversalPolicy.java


注:本文中的java.awt.Container.isFocusTraversalPolicyProvider方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。