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


Java Frame.getFrames方法代碼示例

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


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

示例1: getCurrentGraphicsConfiguration

import java.awt.Frame; //導入方法依賴的package包/類
/**
    * Finds out the monitor where the user currently has the input focus.
    * This method is usually used to help the client code to figure out on
    * which monitor it should place newly created windows/frames/dialogs.
    *
    * @return the GraphicsConfiguration of the monitor which currently has the
    * input focus
    */
   private static GraphicsConfiguration getCurrentGraphicsConfiguration() {
Component focusOwner = KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusOwner();
       if (focusOwner != null) {
           Window w = SwingUtilities.getWindowAncestor(focusOwner);
           if (w != null) {
               return w.getGraphicsConfiguration();
           } else {
               //#217737 - try to find the main window which could be placed in secondary screen
               for( Frame f : Frame.getFrames() ) {
                   if( "NbMainWindow".equals(f.getName())) { //NOI18N
                       return f.getGraphicsConfiguration();
                   }
               }
           }
       }

       return GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().getDefaultConfiguration();
   }
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:27,代碼來源:Utilities.java

示例2: isWaitCursor

import java.awt.Frame; //導入方法依賴的package包/類
private static boolean isWaitCursor() {
    Component focus = KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusOwner();
    if (focus != null) {
        if (focus.getCursor().getType() == Cursor.WAIT_CURSOR) {
            LOG.finer("wait cursor on focus owner"); // NOI18N
            return true;
        }
        Window w = SwingUtilities.windowForComponent(focus);
        if (w != null && isWaitCursorOnWindow(w)) {
            LOG.finer("wait cursor on window"); // NOI18N
            return true;
        }
    }
    for (Frame f : Frame.getFrames()) {
        if (isWaitCursorOnWindow(f)) {
            LOG.finer("wait cursor on frame"); // NOI18N
            return true;
        }
    }
    LOG.finest("no wait cursor"); // NOI18N
    return false;
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:23,代碼來源:TimableEventQueue.java

示例3: setDefaultMenuBar

import java.awt.Frame; //導入方法依賴的package包/類
void setDefaultMenuBar(final JMenuBar menuBar) {
    installDefaultMenuBar(menuBar);

    // scan the current frames, and see if any are foreground
    final Frame[] frames = Frame.getFrames();
    for (final Frame frame : frames) {
        if (frame.isVisible() && !isFrameMinimized(frame)) {
            return;
        }
    }

    // if we have no foreground frames, then we have to "kick" the menubar
    final JFrame pingFrame = new JFrame();
    pingFrame.getRootPane().putClientProperty("Window.alpha", new Float(0.0f));
    pingFrame.setUndecorated(true);
    pingFrame.setVisible(true);
    pingFrame.toFront();
    pingFrame.setVisible(false);
    pingFrame.dispose();
}
 
開發者ID:SunburstApps,項目名稱:OpenJSharp,代碼行數:21,代碼來源:_AppMenuBarHandler.java

示例4: setDefaultMenuBar

import java.awt.Frame; //導入方法依賴的package包/類
void setDefaultMenuBar(final JMenuBar menuBar) {
    installDefaultMenuBar(menuBar);

    // scan the current frames, and see if any are foreground
    final Frame[] frames = Frame.getFrames();
    for (final Frame frame : frames) {
        if (frame.isVisible() && !isFrameMinimized(frame)) {
            return;
        }
    }

    // if we have no foreground frames, then we have to "kick" the menubar
    final JFrame pingFrame = new JFrame();
    pingFrame.getRootPane().putClientProperty("Window.alpha", Float.valueOf(0.0f));
    pingFrame.setUndecorated(true);
    pingFrame.setVisible(true);
    pingFrame.toFront();
    pingFrame.setVisible(false);
    pingFrame.dispose();
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:21,代碼來源:_AppMenuBarHandler.java

示例5: RootNode

import java.awt.Frame; //導入方法依賴的package包/類
public RootNode() {
    super();
    Window[] wns = Frame.getFrames();
    wins = new WindowNode[wns.length];
    int count = 0;
    for (Window wn1 : wns) {
        if (propDialog.showAll || wn1.isVisible()) {
            count++;
        }
    }
    wins = new WindowNode[count];
    count = 0;
    for (Window wn : wns) {
        if (propDialog.showAll || wn.isVisible()) {
            wins[count] = new WindowNode(wn);
            count++;
        }
    }
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:20,代碼來源:GUIBrowser.java

示例6: dumpComponent

import java.awt.Frame; //導入方法依賴的package包/類
/**
 * Prints component hierarchy (GUI dump) starting from {@code comp}
 * component.
 *
 * @param comp a component to get information from.
 * @param writer a writer to write to.
 */
public static void dumpComponent(Component comp, final PrintWriter writer, final DumpController listener) {
    QueueTool qt = new QueueTool();
    Component[] comps;
    if (comp != null) {
        comps = new Component[1];
        comps[0] = comp;
    } else {
        comps = Frame.getFrames();
    }
    final Component[] comps_final = comps;
    qt.invokeSmoothly(new QueueAction<Void>("dumpComponent") {
        @Override
        public Void launch() throws Exception {
            printHeader(writer);
            dumpSome("dump", comps_final, writer, "", listener);
            writer.flush();
            return null;
        }
    });
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:28,代碼來源:Dumper.java

示例7: findDialogParent

import java.awt.Frame; //導入方法依賴的package包/類
/**
 * Tries to find an appropriate component to parent the file chooser to
 * when showing a dialog.
 * @return this
 */
private Component findDialogParent() {
    Component parent = KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusOwner();
    if (parent == null) {
        parent = KeyboardFocusManager.getCurrentKeyboardFocusManager().getActiveWindow();
    }
    if (parent == null) {
        Frame[] f = Frame.getFrames();
        parent = f.length == 0 ? null : f[f.length - 1];
    }
    return parent;
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:17,代碼來源:FileChooserBuilder.java

示例8: EditorPanel

import java.awt.Frame; //導入方法依賴的package包/類
/** Creates new form EditorPanel */
public EditorPanel(IEditable layer) {
    initComponents();
    this.layer=layer;
    this.jCheckBox1.setSelected(layer.isEditable());
    this.ed=new SimpleEditorDialog(Frame.getFrames()[0], false, layer);
}
 
開發者ID:ec-europa,項目名稱:sumo,代碼行數:8,代碼來源:EditorPanel.java

示例9: ZoomWindowLayer

import java.awt.Frame; //導入方法依賴的package包/類
public ZoomWindowLayer(ImageLayer parent) {
	super(parent,"",null,null);
    init(parent);
    this.gir=parent.getImageReader();
    //this.gir = GeoImageReaderFactory.create(parent.getImageReader().getFilesList()[0]).get(0);
    this.band = parent.getActiveBand();
    //for (int b : parent.getBand()) {
    this.name += gir.getBandName(band) + " ";
    //}
    this.zd = new ZoomDialog(Frame.getFrames()[0], false, this);
    this.zd.setSize(700, 700);
    this.zd.setVisible(true);
}
 
開發者ID:ec-europa,項目名稱:sumo,代碼行數:14,代碼來源:ZoomWindowLayer.java

示例10: findDialogParent

import java.awt.Frame; //導入方法依賴的package包/類
private Component findDialogParent() {
    Component parent = KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusOwner();
    if (parent == null) {
        parent = KeyboardFocusManager.getCurrentKeyboardFocusManager().getActiveWindow();
    }
    if (parent == null) {
        Frame[] f = Frame.getFrames();
        parent = f.length == 0 ? null : f[f.length - 1];
    }
    return parent;
}
 
開發者ID:NBANDROIDTEAM,項目名稱:NBANDROID-V2,代碼行數:12,代碼來源:KeystoreSelector.java

示例11: getAWindow

import java.awt.Frame; //導入方法依賴的package包/類
private static Window getAWindow(ComponentChooser cc) {
    Window result = null;
    Frame[] frames = Frame.getFrames();
    for (Frame frame : frames) {
        if (cc.checkComponent(frame)) {
            return frame;
        }
        if ((result = WindowWaiter.getWindow(frame, cc)) != null) {
            return result;
        }
    }
    return null;
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:14,代碼來源:WindowWaiter.java

示例12: PositionLayer

import java.awt.Frame; //導入方法依賴的package包/類
public PositionLayer(ImageLayer layer) {
	super(layer,"Position",null,null);
    this.pd = new PositionDialog(Frame.getFrames()[0], false, this);
    this.pd.setVisible(true);
    super.init(parent);
}
 
開發者ID:ec-europa,項目名稱:sumo,代碼行數:7,代碼來源:PositionLayer.java

示例13: ThumbnailsSmallLayer

import java.awt.Frame; //導入方法依賴的package包/類
public ThumbnailsSmallLayer(ThumbnailsLayer layer) {
	super(layer,"",null,null);
    this.pd = new ThumbnailsDialog(Frame.getFrames()[0], false, layer);
    this.pd.setVisible(true);
    super.init((ILayer)layer);
}
 
開發者ID:ec-europa,項目名稱:sumo,代碼行數:7,代碼來源:ThumbnailsSmallLayer.java


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