本文整理汇总了Java中sun.awt.EmbeddedFrame.getAppletIfAncestorOf方法的典型用法代码示例。如果您正苦于以下问题:Java EmbeddedFrame.getAppletIfAncestorOf方法的具体用法?Java EmbeddedFrame.getAppletIfAncestorOf怎么用?Java EmbeddedFrame.getAppletIfAncestorOf使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sun.awt.EmbeddedFrame
的用法示例。
在下文中一共展示了EmbeddedFrame.getAppletIfAncestorOf方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例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;
}
示例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;
}
示例4: 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;
}
示例5: 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;
}
示例6: 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;
}