@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); } }
@Override protected void exitFullScreenExclusive(final int screen, WindowPeer w) { if (fsStatus) { D3DRenderQueue rq = D3DRenderQueue.getInstance(); rq.lock(); try { rq.flushAndInvokeNow(new Runnable() { public void run() { exitFullScreenExclusiveNative(screen); } }); } finally { rq.unlock(); } } else { super.exitFullScreenExclusive(screen, w); } }
@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); } }
/** * For the scaling graphics and a decorated toplevel as the destination, * calculates the rounding error of the toplevel insets. * * @return the left/top insets rounding error, in device space */ private static Point2D getInsetsRoundingError(SunGraphics2D g) { Point2D.Double err = new Point2D.Double(0, 0); if (g.transformState >= SunGraphics2D.TRANSFORM_TRANSLATESCALE) { Object dst = g.getSurfaceData().getDestination(); if (dst instanceof Frame && !((Frame)dst).isUndecorated() || dst instanceof Dialog && !((Dialog)dst).isUndecorated()) { Window wnd = (Window)dst; WindowPeer peer = (WindowPeer)wnd.getPeer(); Insets sysInsets = peer != null ? peer.getSysInsets() : null; if (sysInsets != null) { Insets insets = wnd.getInsets(); // insets.left/top is a scaled down rounded value // insets.left/top * tx.scale is a scaled up value (which contributes to graphics translate) // sysInsets.left/top is the precise system value err.x = sysInsets.left - insets.left * g.transform.getScaleX(); err.y = sysInsets.top - insets.top * g.transform.getScaleY(); } } } return err; }
/** * Sets the always-on-top state of this window (if supported). * * Setting a window to always-on-top means it will not be obscured * by any other windows (with the exception of other always-on-top * windows). Not all platforms may support this. * * If an window's always-on-top status is changed to false, the window * will remain at the front but not be anchored there. * * Calling toBack() on an always-on-top window will change its * always-on-top status to false. * * @since 1.5 */ public final void setAlwaysOnTop(boolean alwaysOnTop) { SecurityManager sm = System.getSecurityManager(); if (sm != null) sm.checkPermission( new AWTPermission("setWindowAlwaysOnTop") ); if( this.alwaysOnTop == alwaysOnTop ) return; if( alwaysOnTop ) toFront(); firePropertyChange("alwaysOnTop", this.alwaysOnTop, alwaysOnTop ); this.alwaysOnTop = alwaysOnTop; if (peer != null) ( (WindowPeer) peer).updateAlwaysOnTop(); else System.out.println("Null peer?!"); }
static void updateChildFocusableWindowState(Window w) { if (w.getPeer() != null && w.isShowing()) { ((WindowPeer)w.getPeer()).updateFocusableWindowState(); } for (int i = 0; i < w.ownedWindowList.size(); i++) { Window child = w.ownedWindowList.elementAt(i).get(); if (child != null) { updateChildFocusableWindowState(child); } } }
final void toFront_NoClientCode() { if (visible) { WindowPeer peer = (WindowPeer)this.peer; if (peer != null) { peer.toFront(); } if (isModalBlocked()) { modalBlocker.toFront_NoClientCode(); } } }
final void toBack_NoClientCode() { if(isAlwaysOnTop()) { try { setAlwaysOnTop(false); }catch(SecurityException e) { } } if (visible) { WindowPeer peer = (WindowPeer)this.peer; if (peer != null) { peer.toBack(); } } }
void setModalBlocked(Dialog blocker, boolean blocked, boolean peerCall) { this.modalBlocker = blocked ? blocker : null; if (peerCall) { WindowPeer peer = (WindowPeer)this.peer; if (peer != null) { peer.setModalBlocked(blocker, blocked); } } }
private void updateWindow() { synchronized (getTreeLock()) { WindowPeer peer = (WindowPeer)getPeer(); if (peer != null) { peer.updateWindow(); } } }
public void setSecurityWarningPosition(Window window, Point2D point, float alignmentX, float alignmentY) { window.securityWarningPointX = point.getX(); window.securityWarningPointY = point.getY(); window.securityWarningAlignmentX = alignmentX; window.securityWarningAlignmentY = alignmentY; synchronized (window.getTreeLock()) { WindowPeer peer = (WindowPeer)window.getPeer(); if (peer != null) { peer.repositionSecurityWarning(); } } }