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


Java Window.getWindows方法代码示例

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


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

示例1: getTitle

import java.awt.Window; //导入方法依赖的package包/类
public String getTitle() {
    String title = getTitleFromNP(window);
    Window[] windows = Window.getWindows();
    String original = title;
    int index = 1;
    for (Window w : windows) {
        if (w == window) {
            return title;
        }
        if (!w.isVisible()) {
            continue;
        }
        String wTitle = getTitleFromNP(w);
        if (original.equals(wTitle)) {
            title = original + "(" + index++ + ")";
        }
    }
    return title;
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:20,代码来源:WindowTitle.java

示例2: getComponent

import java.awt.Window; //导入方法依赖的package包/类
public Component getComponent() {
    if (component == null) {
        Window activeWindow = KeyboardFocusManager.getCurrentKeyboardFocusManager().getActiveWindow();
        if (activeWindow != null) {
            return activeWindow.getFocusOwner();
        }
        Window[] windows = Window.getWindows();
        if (windows.length > 0) {
            if (windows[0].getFocusOwner() != null) {
                return windows[0].getFocusOwner();
            }
            return windows[0];
        }
    }
    return component;
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:17,代码来源:EventQueueDevice.java

示例3: waitForWindows

import java.awt.Window; //导入方法依赖的package包/类
static private void waitForWindows() {
    boolean exit;
    do {
        exit = true;
        for (Window win : Window.getWindows()) {
            if (win.isShowing()) {
                exit = false;
                try {
                    Thread.sleep(1000);
                } catch (InterruptedException e) {
                    // do nothing
                }
                break;
            }
        }
    } while (!exit);
}
 
开发者ID:meteoorkip,项目名称:JavaGraph,代码行数:18,代码来源:GrooveCmdLineTool.java

示例4: getGUISnapshots

import java.awt.Window; //导入方法依赖的package包/类
static Snapshot[] getGUISnapshots() {
    List snapshots = new ArrayList();   //System.err.println("gGUI: thread = "+Thread.currentThread());
    Window[] windows = Window.getWindows(); //System.err.println("gGUI: windows = "+windows.length);
    for (int wi = 0; wi < windows.length; wi++) {
        Window w = windows[wi]; //System.err.println("gGUI: w["+wi+"] = "+w+", is visible = "+w.isVisible());
        if (!w.isVisible()) {
            continue;
        }
        Dimension d = w.getSize();  //System.err.println("gGUI:  size = "+d);
        if (d.width == 0 || d.height == 0) {
            continue;
        }
        BufferedImage bi = new BufferedImage(d.width, d.height, BufferedImage.TYPE_INT_ARGB);
        Graphics2D g = bi.createGraphics();
        g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_DEFAULT);
        w.paint(g);
        Raster raster = bi.getData();
        Object data = raster.getDataElements(0, 0, d.width, d.height, null);
        int[] dataArr;  //System.err.println("gGUI: data = "+data);
        if (data instanceof int[]) {
            dataArr = (int[]) data;
        } else {
            continue;
        }
        String title = null;
        if (w instanceof Frame) {
            title = ((Frame) w).getTitle();
        } else if (w instanceof Dialog) {
            title = ((Dialog) w).getTitle();
        }   //System.err.println("gGUI: title = "+title);
        snapshots.add(new Snapshot(w, title, d.width, d.height, dataArr));
    }
    Snapshot[] snapshotArr = (Snapshot[]) snapshots.toArray(new Snapshot[] {});
    lastGUISnapshots = snapshotArr;
    return snapshotArr;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:37,代码来源:RemoteAWTService.java

示例5: main

import java.awt.Window; //导入方法依赖的package包/类
public static void main(String[] args) throws AWTException {
    robot = new Robot();
    // test escape after selection
    start();
    click(KeyEvent.VK_ESCAPE);
    toolkit.realSync();
    // test double escape after editing
    start();
    click(KeyEvent.VK_1);
    click(KeyEvent.VK_0);
    click(KeyEvent.VK_ESCAPE);
    click(KeyEvent.VK_ESCAPE);
    toolkit.realSync();
    // all windows should be closed
    for (Window window : Window.getWindows()) {
        if (window.isVisible()) {
            throw new Error("found visible window: " + window.getName());
        }
    }
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:21,代码来源:Test6541987.java

示例6: main

import java.awt.Window; //导入方法依赖的package包/类
public static void main(String[] args) throws AWTException {
    robot = new Robot();
    // test escape after selection
    start();
    click(KeyEvent.VK_ESCAPE);
    robot.waitForIdle();
    // test double escape after editing
    start();
    click(KeyEvent.VK_1);
    click(KeyEvent.VK_0);
    click(KeyEvent.VK_ESCAPE);
    click(KeyEvent.VK_ESCAPE);
    robot.waitForIdle();
    // all windows should be closed
    for (Window window : Window.getWindows()) {
        if (window.isVisible()) {
            throw new Error("found visible window: " + window.getName());
        }
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:21,代码来源:Test6541987.java

示例7: killJOP

import java.awt.Window; //导入方法依赖的package包/类
public static void killJOP() {
    Window[] windows = Window.getWindows();
    for (Window window : windows) {
        if (window instanceof JDialog) {
            JDialog dialog = (JDialog) window;
            if (dialog.getContentPane().getComponentCount() == 1
                    && dialog.getContentPane().getComponent(0) instanceof JOptionPane) {
                dialog.dispose();
            }
        }
    }
}
 
开发者ID:CBSkarmory,项目名称:AWGW,代码行数:13,代码来源:GUIController.java

示例8: storeTo

import java.awt.Window; //导入方法依赖的package包/类
public void storeTo(ProfilerIDESettings settings) {
    settings.setSourcesColoringEnabled(coloringChoice.isSelected());
    PackageColorer.setRegisteredColors(colors);
    for (Window w : Window.getWindows()) w.repaint();
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:6,代码来源:FiltersOptionsPanel.java

示例9: addListeners

import java.awt.Window; //导入方法依赖的package包/类
private void addListeners(Class<?> listener) {
    Window[] windows = Window.getWindows();
    for (Window window : windows) {
        addListeners(window, listener);
    }
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:7,代码来源:JavaRecorderHook.java


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