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


Java EmbeddedFrame类代码示例

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


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

示例1: getPopup

import sun.awt.EmbeddedFrame; //导入依赖的package包/类
/**
 * 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;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:27,代码来源:PopupFactory.java

示例2: getPopup

import sun.awt.EmbeddedFrame; //导入依赖的package包/类
/**
 * 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;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:28,代码来源:PopupFactory.java

示例3: getNextFocusCandidate

import sun.awt.EmbeddedFrame; //导入依赖的package包/类
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;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:39,代码来源:Component.java

示例4: setDefaultFocus

import sun.awt.EmbeddedFrame; //导入依赖的package包/类
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();
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:29,代码来源:AppletPanel.java

示例5: XEmbeddedFramePeer

import sun.awt.EmbeddedFrame; //导入依赖的package包/类
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}));
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:10,代码来源:XEmbeddedFramePeer.java

示例6: setDefaultFocus

import sun.awt.EmbeddedFrame; //导入依赖的package包/类
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();
    }
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:29,代码来源:AppletPanel.java

示例7: getNextFocusCandidate

import sun.awt.EmbeddedFrame; //导入依赖的package包/类
@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;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:40,代码来源:Component.java

示例8: preNextFocusHelper

import sun.awt.EmbeddedFrame; //导入依赖的package包/类
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;
   }
 
开发者ID:jgaltidor,项目名称:VarJ,代码行数:29,代码来源:Component.java

示例9: getNextFocusCandidate

import sun.awt.EmbeddedFrame; //导入依赖的package包/类
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;
}
 
开发者ID:ZhaoX,项目名称:jdk-1.7-annotated,代码行数:39,代码来源:Component.java

示例10: setDefaultFocus

import sun.awt.EmbeddedFrame; //导入依赖的package包/类
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();
    }
}
 
开发者ID:frohoff,项目名称:jdk8u-dev-jdk,代码行数:34,代码来源:AppletPanel.java


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