Java 类sun.awt.EmbeddedFrame 实例源码

项目:OpenJSharp    文件:PopupFactory.java   
/**
 * Obtains the appropriate <code>Popup</code> based on
 * <code>popupType</code>.
 */
private Popup getPopup(Component owner, Component contents,
                       int ownerX, int ownerY, int popupType) {
    if (GraphicsEnvironment.isHeadless()) {
        return getHeadlessPopup(owner, contents, ownerX, ownerY);
    }

    switch(popupType) {
    case LIGHT_WEIGHT_POPUP:
        return getLightWeightPopup(owner, contents, ownerX, ownerY);
    case MEDIUM_WEIGHT_POPUP:
        return getMediumWeightPopup(owner, contents, ownerX, ownerY);
    case HEAVY_WEIGHT_POPUP:
        Popup popup = getHeavyWeightPopup(owner, contents, ownerX, ownerY);
        if ((AccessController.doPrivileged(OSInfo.getOSTypeAction()) ==
            OSInfo.OSType.MACOSX) && (owner != null) &&
            (EmbeddedFrame.getAppletIfAncestorOf(owner) != null)) {
            ((HeavyWeightPopup)popup).setCacheEnabled(false);
        }
        return popup;
    }
    return null;
}
项目:jdk8u-jdk    文件:PopupFactory.java   
/**
 * Obtains the appropriate <code>Popup</code> based on
 * <code>popupType</code>.
 */
private Popup getPopup(Component owner, Component contents,
                       int ownerX, int ownerY, int popupType) {
    if (GraphicsEnvironment.isHeadless()) {
        return getHeadlessPopup(owner, contents, ownerX, ownerY);
    }

    switch(popupType) {
    case LIGHT_WEIGHT_POPUP:
        return getLightWeightPopup(owner, contents, ownerX, ownerY);
    case MEDIUM_WEIGHT_POPUP:
        return getMediumWeightPopup(owner, contents, ownerX, ownerY);
    case HEAVY_WEIGHT_POPUP:
        Popup popup = getHeavyWeightPopup(owner, contents, ownerX, ownerY);
        if ((AccessController.doPrivileged(OSInfo.getOSTypeAction()) ==
            OSInfo.OSType.MACOSX) && (owner != null) &&
            (EmbeddedFrame.getAppletIfAncestorOf(owner) != null)) {
            ((HeavyWeightPopup)popup).setCacheEnabled(false);
        }
        return popup;
    }
    return null;
}
项目:openjdk-jdk10    文件:PopupFactory.java   
/**
 * Obtains the appropriate <code>Popup</code> based on
 * <code>popupType</code>.
 */
@SuppressWarnings("deprecation")
private Popup getPopup(Component owner, Component contents,
                       int ownerX, int ownerY, int popupType) {
    if (GraphicsEnvironment.isHeadless()) {
        return getHeadlessPopup(owner, contents, ownerX, ownerY);
    }

    switch(popupType) {
    case LIGHT_WEIGHT_POPUP:
        return getLightWeightPopup(owner, contents, ownerX, ownerY);
    case MEDIUM_WEIGHT_POPUP:
        return getMediumWeightPopup(owner, contents, ownerX, ownerY);
    case HEAVY_WEIGHT_POPUP:
        Popup popup = getHeavyWeightPopup(owner, contents, ownerX, ownerY);
        if ((AccessController.doPrivileged(OSInfo.getOSTypeAction()) ==
            OSInfo.OSType.MACOSX) && (owner != null) &&
            (EmbeddedFrame.getAppletIfAncestorOf(owner) != null)) {
            ((HeavyWeightPopup)popup).setCacheEnabled(false);
        }
        return popup;
    }
    return null;
}
项目:openjdk9    文件:PopupFactory.java   
/**
 * Obtains the appropriate <code>Popup</code> based on
 * <code>popupType</code>.
 */
private Popup getPopup(Component owner, Component contents,
                       int ownerX, int ownerY, int popupType) {
    if (GraphicsEnvironment.isHeadless()) {
        return getHeadlessPopup(owner, contents, ownerX, ownerY);
    }

    switch(popupType) {
    case LIGHT_WEIGHT_POPUP:
        return getLightWeightPopup(owner, contents, ownerX, ownerY);
    case MEDIUM_WEIGHT_POPUP:
        return getMediumWeightPopup(owner, contents, ownerX, ownerY);
    case HEAVY_WEIGHT_POPUP:
        Popup popup = getHeavyWeightPopup(owner, contents, ownerX, ownerY);
        if ((AccessController.doPrivileged(OSInfo.getOSTypeAction()) ==
            OSInfo.OSType.MACOSX) && (owner != null) &&
            (EmbeddedFrame.getAppletIfAncestorOf(owner) != null)) {
            ((HeavyWeightPopup)popup).setCacheEnabled(false);
        }
        return popup;
    }
    return null;
}
项目:Java8CN    文件:PopupFactory.java   
/**
 * Obtains the appropriate <code>Popup</code> based on
 * <code>popupType</code>.
 */
