本文整理匯總了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();
}
示例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;
}
示例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();
}
示例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();
}
示例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++;
}
}
}
示例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;
}
});
}
示例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;
}
示例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);
}
示例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);
}
示例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;
}
示例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;
}
示例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);
}
示例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);
}