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


Java Window.getPeer方法代码示例

本文整理汇总了Java中java.awt.Window.getPeer方法的典型用法代码示例。如果您正苦于以下问题:Java Window.getPeer方法的具体用法?Java Window.getPeer怎么用?Java Window.getPeer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在java.awt.Window的用法示例。


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

示例1: setDisplayMode

import java.awt.Window; //导入方法依赖的package包/类
@Override
public synchronized void setDisplayMode(DisplayMode dm) {
    if (!isDisplayChangeSupported()) {
        super.setDisplayMode(dm);
        return;
    }
    if (dm == null || (dm = getMatchingDisplayMode(dm)) == null) {
        throw new IllegalArgumentException("Invalid display mode");
    }
    if (getDisplayMode().equals(dm)) {
        return;
    }
    Window w = getFullScreenWindow();
    if (w != null) {
        WWindowPeer peer = (WWindowPeer)w.getPeer();
        configDisplayMode(screen, peer, dm.getWidth(), dm.getHeight(),
            dm.getBitDepth(), dm.getRefreshRate());
        // resize the fullscreen window to the dimensions of the new
        // display mode
        Rectangle screenBounds = getDefaultConfiguration().getBounds();
        w.setBounds(screenBounds.x, screenBounds.y,
                    dm.getWidth(), dm.getHeight());
        // Note: no call to replaceSurfaceData is required here since
        // replacement will be caused by an upcoming display change event
    } else {
        throw new IllegalStateException("Must be in fullscreen mode " +
                                        "in order to set display mode");
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:30,代码来源:Win32GraphicsDevice.java

示例2: enterFullScreenExclusive

import java.awt.Window; //导入方法依赖的package包/类
private static void enterFullScreenExclusive(Window w) {
    X11ComponentPeer peer = (X11ComponentPeer)w.getPeer();
    if (peer != null) {
        enterFullScreenExclusive(peer.getContentWindow());
        peer.setFullScreenExclusiveModeState(true);
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:8,代码来源:X11GraphicsDevice.java

示例3: exitFullScreenExclusive

import java.awt.Window; //导入方法依赖的package包/类
private static void exitFullScreenExclusive(Window w) {
    X11ComponentPeer peer = (X11ComponentPeer)w.getPeer();
    if (peer != null) {
        peer.setFullScreenExclusiveModeState(false);
        exitFullScreenExclusive(peer.getContentWindow());
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:8,代码来源:X11GraphicsDevice.java

示例4: enterFullScreenExclusive

import java.awt.Window; //导入方法依赖的package包/类
private static void enterFullScreenExclusive(Window w) {
    X11ComponentPeer peer = (X11ComponentPeer)w.getPeer();
    if (peer != null) {
        enterFullScreenExclusive(peer.getWindow());
        peer.setFullScreenExclusiveModeState(true);
    }
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:8,代码来源:X11GraphicsDevice.java

示例5: exitFullScreenExclusive

import java.awt.Window; //导入方法依赖的package包/类
private static void exitFullScreenExclusive(Window w) {
    X11ComponentPeer peer = (X11ComponentPeer)w.getPeer();
    if (peer != null) {
        peer.setFullScreenExclusiveModeState(false);
        exitFullScreenExclusive(peer.getWindow());
    }
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:8,代码来源:X11GraphicsDevice.java

示例6: enterFullScreenExclusive

import java.awt.Window; //导入方法依赖的package包/类
private static void enterFullScreenExclusive(Window w) {
    FullScreenCapable peer = (FullScreenCapable)w.getPeer();
    if (peer != null) {
        peer.enterFullScreenMode();
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:7,代码来源:CGraphicsDevice.java

示例7: exitFullScreenExclusive

import java.awt.Window; //导入方法依赖的package包/类
private static void exitFullScreenExclusive(Window w) {
    FullScreenCapable peer = (FullScreenCapable)w.getPeer();
    if (peer != null) {
        peer.exitFullScreenMode();
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:7,代码来源:CGraphicsDevice.java

示例8: requestFocus

import java.awt.Window; //导入方法依赖的package包/类
final public boolean requestFocus(Component lightweightChild, boolean temporary,
                                  boolean focusedWindowChangeAllowed, long time,
                                  CausedFocusEvent.Cause cause)
{
    if (XKeyboardFocusManagerPeer.
        processSynchronousLightweightTransfer(target, lightweightChild, temporary,
                                              focusedWindowChangeAllowed, time))
    {
        return true;
    }

    int result = XKeyboardFocusManagerPeer.
        shouldNativelyFocusHeavyweight(target, lightweightChild,
                                       temporary, focusedWindowChangeAllowed,
                                       time, cause);

    switch (result) {
      case XKeyboardFocusManagerPeer.SNFH_FAILURE:
          return false;
      case XKeyboardFocusManagerPeer.SNFH_SUCCESS_PROCEED:
          // Currently we just generate focus events like we deal with lightweight instead of calling
          // XSetInputFocus on native window
          if (focusLog.isLoggable(PlatformLogger.Level.FINER)) {
              focusLog.finer("Proceeding with request to " +
                             lightweightChild + " in " + target);
          }
          /**
           * The problems with requests in non-focused window arise because shouldNativelyFocusHeavyweight
           * checks that native window is focused while appropriate WINDOW_GAINED_FOCUS has not yet
           * been processed - it is in EventQueue. Thus, SNFH allows native request and stores request record
           * in requests list - and it breaks our requests sequence as first record on WGF should be the last
           * focus owner which had focus before WLF. So, we should not add request record for such requests
           * but store this component in mostRecent - and return true as before for compatibility.
           */
          Window parentWindow = SunToolkit.getContainingWindow(target);
          if (parentWindow == null) {
              return rejectFocusRequestHelper("WARNING: Parent window is null");
          }
          XWindowPeer wpeer = (XWindowPeer)parentWindow.getPeer();
          if (wpeer == null) {
              return rejectFocusRequestHelper("WARNING: Parent window's peer is null");
          }
          /*
           * Passing null 'actualFocusedWindow' as we don't want to restore focus on it
           * when a component inside a Frame is requesting focus.
           * See 6314575 for details.
           */
          boolean res = wpeer.requestWindowFocus(null);

          if (focusLog.isLoggable(PlatformLogger.Level.FINER)) {
              focusLog.finer("Requested window focus: " + res);
          }
          // If parent window can be made focused and has been made focused(synchronously)
          // then we can proceed with children, otherwise we retreat.
          if (!(res && parentWindow.isFocused())) {
              return rejectFocusRequestHelper("Waiting for asynchronous processing of the request");
          }
          return XKeyboardFocusManagerPeer.deliverFocus(lightweightChild,
                                                        (Component)target,
                                                        temporary,
                                                        focusedWindowChangeAllowed,
                                                        time, cause);
          // Motif compatibility code
      case XKeyboardFocusManagerPeer.SNFH_SUCCESS_HANDLED:
          // Either lightweight or excessive request - all events are generated.
          return true;
    }
    return false;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:70,代码来源:XComponentPeer.java


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