private Popup getPopup(Component owner, Component contents,
                       int ownerX, int ownerY, int popupType) {
    if (GraphicsEnvironment.isHeadless()) {
        return getHeadlessPopup(owner, contents, ownerX, ownerY);
    }

    switch(popupType) {
    case LIGHT_WEIGHT_POPUP:
        return getLightWeightPopup(owner, contents, ownerX, ownerY);
    case MEDIUM_WEIGHT_POPUP:
        return getMediumWeightPopup(owner, contents, ownerX, ownerY);
    case HEAVY_WEIGHT_POPUP:
        Popup popup = getHeavyWeightPopup(owner, contents, ownerX, ownerY);
        if ((AccessController.doPrivileged(OSInfo.getOSTypeAction()) ==
            OSInfo.OSType.MACOSX) && (owner != null) &&
            (EmbeddedFrame.getAppletIfAncestorOf(owner) != null)) {
            ((HeavyWeightPopup)popup).setCacheEnabled(false);
        }
        return popup;
    }
    return null;
}
项目:jdk8u_jdk    文件:PopupFactory.java   
/**
 * Obtains the appropriate <code>Popup</code> based on
 * <code>popupType</code>.
 */
private Popup getPopup(Component owner, Component contents,
                       int ownerX, int ownerY, int popupType) {
    if (GraphicsEnvironment.isHeadless()) {
        return getHeadlessPopup(owner, contents, ownerX, ownerY);
    }

    switch(popupType) {
    case LIGHT_WEIGHT_POPUP:
        return getLightWeightPopup(owner, contents, ownerX, ownerY);
    case MEDIUM_WEIGHT_POPUP:
        return getMediumWeightPopup(owner, contents, ownerX, ownerY);
    case HEAVY_WEIGHT_POPUP:
        Popup popup = getHeavyWeightPopup(owner, contents, ownerX, ownerY);
        if ((AccessController.doPrivileged(OSInfo.getOSTypeAction()) ==
            OSInfo.OSType.MACOSX) && (owner != null) &&
            (EmbeddedFrame.getAppletIfAncestorOf(owner) != null)) {
            ((HeavyWeightPopup)popup).setCacheEnabled(false);
        }
        return popup;
    }
    return null;
}
项目:lookaside_java-1.8.0-openjdk    文件:PopupFactory.java   
/**
 * Obtains the appropriate <code>Popup</code> based on
 * <code>popupType</code>.
 */
private Popup getPopup(Component owner, Component contents,
                       int ownerX, int ownerY, int popupType) {
    if (GraphicsEnvironment.isHeadless()) {
        return getHeadlessPopup(owner, contents, ownerX, ownerY);
    }

    switch(popupType) {
    case LIGHT_WEIGHT_POPUP:
        return getLightWeightPopup(owner, contents, ownerX, ownerY);
    case MEDIUM_WEIGHT_POPUP:
        return getMediumWeightPopup(owner, contents, ownerX, ownerY);
    case HEAVY_WEIGHT_POPUP:
        Popup popup = getHeavyWeightPopup(owner, contents, ownerX, ownerY);
        if ((AccessController.doPrivileged(OSInfo.getOSTypeAction()) ==
            OSInfo.OSType.MACOSX) && (owner != null) &&
            (EmbeddedFrame.getAppletIfAncestorOf(owner) != null)) {
            ((HeavyWeightPopup)popup).setCacheEnabled(false);
        }
        return popup;
    }
    return null;
}
项目:infobip-open-jdk-8    文件:PopupFactory.java   
/**
 * Obtains the appropriate <code>Popup</code> based on
 * <code>popupType</code>.
 */
private Popup getPopup(Component owner, Component contents,
                       int ownerX, int ownerY, int popupType) {
    if (GraphicsEnvironment.isHeadless()) {
        return getHeadlessPopup(owner, contents, ownerX, ownerY);
    }

    switch(popupType) {
    case LIGHT_WEIGHT_POPUP:
        return getLightWeightPopup(owner, contents, ownerX, ownerY);
    case MEDIUM_WEIGHT_POPUP:
        return getMediumWeightPopup(owner, contents, ownerX, ownerY);
    case HEAVY_WEIGHT_POPUP:
        Popup popup = getHeavyWeightPopup(owner, contents, ownerX, ownerY);
        if ((AccessController.doPrivileged(OSInfo.getOSTypeAction()) ==
            OSInfo.OSType.MACOSX) && (owner != null) &&
            (EmbeddedFrame.getAppletIfAncestorOf(owner) != null)) {
            ((HeavyWeightPopup)popup).setCacheEnabled(false);
        }
        return popup;
    }
    return null;
}
项目:jdk8u-dev-jdk    文件:PopupFactory.java   
/**
 * Obtains the appropriate <code>Popup</code> based on
 * <code>popupType</code>.
 */
