本文整理汇总了Java中sun.awt.windows.WWindowPeer类的典型用法代码示例。如果您正苦于以下问题:Java WWindowPeer类的具体用法?Java WWindowPeer怎么用?Java WWindowPeer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
WWindowPeer类属于sun.awt.windows包,在下文中一共展示了WWindowPeer类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: addFSWindowListener
import sun.awt.windows.WWindowPeer; //导入依赖的package包/类
@Override
protected void addFSWindowListener(Window w) {
// if the window is not a toplevel (has an owner) we have to use the
// real toplevel to enter the full-screen mode with (4933099).
if (!(w instanceof Frame) && !(w instanceof Dialog) &&
(realFSWindow = getToplevelOwner(w)) != null)
{
ownerOrigBounds = realFSWindow.getBounds();
WWindowPeer fp = (WWindowPeer)realFSWindow.getPeer();
ownerWasVisible = realFSWindow.isVisible();
Rectangle r = w.getBounds();
// we use operations on peer instead of component because calling
// them on component will take the tree lock
fp.reshape(r.x, r.y, r.width, r.height);
fp.setVisible(true);
} else {
realFSWindow = w;
}
fsWindowWasAlwaysOnTop = realFSWindow.isAlwaysOnTop();
((WWindowPeer)realFSWindow.getPeer()).setAlwaysOnTop(true);
fsWindowListener = new D3DFSWindowAdapter();
realFSWindow.addWindowListener(fsWindowListener);
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:27,代码来源:D3DGraphicsDevice.java
示例2: addFSWindowListener
import sun.awt.windows.WWindowPeer; //导入依赖的package包/类
@Override
protected void addFSWindowListener(Window w) {
// if the window is not a toplevel (has an owner) we have to use the
// real toplevel to enter the full-screen mode with (4933099).
final ComponentAccessor acc = AWTAccessor.getComponentAccessor();
if (!(w instanceof Frame) && !(w instanceof Dialog) &&
(realFSWindow = getToplevelOwner(w)) != null)
{
ownerOrigBounds = realFSWindow.getBounds();
WWindowPeer fp = acc.getPeer(realFSWindow);
ownerWasVisible = realFSWindow.isVisible();
Rectangle r = w.getBounds();
// we use operations on peer instead of component because calling
// them on component will take the tree lock
fp.reshape(r.x, r.y, r.width, r.height);
fp.setVisible(true);
} else {
realFSWindow = w;
}
fsWindowWasAlwaysOnTop = realFSWindow.isAlwaysOnTop();
((WWindowPeer) acc.getPeer(realFSWindow)).setAlwaysOnTop(true);
fsWindowListener = new D3DFSWindowAdapter();
realFSWindow.addWindowListener(fsWindowListener);
}
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:27,代码来源:D3DGraphicsDevice.java
示例3: enterFullScreenExclusive
import sun.awt.windows.WWindowPeer; //导入依赖的package包/类
@Override
protected void enterFullScreenExclusive(final int screen, WindowPeer wp)
{
final WWindowPeer wpeer = (WWindowPeer)realFSWindow.getPeer();
D3DRenderQueue rq = D3DRenderQueue.getInstance();
rq.lock();
try {
rq.flushAndInvokeNow(new Runnable() {
public void run() {
long hwnd = wpeer.getHWnd();
if (hwnd == 0l) {
// window is disposed
fsStatus = false;
return;
}
fsStatus = enterFullScreenExclusiveNative(screen, hwnd);
}
});
} finally {
rq.unlock();
}
if (!fsStatus) {
super.enterFullScreenExclusive(screen, wp);
}
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:27,代码来源:D3DGraphicsDevice.java
示例4: setDisplayMode
import sun.awt.windows.WWindowPeer; //导入依赖的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
示例5: enterFullScreenExclusive
import sun.awt.windows.WWindowPeer; //导入依赖的package包/类
@Override
protected void enterFullScreenExclusive(final int screen, WindowPeer wp)
{
final WWindowPeer wpeer = AWTAccessor.getComponentAccessor()
.getPeer(realFSWindow);
D3DRenderQueue rq = D3DRenderQueue.getInstance();
rq.lock();
try {
rq.flushAndInvokeNow(new Runnable() {
public void run() {
long hwnd = wpeer.getHWnd();
if (hwnd == 0l) {
// window is disposed
fsStatus = false;
return;
}
fsStatus = enterFullScreenExclusiveNative(screen, hwnd);
}
});
} finally {
rq.unlock();
}
if (!fsStatus) {
super.enterFullScreenExclusive(screen, wp);
}
}
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:27,代码来源:D3DGraphicsDevice.java
示例6: setDisplayMode
import sun.awt.windows.WWindowPeer; //导入依赖的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 = AWTAccessor.getComponentAccessor().getPeer(w);
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:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:30,代码来源:Win32GraphicsDevice.java
示例7: removeFSWindowListener
import sun.awt.windows.WWindowPeer; //导入依赖的package包/类
@Override
protected void removeFSWindowListener(Window w) {
realFSWindow.removeWindowListener(fsWindowListener);
fsWindowListener = null;
/**
* Bug 4933099: There is some funny-business to deal with when this
* method is called with a Window instead of a Frame. See 4836744
* for more information on this. One side-effect of our workaround
* for the problem is that the owning Frame of a Window may end
* up getting resized during the fullscreen process. When we
* return from fullscreen mode, we should resize the Frame to
* its original size (just like the Window is being resized
* to its original size in GraphicsDevice).
*/
WWindowPeer wpeer = (WWindowPeer)realFSWindow.getPeer();
if (wpeer != null) {
if (ownerOrigBounds != null) {
// if the window went into fs mode before it was realized it
// could have (0,0) dimensions
if (ownerOrigBounds.width == 0) ownerOrigBounds.width = 1;
if (ownerOrigBounds.height == 0) ownerOrigBounds.height = 1;
wpeer.reshape(ownerOrigBounds.x, ownerOrigBounds.y,
ownerOrigBounds.width, ownerOrigBounds.height);
if (!ownerWasVisible) {
wpeer.setVisible(false);
}
ownerOrigBounds = null;
}
if (!fsWindowWasAlwaysOnTop) {
wpeer.setAlwaysOnTop(false);
}
}
realFSWindow = null;
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:37,代码来源:D3DGraphicsDevice.java
示例8: removeFSWindowListener
import sun.awt.windows.WWindowPeer; //导入依赖的package包/类
@Override
protected void removeFSWindowListener(Window w) {
realFSWindow.removeWindowListener(fsWindowListener);
fsWindowListener = null;
/**
* Bug 4933099: There is some funny-business to deal with when this
* method is called with a Window instead of a Frame. See 4836744
* for more information on this. One side-effect of our workaround
* for the problem is that the owning Frame of a Window may end
* up getting resized during the fullscreen process. When we
* return from fullscreen mode, we should resize the Frame to
* its original size (just like the Window is being resized
* to its original size in GraphicsDevice).
*/
final WWindowPeer wpeer = AWTAccessor.getComponentAccessor()
.getPeer(realFSWindow);
if (wpeer != null) {
if (ownerOrigBounds != null) {
// if the window went into fs mode before it was realized it
// could have (0,0) dimensions
if (ownerOrigBounds.width == 0) ownerOrigBounds.width = 1;
if (ownerOrigBounds.height == 0) ownerOrigBounds.height = 1;
wpeer.reshape(ownerOrigBounds.x, ownerOrigBounds.y,
ownerOrigBounds.width, ownerOrigBounds.height);
if (!ownerWasVisible) {
wpeer.setVisible(false);
}
ownerOrigBounds = null;
}
if (!fsWindowWasAlwaysOnTop) {
wpeer.setAlwaysOnTop(false);
}
}
realFSWindow = null;
}
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:38,代码来源:D3DGraphicsDevice.java
注:本文中的sun.awt.windows.WWindowPeer类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论