155 |
} |
} |
156 |
} |
} |
157 |
}); |
}); |
158 |
|
|
159 |
|
GraphicsEnvironment g = GraphicsEnvironment.getLocalGraphicsEnvironment(); |
160 |
|
graphicsConfiguration = g.getDefaultScreenDevice().getDefaultConfiguration(); |
161 |
} |
} |
162 |
|
|
163 |
Window(GraphicsConfiguration gc) |
Window(GraphicsConfiguration gc) |
622 |
|| windowStateListener != null |
|| windowStateListener != null |
623 |
|| (eventMask & AWTEvent.WINDOW_EVENT_MASK) != 0)) |
|| (eventMask & AWTEvent.WINDOW_EVENT_MASK) != 0)) |
624 |
processEvent(e); |
processEvent(e); |
625 |
|
else if (e.id == ComponentEvent.COMPONENT_RESIZED) |
626 |
|
validate (); |
627 |
else |
else |
628 |
super.dispatchEventImpl(e); |
super.dispatchEventImpl(e); |
629 |
} |
} |
746 |
if (activeWindow == this) |
if (activeWindow == this) |
747 |
return manager.getFocusOwner (); |
return manager.getFocusOwner (); |
748 |
else |
else |
749 |
return windowFocusOwner; |
return null; |
750 |
|
} |
751 |
|
|
752 |
|
/** |
753 |
|
* Returns the child component of this window that would receive |
754 |
|
* focus if this window were to become focused. If the window |
755 |
|
* already has the top-level focus, then this method returns the |
756 |
|
* same component as getFocusOwner. If no child component has |
757 |
|
* requested focus within the window, then the initial focus owner |
758 |
|
* is returned. If this is a non-focusable window, this method |
759 |
|
* returns null. |
760 |
|
* |
761 |
|
* @return the child component of this window that most recently had |
762 |
|
* the focus, or <code>null</code> |
763 |
|
* @since 1.4 |
764 |
|
*/ |
765 |
|
public Component getMostRecentFocusOwner () |
766 |
|
{ |
767 |
|
return windowFocusOwner; |
768 |
} |
} |
769 |
|
|
770 |
/** |
/** |
1093 |
this.focusableWindowState = focusableWindowState; |
this.focusableWindowState = focusableWindowState; |
1094 |
} |
} |
1095 |
|
|
|
// setBoundsCallback is needed so that when a user moves a window, |
|
|
// the Window's location can be updated without calling the peer's |
|
|
// setBounds method. When a user moves a window the peer window's |
|
|
// location is updated automatically and the windowing system sends |
|
|
// a message back to the application informing it of its updated |
|
|
// dimensions. We must update the AWT Window class with these new |
|
|
// dimensions. But we don't want to call the peer's setBounds |
|
|
// method, because the peer's dimensions have already been updated. |
|
|
// (Under X, having this method prevents Configure event loops when |
|
|
// moving windows: Component.setBounds -> peer.setBounds -> |
|
|
// postConfigureEvent -> Component.setBounds -> ... In some cases |
|
|
// Configure event loops cause windows to jitter back and forth |
|
|
// continuously). |
|
|
void setBoundsCallback (int x, int y, int w, int h) |
|
|
{ |
|
|
if (this.x == x && this.y == y && width == w && height == h) |
|
|
return; |
|
|
invalidate(); |
|
|
boolean resized = width != w || height != h; |
|
|
boolean moved = this.x != x || this.y != y; |
|
|
this.x = x; |
|
|
this.y = y; |
|
|
width = w; |
|
|
height = h; |
|
|
if (resized && isShowing ()) |
|
|
{ |
|
|
ComponentEvent ce = |
|
|
new ComponentEvent(this, ComponentEvent.COMPONENT_RESIZED); |
|
|
getToolkit().getSystemEventQueue().postEvent(ce); |
|
|
} |
|
|
if (moved && isShowing ()) |
|
|
{ |
|
|
ComponentEvent ce = |
|
|
new ComponentEvent(this, ComponentEvent.COMPONENT_MOVED); |
|
|
getToolkit().getSystemEventQueue().postEvent(ce); |
|
|
} |
|
|
} |
|
|
|
|
1096 |
/** |
/** |
1097 |
* Generate a unique name for this window. |
* Generate a unique name for this window. |
1098 |
* |
* |