private Popup getPopup(Component owner, Component contents,
                       int ownerX, int ownerY, int popupType) {
    if (GraphicsEnvironment.isHeadless()) {
        return getHeadlessPopup(owner, contents, ownerX, ownerY);
    }

    switch(popupType) {
    case LIGHT_WEIGHT_POPUP:
        return getLightWeightPopup(owner, contents, ownerX, ownerY);
    case MEDIUM_WEIGHT_POPUP:
        return getMediumWeightPopup(owner, contents, ownerX, ownerY);
    case HEAVY_WEIGHT_POPUP:
        Popup popup = getHeavyWeightPopup(owner, contents, ownerX, ownerY);
        if ((AccessController.doPrivileged(OSInfo.getOSTypeAction()) ==
            OSInfo.OSType.MACOSX) && (owner != null) &&
            (EmbeddedFrame.getAppletIfAncestorOf(owner) != null)) {
            ((HeavyWeightPopup)popup).setCacheEnabled(false);
        }
        return popup;
    }
    return null;
}
项目:OpenJSharp    文件:Component.java   
final Component getNextFocusCandidate() {
    Container rootAncestor = getTraversalRoot();
    Component comp = this;
    while (rootAncestor != null &&
           !(rootAncestor.isShowing() && rootAncestor.canBeFocusOwner()))
    {
        comp = rootAncestor;
        rootAncestor = comp.getFocusCycleRootAncestor();
    }
    if (focusLog.isLoggable(PlatformLogger.Level.FINER)) {
        focusLog.finer("comp = " + comp + ", root = " + rootAncestor);
    }
    Component candidate = null;
    if (rootAncestor != null) {
        FocusTraversalPolicy policy = rootAncestor.getFocusTraversalPolicy();
        Component toFocus = policy.getComponentAfter(rootAncestor, comp);
        if (focusLog.isLoggable(PlatformLogger.Level.FINER)) {
            focusLog.finer("component after is " + toFocus);
        }
        if (toFocus == null) {
            toFocus = policy.getDefaultComponent(rootAncestor);
            if (focusLog.isLoggable(PlatformLogger.Level.FINER)) {
                focusLog.finer("default component is " + toFocus);
            }
        }
        if (toFocus == null) {
            Applet applet = EmbeddedFrame.getAppletIfAncestorOf(this);
            if (applet != null) {
                toFocus = applet;
            }
        }
        candidate = toFocus;
    }
    if (focusLog.isLoggable(PlatformLogger.Level.FINER)) {
        focusLog.finer("Focus transfer candidate: " + candidate);
    }
    return candidate;
}
项目:OpenJSharp    文件:AppletPanel.java   
private void setDefaultFocus() {
    Component toFocus = null;
    Container parent = getParent();

    if(parent != null) {
        if (parent instanceof Window) {
            toFocus = getMostRecentFocusOwnerForWindow((Window)parent);
            if (toFocus == parent || toFocus == null) {
                toFocus = parent.getFocusTraversalPolicy().
                    getInitialComponent((Window)parent);
            }
        } else if (parent.isFocusCycleRoot()) {
            toFocus = parent.getFocusTraversalPolicy().
                getDefaultComponent(parent);
        }
    }

    if (toFocus != null) {
        if (parent instanceof EmbeddedFrame) {
            ((EmbeddedFrame)parent).synthesizeWindowActivation(true);
        }
        // EmbeddedFrame might have focus before the applet was added.
        // Thus after its activation the most recent focus owner will be
        // restored. We need the applet's initial focusabled component to
        // be focused here.
        toFocus.requestFocusInWindow();
    }
}
项目:OpenJSharp    文件:XEmbeddedFramePeer.java   
public XEmbeddedFramePeer(EmbeddedFrame target) {
    // Don't specify PARENT_WINDOW param here. Instead we reparent
    // this embedded frame peer to the proper parent window after
    // an XEventDispatcher is registered to handle XEmbed events
    super(new XCreateWindowParams(new Object[] {
        TARGET, target,
        VISIBLE, Boolean.TRUE,
        EMBEDDED, Boolean.TRUE}));
}
项目:jdk8u-jdk    文件:Component.java   
final Component getNextFocusCandidate() {
    Container rootAncestor = getTraversalRoot();
    Component comp = this;
    while (rootAncestor != null &&
           !(rootAncestor.isShowing() && rootAncestor.canBeFocusOwner()))
    {
        comp = rootAncestor;
        rootAncestor = comp.getFocusCycleRootAncestor();
    }
    if (focusLog.isLoggable(PlatformLogger.Level.FINER)) {
        focusLog.finer("comp = " + comp + ", root = " + rootAncestor);
    }
    Component candidate = null;
    if (rootAncestor != null) {
        FocusTraversalPolicy policy = rootAncestor.getFocusTraversalPolicy();
        Component toFocus = policy.getComponentAfter(rootAncestor, comp);
        if (focusLog.isLoggable(PlatformLogger.Level.FINER)) {
            focusLog.finer("component after is " + toFocus);
        }
        if (toFocus == null) {
            toFocus = policy.getDefaultComponent(rootAncestor);
            if (focusLog.isLoggable(PlatformLogger.Level.FINER)) {
                focusLog.finer("default component is " + toFocus);
            }
        }
        if (toFocus == null) {
            Applet applet = EmbeddedFrame.getAppletIfAncestorOf(this);
            if (applet != null) {
                toFocus = applet;
            }
        }
        candidate = toFocus;
    }
    if (focusLog.isLoggable(PlatformLogger.Level.FINER)) {
        focusLog.finer("Focus transfer candidate: " + candidate);
    }
    return candidate;
}
项目:jdk8u-jdk    文件:AppletPanel.java   
private void setDefaultFocus() {
    Component toFocus = null;
    Container parent = getParent();

    if(parent != null) {
        if (parent instanceof Window) {
            toFocus = getMostRecentFocusOwnerForWindow((Window)parent);
            if (toFocus == parent || toFocus == null) {
                toFocus = parent.getFocusTraversalPolicy().
                    getInitialComponent((Window)parent);
            }
        } else if (parent.isFocusCycleRoot()) {
            toFocus = parent.getFocusTraversalPolicy().
                getDefaultComponent(parent);
        }
    }

    if (toFocus != null) {
        if (parent instanceof EmbeddedFrame) {
            ((EmbeddedFrame) parent).synthesizeWindowActivation(true);
        }
        // EmbeddedFrame might have focus before the applet was added.
        // Thus after its activation the most recent focus owner will be
        // restored. We need the applet's initial focusabled component to
        // be focused here.
        toFocus.requestFocusInWindow();
    }
}
项目:jdk8u-jdk    文件:XEmbeddedFramePeer.java   
public XEmbeddedFramePeer(EmbeddedFrame target) {
    // Don't specify PARENT_WINDOW param here. Instead we reparent
    // this embedded frame peer to the proper parent window after
    // an XEventDispatcher is registered to handle XEmbed events
    super(new XCreateWindowParams(new Object[] {
        TARGET, target,
        VISIBLE, Boolean.TRUE,
        EMBEDDED, Boolean.TRUE}));
}
项目:openjdk-jdk10    文件:Component.java   
@SuppressWarnings("deprecation")
final Component getNextFocusCandidate() {
    Container rootAncestor = getTraversalRoot();
    Component comp = this;
    while (rootAncestor != null &&
           !(rootAncestor.isShowing() && rootAncestor.canBeFocusOwner()))
    {
        comp = rootAncestor;
        rootAncestor = comp.getFocusCycleRootAncestor();
    }
    if (focusLog.isLoggable(PlatformLogger.Level.FINER)) {
        focusLog.finer("comp = " + comp + ", root = " + rootAncestor);
    }
    Component candidate = null;
    if (rootAncestor != null) {
        FocusTraversalPolicy policy = rootAncestor.getFocusTraversalPolicy();
        Component toFocus = policy.getComponentAfter(rootAncestor, comp);
        if (focusLog.isLoggable(PlatformLogger.Level.FINER)) {
            focusLog.finer("component after is " + toFocus);
        }
        if (toFocus == null) {
            toFocus = policy.getDefaultComponent(rootAncestor);
            if (focusLog.isLoggable(PlatformLogger.Level.FINER)) {
                focusLog.finer("default component is " + toFocus);
            }
        }
        if (toFocus == null) {
            Applet applet = EmbeddedFrame.getAppletIfAncestorOf(this);
            if (applet != null) {
                toFocus = applet;
            }
        }
        candidate = toFocus;
    }
    if (focusLog.isLoggable(PlatformLogger.Level.FINER)) {
        focusLog.finer("Focus transfer candidate: " + candidate);
    }
    return candidate;
}
项目:openjdk-jdk10    文件:AppletPanel.java   
private void setDefaultFocus() {
    Component toFocus = null;
    Container parent = getParent();

    if(parent != null) {
        if (parent instanceof Window) {
            toFocus = getMostRecentFocusOwnerForWindow((Window)parent);
            if (toFocus == parent || toFocus == null) {
                toFocus = parent.getFocusTraversalPolicy().
                    getInitialComponent((Window)parent);
            }
        } else if (parent.isFocusCycleRoot()) {
            toFocus = parent.getFocusTraversalPolicy().
                getDefaultComponent(parent);
        }
    }

    if (toFocus != null) {
        if (parent instanceof EmbeddedFrame) {
            ((EmbeddedFrame) parent).synthesizeWindowActivation(true);
        }
        // EmbeddedFrame might have focus before the applet was added.
        // Thus after its activation the most recent focus owner will be
        // restored. We need the applet's initial focusabled component to
        // be focused here.
        toFocus.requestFocusInWindow();
    }
}
项目:openjdk-jdk10    文件:XEmbeddedFramePeer.java   
public XEmbeddedFramePeer(EmbeddedFrame target) {
    // Don't specify PARENT_WINDOW param here. Instead we reparent
    // this embedded frame peer to the proper parent window after
    // an XEventDispatcher is registered to handle XEmbed events
    super(new XCreateWindowParams(new Object[] {
        TARGET, target,
        VISIBLE, Boolean.TRUE,
        EMBEDDED, Boolean.TRUE}));
}
项目:openjdk9    文件:Component.java   
final Component getNextFocusCandidate() {
    Container rootAncestor = getTraversalRoot();
    Component comp = this;
    while (rootAncestor != null &&
           !(rootAncestor.isShowing() && rootAncestor.canBeFocusOwner()))
    {
        comp = rootAncestor;
        rootAncestor = comp.getFocusCycleRootAncestor();
    }
    if (focusLog.isLoggable(PlatformLogger.Level.FINER)) {
        focusLog.finer("comp = " + comp + ", root = " + rootAncestor);
    }
    Component candidate = null;
    if (rootAncestor != null) {
        FocusTraversalPolicy policy = rootAncestor.getFocusTraversalPolicy();
        Component toFocus = policy.getComponentAfter(rootAncestor, comp);
        if (focusLog.isLoggable(PlatformLogger.Level.FINER)) {
            focusLog.finer("component after is " + toFocus);
        }
        if (toFocus == null) {
            toFocus = policy.getDefaultComponent(rootAncestor);
            if (focusLog.isLoggable(PlatformLogger.Level.FINER)) {
                focusLog.finer("default component is " + toFocus);
            }
        }
        if (toFocus == null) {
            Applet applet = EmbeddedFrame.getAppletIfAncestorOf(this);
            if (applet != null) {
                toFocus = applet;
            }
        }
        candidate = toFocus;
    }
    if (focusLog.isLoggable(PlatformLogger.Level.FINER)) {
        focusLog.finer("Focus transfer candidate: " + candidate);
    }
    return candidate;
}
项目:openjdk9    文件:AppletPanel.java   
private void setDefaultFocus() {
    Component toFocus = null;
    Container parent = getParent();

    if(parent != null) {
        if (parent instanceof Window) {
            toFocus = getMostRecentFocusOwnerForWindow((Window)parent);
            if (toFocus == parent || toFocus == null) {
                toFocus = parent.getFocusTraversalPolicy().
                    getInitialComponent((Window)parent);
            }
        } else if (parent.isFocusCycleRoot()) {
            toFocus = parent.getFocusTraversalPolicy().
                getDefaultComponent(parent);
        }
    }

    if (toFocus != null) {
        if (parent instanceof EmbeddedFrame) {
            ((EmbeddedFrame) parent).synthesizeWindowActivation(true);
        }
        // EmbeddedFrame might have focus before the applet was added.
        // Thus after its activation the most recent focus owner will be
        // restored. We need the applet's initial focusabled component to
        // be focused here.
        toFocus.requestFocusInWindow();
    }
}
项目:openjdk9    文件:XEmbeddedFramePeer.java   
public XEmbeddedFramePeer(EmbeddedFrame target) {
    // Don't specify PARENT_WINDOW param here. Instead we reparent
    // this embedded frame peer to the proper parent window after
    // an XEventDispatcher is registered to handle XEmbed events
    super(new XCreateWindowParams(new Object[] {
        TARGET, target,
        VISIBLE, Boolean.TRUE,
        EMBEDDED, Boolean.TRUE}));
}
项目:Java8CN    文件:Component.java   
final Component getNextFocusCandidate() {
    Container rootAncestor = getTraversalRoot();
    Component comp = this;
    while (rootAncestor != null &&
           !(rootAncestor.isShowing() && rootAncestor.canBeFocusOwner()))
    {
        comp = rootAncestor;
        rootAncestor = comp.getFocusCycleRootAncestor();
    }
    if (focusLog.isLoggable(PlatformLogger.Level.FINER)) {
        focusLog.finer("comp = " + comp + ", root = " + rootAncestor);
    }
    Component candidate = null;
    if (rootAncestor != null) {
        FocusTraversalPolicy policy = rootAncestor.getFocusTraversalPolicy();
        Component toFocus = policy.getComponentAfter(rootAncestor, comp);
        if (focusLog.isLoggable(PlatformLogger.Level.FINER)) {
            focusLog.finer("component after is " + toFocus);
        }
        if (toFocus == null) {
            toFocus = policy.getDefaultComponent(rootAncestor);
            if (focusLog.isLoggable(PlatformLogger.Level.FINER)) {
                focusLog.finer("default component is " + toFocus);
            }
        }
        if (toFocus == null) {
            Applet applet = EmbeddedFrame.getAppletIfAncestorOf(this);
            if (applet != null) {
                toFocus = applet;
            }
        }
        candidate = toFocus;
    }
    if (focusLog.isLoggable(PlatformLogger.Level.FINER)) {
        focusLog.finer("Focus transfer candidate: " + candidate);
    }
    return candidate;
}
项目:jdk8u_jdk    文件:Component.java   
final Component getNextFocusCandidate() {
    Container rootAncestor = getTraversalRoot();
    Component comp = this;
    while (rootAncestor != null &&
           !(rootAncestor.isShowing() && rootAncestor.canBeFocusOwner()))
    {
        comp = rootAncestor;
        rootAncestor = comp.getFocusCycleRootAncestor();
    }
    if (focusLog.isLoggable(PlatformLogger.Level.FINER)) {
        focusLog.finer("comp = " + comp + ", root = " + rootAncestor);
    }
    Component candidate = null;
    if (rootAncestor != null) {
        FocusTraversalPolicy policy = rootAncestor.getFocusTraversalPolicy();
        Component toFocus = policy.getComponentAfter(rootAncestor, comp);
        if (focusLog.isLoggable(PlatformLogger.Level.FINER)) {
            focusLog.finer("component after is " + toFocus);
        }
        if (toFocus == null) {
            toFocus = policy.getDefaultComponent(rootAncestor);
            if (focusLog.isLoggable(PlatformLogger.Level.FINER)) {
                focusLog.finer("default component is " + toFocus);
            }
        }
        if (toFocus == null) {
            Applet applet = EmbeddedFrame.getAppletIfAncestorOf(this);
            if (applet != null) {
                toFocus = applet;
            }
        }
        candidate = toFocus;
    }
    if (focusLog.isLoggable(PlatformLogger.Level.FINER)) {
        focusLog.finer("Focus transfer candidate: " + candidate);
    }
    return candidate;
}
项目:jdk8u_jdk    文件:AppletPanel.java   
private void setDefaultFocus() {
    Component toFocus = null;
    Container parent = getParent();

    if(parent != null) {
        if (parent instanceof Window) {
            toFocus = getMostRecentFocusOwnerForWindow((Window)parent);
            if (toFocus == parent || toFocus == null) {
                toFocus = parent.getFocusTraversalPolicy().
                    getInitialComponent((Window)parent);
            }
        } else if (parent.isFocusCycleRoot()) {
            toFocus = parent.getFocusTraversalPolicy().
                getDefaultComponent(parent);
        }
    }

    if (toFocus != null) {
        if (parent instanceof EmbeddedFrame) {
            ((EmbeddedFrame) parent).synthesizeWindowActivation(true);
        }
        // EmbeddedFrame might have focus before the applet was added.
        // Thus after its activation the most recent focus owner will be
        // restored. We need the applet's initial focusabled component to
        // be focused here.
        toFocus.requestFocusInWindow();
    }
}
项目:jdk8u_jdk    文件:XEmbeddedFramePeer.java   
public XEmbeddedFramePeer(EmbeddedFrame target) {
    // Don't specify PARENT_WINDOW param here. Instead we reparent
    // this embedded frame peer to the proper parent window after
    // an XEventDispatcher is registered to handle XEmbed events
    super(new XCreateWindowParams(new Object[] {
        TARGET, target,
        VISIBLE, Boolean.TRUE,
        EMBEDDED, Boolean.TRUE}));
}
项目:lookaside_java-1.8.0-openjdk    文件:Component.java   
final Component getNextFocusCandidate() {
    Container rootAncestor = getTraversalRoot();
    Component comp = this;
    while (rootAncestor != null &&
           !(rootAncestor.isShowing() && rootAncestor.canBeFocusOwner()))
    {
        comp = rootAncestor;
        rootAncestor = comp.getFocusCycleRootAncestor();
    }
    if (focusLog.isLoggable(PlatformLogger.Level.FINER)) {
        focusLog.finer("comp = " + comp + ", root = " + rootAncestor);
    }
    Component candidate = null;
    if (rootAncestor != null) {
        FocusTraversalPolicy policy = rootAncestor.getFocusTraversalPolicy();
        Component toFocus = policy.getComponentAfter(rootAncestor, comp);
        if (focusLog.isLoggable(PlatformLogger.Level.FINER)) {
            focusLog.finer("component after is " + toFocus);
        }
        if (toFocus == null) {
            toFocus = policy.getDefaultComponent(rootAncestor);
            if (focusLog.isLoggable(PlatformLogger.Level.FINER)) {
                focusLog.finer("default component is " + toFocus);
            }
        }
        if (toFocus == null) {
            Applet applet = EmbeddedFrame.getAppletIfAncestorOf(this);
            if (applet != null) {
                toFocus = applet;
            }
        }
        candidate = toFocus;
    }
    if (focusLog.isLoggable(PlatformLogger.Level.FINER)) {
        focusLog.finer("Focus transfer candidate: " + candidate);
    }
    return candidate;
}
项目:lookaside_java-1.8.0-openjdk    文件:AppletPanel.java   
private void setDefaultFocus() {
    Component toFocus = null;
    Container parent = getParent();

    if(parent != null) {
        if (parent instanceof Window) {
            toFocus = getMostRecentFocusOwnerForWindow((Window)parent);
            if (toFocus == parent || toFocus == null) {
                toFocus = parent.getFocusTraversalPolicy().
                    getInitialComponent((Window)parent);
            }
        } else if (parent.isFocusCycleRoot()) {
            toFocus = parent.getFocusTraversalPolicy().
                getDefaultComponent(parent);
        }
    }

    if (toFocus != null) {
        if (parent instanceof EmbeddedFrame) {
            ((EmbeddedFrame) parent).synthesizeWindowActivation(true);
        }
        // EmbeddedFrame might have focus before the applet was added.
        // Thus after its activation the most recent focus owner will be
        // restored. We need the applet's initial focusabled component to
        // be focused here.
        toFocus.requestFocusInWindow();
    }
}
项目:lookaside_java-1.8.0-openjdk    文件:XEmbeddedFramePeer.java   
public XEmbeddedFramePeer(EmbeddedFrame target) {
    // Don't specify PARENT_WINDOW param here. Instead we reparent
    // this embedded frame peer to the proper parent window after
    // an XEventDispatcher is registered to handle XEmbed events
    super(new XCreateWindowParams(new Object[] {
        TARGET, target,
        VISIBLE, Boolean.TRUE,
        EMBEDDED, Boolean.TRUE}));
}
项目:VarJ    文件:Component.java   
Component preNextFocusHelper() {
Container rootAncestor = getFocusCycleRootAncestor();
       Component comp = this;
       while (rootAncestor != null && 
              !(rootAncestor.isShowing() && 
                rootAncestor.isFocusable() && 
                rootAncestor.isEnabled())) 
    {
    comp = rootAncestor;
    rootAncestor = comp.getFocusCycleRootAncestor();
    }
       if (rootAncestor != null) {
           FocusTraversalPolicy policy =
               rootAncestor.getFocusTraversalPolicy();
           Component toFocus = policy.getComponentAfter(rootAncestor, comp);
           if (toFocus == null) {
               toFocus = policy.getDefaultComponent(rootAncestor);
           }
           if (toFocus == null) {
               Applet applet = EmbeddedFrame.getAppletIfAncestorOf(this);
               if (applet != null) {
                   toFocus = applet;
               }
           }
    return toFocus;
}
return null;
   }
