當前位置: 首頁>>代碼示例>>Java>>正文


Java Window.getBounds方法代碼示例

本文整理匯總了Java中java.awt.Window.getBounds方法的典型用法代碼示例。如果您正苦於以下問題:Java Window.getBounds方法的具體用法?Java Window.getBounds怎麽用?Java Window.getBounds使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在java.awt.Window的用法示例。


在下文中一共展示了Window.getBounds方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: addFSWindowListener

import java.awt.Window; //導入方法依賴的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 java.awt.Window; //導入方法依賴的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: mousePressed

import java.awt.Window; //導入方法依賴的package包/類
public void mousePressed(MouseEvent e) {
    isPressed = true;
    startDragLoc = getScreenLoc(e);

    Window w = SwingUtilities.getWindowAncestor((Component)e.getSource());
    startWinBounds = w.getBounds();
    resizedBounds.setBounds(startWinBounds);
    minSize = w.getMinimumSize();
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:10,代碼來源:DecorationUtils.java

示例4: notifyClientWindowChange

import java.awt.Window; //導入方法依賴的package包/類
private synchronized void notifyClientWindowChange(Window window) {
    if (inputMethod == null) {
        return;
    }

    // if the window is invisible or iconified, send null to the input method.
    if (!window.isVisible() ||
        ((window instanceof Frame) && ((Frame)window).getState() == Frame.ICONIFIED)) {
        clientWindowLocation = null;
        inputMethod.notifyClientWindowChange(null);
        return;
    }
    Rectangle location = window.getBounds();
    if (clientWindowLocation == null || !clientWindowLocation.equals(location)) {
        clientWindowLocation = location;
        inputMethod.notifyClientWindowChange(clientWindowLocation);
    }
}
 
開發者ID:SunburstApps,項目名稱:OpenJSharp,代碼行數:19,代碼來源:InputContext.java


注:本文中的java.awt.Window.getBounds方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。