项目:jdk-1.7-annotated    文件:Component.java   
final Component getNextFocusCandidate() {
    Container rootAncestor = getTraversalRoot();
    Component comp = this;
    while (rootAncestor != null &&
           !(rootAncestor.isShowing() && rootAncestor.canBeFocusOwner()))
    {
        comp = rootAncestor;
        rootAncestor = comp.getFocusCycleRootAncestor();
    }
    if (focusLog.isLoggable(PlatformLogger.FINER)) {
        focusLog.finer("comp = " + comp + ", root = " + rootAncestor);
    }
    Component candidate = null;
    if (rootAncestor != null) {
        FocusTraversalPolicy policy = rootAncestor.getFocusTraversalPolicy();
        Component toFocus = policy.getComponentAfter(rootAncestor, comp);
        if (focusLog.isLoggable(PlatformLogger.FINER)) {
            focusLog.finer("component after is " + toFocus);
        }
        if (toFocus == null) {
            toFocus = policy.getDefaultComponent(rootAncestor);
            if (focusLog.isLoggable(PlatformLogger.FINER)) {
                focusLog.finer("default component is " + toFocus);
            }
        }
        if (toFocus == null) {
            Applet applet = EmbeddedFrame.getAppletIfAncestorOf(this);
            if (applet != null) {
                toFocus = applet;
            }
        }
        candidate = toFocus;
    }
    if (focusLog.isLoggable(PlatformLogger.FINER)) {
        focusLog.finer("Focus transfer candidate: " + candidate);
    }
    return candidate;
}
项目:infobip-open-jdk-8    文件:Component.java   
final Component getNextFocusCandidate() {
    Container rootAncestor = getTraversalRoot();
    Component comp = this;
    while (rootAncestor != null &&
           !(rootAncestor.isShowing() && rootAncestor.canBeFocusOwner()))
    {
        comp = rootAncestor;
        rootAncestor = comp.getFocusCycleRootAncestor();
    }
    if (focusLog.isLoggable(PlatformLogger.Level.FINER)) {
        focusLog.finer("comp = " + comp + ", root = " + rootAncestor);
    }
    Component candidate = null;
    if (rootAncestor != null) {
        FocusTraversalPolicy policy = rootAncestor.getFocusTraversalPolicy();
        Component toFocus = policy.getComponentAfter(rootAncestor, comp);
        if (focusLog.isLoggable(PlatformLogger.Level.FINER)) {
            focusLog.finer("component after is " + toFocus);
        }
        if (toFocus == null) {
            toFocus = policy.getDefaultComponent(rootAncestor);
            if (focusLog.isLoggable(PlatformLogger.Level.FINER)) {
                focusLog.finer("default component is " + toFocus);
            }
        }
        if (toFocus == null) {
            Applet applet = EmbeddedFrame.getAppletIfAncestorOf(this);
            if (applet != null) {
                toFocus = applet;
            }
        }
        candidate = toFocus;
    }
    if (focusLog.isLoggable(PlatformLogger.Level.FINER)) {
        focusLog.finer("Focus transfer candidate: " + candidate);
    }
    return candidate;
}
项目:infobip-open-jdk-8    文件:AppletPanel.java   
private void setDefaultFocus() {
    Component toFocus = null;
    Container parent = getParent();

    if(parent != null) {
        if (parent instanceof Window) {
            toFocus = getMostRecentFocusOwnerForWindow((Window)parent);
            if (toFocus == parent || toFocus == null) {
                toFocus = parent.getFocusTraversalPolicy().
                    getInitialComponent((Window)parent);
            }
        } else if (parent.isFocusCycleRoot()) {
            toFocus = parent.getFocusTraversalPolicy().
                getDefaultComponent(parent);
        }
    }

    if (toFocus != null) {
        if (parent instanceof EmbeddedFrame) {
            ((EmbeddedFrame)parent).synthesizeWindowActivation(true);
        }
        // EmbeddedFrame might have focus before the applet was added.
        // Thus after its activation the most recent focus owner will be
        // restored. We need the applet's initial focusabled component to
        // be focused here.
        toFocus.requestFocusInWindow();
    }
}
项目:infobip-open-jdk-8    文件:XEmbeddedFramePeer.java   
public XEmbeddedFramePeer(EmbeddedFrame target) {
    // Don't specify PARENT_WINDOW param here. Instead we reparent
    // this embedded frame peer to the proper parent window after
    // an XEventDispatcher is registered to handle XEmbed events
    super(new XCreateWindowParams(new Object[] {
        TARGET, target,
        VISIBLE, Boolean.TRUE,
        EMBEDDED, Boolean.TRUE}));
}
项目:jdk8u-dev-jdk    文件:Component.java   
final Component getNextFocusCandidate() {
    Container rootAncestor = getTraversalRoot();
    Component comp = this;
    while (rootAncestor != null &&
           !(rootAncestor.isShowing() && rootAncestor.canBeFocusOwner()))
    {
        comp = rootAncestor;
        rootAncestor = comp.getFocusCycleRootAncestor();
    }
    if (focusLog.isLoggable(PlatformLogger.Level.FINER)) {
        focusLog.finer("comp = " + comp + ", root = " + rootAncestor);
    }
    Component candidate = null;
    if (rootAncestor != null) {
        FocusTraversalPolicy policy = rootAncestor.getFocusTraversalPolicy();
        Component toFocus = policy.getComponentAfter(rootAncestor, comp);
        if (focusLog.isLoggable(PlatformLogger.Level.FINER)) {
            focusLog.finer("component after is " + toFocus);
        }
        if (toFocus == null) {
            toFocus = policy.getDefaultComponent(rootAncestor);
            if (focusLog.isLoggable(PlatformLogger.Level.FINER)) {
                focusLog.finer("default component is " + toFocus);
            }
        }
        if (toFocus == null) {
            Applet applet = EmbeddedFrame.getAppletIfAncestorOf(this);
            if (applet != null) {
                toFocus = applet;
            }
        }
        candidate = toFocus;
    }
    if (focusLog.isLoggable(PlatformLogger.Level.FINER)) {
        focusLog.finer("Focus transfer candidate: " + candidate);
    }
    return candidate;
}
项目:jdk8u-dev-jdk    文件:AppletPanel.java   
private void setDefaultFocus() {
    Component toFocus = null;
    Container parent = getParent();

    if(parent != null) {
        if (parent instanceof Window) {
            toFocus = getMostRecentFocusOwnerForWindow((Window)parent);
            if (toFocus == parent || toFocus == null) {
                toFocus = parent.getFocusTraversalPolicy().
                    getInitialComponent((Window)parent);
            }
        } else if (parent.isFocusCycleRoot()) {
            toFocus = parent.getFocusTraversalPolicy().
                getDefaultComponent(parent);
        }
    }

    if (toFocus != null) {
        if (parent instanceof EmbeddedFrame) {
            // JDK-8056915: Try to request focus to the embedder first and
            // activate the embedded frame through it
            if (!((EmbeddedFrame) parent).requestFocusToEmbedder()) {
                // Otherwise activate the embedded frame directly
                ((EmbeddedFrame) parent).synthesizeWindowActivation(true);
            }
        }
        // EmbeddedFrame might have focus before the applet was added.
        // Thus after its activation the most recent focus owner will be
        // restored. We need the applet's initial focusabled component to
        // be focused here.
        toFocus.requestFocusInWindow();
    }
}
项目:jdk8u-dev-jdk    文件:XEmbeddedFramePeer.java   
public XEmbeddedFramePeer(EmbeddedFrame target) {
    // Don't specify PARENT_WINDOW param here. Instead we reparent
    // this embedded frame peer to the proper parent window after
    // an XEventDispatcher is registered to handle XEmbed events
    super(new XCreateWindowParams(new Object[] {
        TARGET, target,
        VISIBLE, Boolean.TRUE,
        EMBEDDED, Boolean.TRUE}));
}
项目:jdk7-jdk    文件:Component.java   
final Component getNextFocusCandidate() {
    Container rootAncestor = getTraversalRoot();
    Component comp = this;
    while (rootAncestor != null &&
           !(rootAncestor.isShowing() && rootAncestor.canBeFocusOwner()))
    {
        comp = rootAncestor;
        rootAncestor = comp.getFocusCycleRootAncestor();
    }
    if (focusLog.isLoggable(PlatformLogger.FINER)) {
        focusLog.finer("comp = " + comp + ", root = " + rootAncestor);
    }
    Component candidate = null;
    if (rootAncestor != null) {
        FocusTraversalPolicy policy = rootAncestor.getFocusTraversalPolicy();
        Component toFocus = policy.getComponentAfter(rootAncestor, comp);
        if (focusLog.isLoggable(PlatformLogger.FINER)) {
            focusLog.finer("component after is " + toFocus);
        }
        if (toFocus == null) {
            toFocus = policy.getDefaultComponent(rootAncestor);
            if (focusLog.isLoggable(PlatformLogger.FINER)) {
                focusLog.finer("default component is " + toFocus);
            }
        }
        if (toFocus == null) {
            Applet applet = EmbeddedFrame.getAppletIfAncestorOf(this);
            if (applet != null) {
                toFocus = applet;
            }
        }
        candidate = toFocus;
    }
    if (focusLog.isLoggable(PlatformLogger.FINER)) {
        focusLog.finer("Focus transfer candidate: " + candidate);
    }
    return candidate;
}
项目:jdk7-jdk    文件:AppletPanel.java   
private void setDefaultFocus() {
    Component toFocus = null;
    Container parent = getParent();

    if(parent != null) {
        if (parent instanceof Window) {
            toFocus = getMostRecentFocusOwnerForWindow((Window)parent);
            if (toFocus == parent || toFocus == null) {
                toFocus = parent.getFocusTraversalPolicy().
                    getInitialComponent((Window)parent);
            }
        } else if (parent.isFocusCycleRoot()) {
            toFocus = parent.getFocusTraversalPolicy().
                getDefaultComponent(parent);
        }
    }

    if (toFocus != null) {
        if (parent instanceof EmbeddedFrame) {
            ((EmbeddedFrame)parent).synthesizeWindowActivation(true);
        }
        // EmbeddedFrame might have focus before the applet was added.
        // Thus after its activation the most recent focus owner will be
        // restored. We need the applet's initial focusabled component to
        // be focused here.
        toFocus.requestFocusInWindow();
    }
}
项目:jdk7-jdk    文件:XEmbeddedFramePeer.java   
public XEmbeddedFramePeer(EmbeddedFrame target) {
    // Don't specify PARENT_WINDOW param here. Instead we reparent
    // this embedded frame peer to the proper parent window after
    // an XEventDispatcher is registered to handle XEmbed events
    super(new XCreateWindowParams(new Object[] {
        TARGET, target,
        VISIBLE, Boolean.TRUE,
        EMBEDDED, Boolean.TRUE}));
}
项目:openjdk-source-code-learn    文件:Component.java   
final Component getNextFocusCandidate() {
    Container rootAncestor = getTraversalRoot();
    Component comp = this;
    while (rootAncestor != null &&
           !(rootAncestor.isShowing() && rootAncestor.canBeFocusOwner()))
    {
        comp = rootAncestor;
        rootAncestor = comp.getFocusCycleRootAncestor();
    }
    if (focusLog.isLoggable(PlatformLogger.FINER)) {
        focusLog.finer("comp = " + comp + ", root = " + rootAncestor);
    }
    Component candidate = null;
    if (rootAncestor != null) {
        FocusTraversalPolicy policy = rootAncestor.getFocusTraversalPolicy();
        Component toFocus = policy.getComponentAfter(rootAncestor, comp);
        if (focusLog.isLoggable(PlatformLogger.FINER)) {
            focusLog.finer("component after is " + toFocus);
        }
        if (toFocus == null) {
            toFocus = policy.getDefaultComponent(rootAncestor);
            if (focusLog.isLoggable(PlatformLogger.FINER)) {
                focusLog.finer("default component is " + toFocus);
            }
        }
        if (toFocus == null) {
            Applet applet = EmbeddedFrame.getAppletIfAncestorOf(this);
            if (applet != null) {
                toFocus = applet;
            }
        }
        candidate = toFocus;
    }
    if (focusLog.isLoggable(PlatformLogger.FINER)) {
        focusLog.finer("Focus transfer candidate: " + candidate);
    }
    return candidate;
}