diff options
author | Andrew John Hughes <gnu_andrew@member.fsf.org> | 2006-10-05 02:44:18 +0000 |
---|---|---|
committer | Andrew John Hughes <gnu_andrew@member.fsf.org> | 2006-10-05 02:44:18 +0000 |
commit | 2799793789d5b66c90efbd1a3eb56e0c1ec57f88 (patch) | |
tree | 9157197f502b6830af9cafe029fd3d47628a7ed6 /java/awt/Window.java | |
parent | 7516107c5abe26f7a4378017344eb9e449ebc28e (diff) | |
download | classpath-2799793789d5b66c90efbd1a3eb56e0c1ec57f88.tar.gz |
2006-10-05 Andrew John Hughes <gnu_andrew@member.fsf.org>
* Merge of HEAD-->generics for 2006/09/03-2006/10/04.
Diffstat (limited to 'java/awt/Window.java')
-rw-r--r-- | java/awt/Window.java | 54 |
1 files changed, 23 insertions, 31 deletions
diff --git a/java/awt/Window.java b/java/awt/Window.java index 322fbdeb0..7a3092f81 100644 --- a/java/awt/Window.java +++ b/java/awt/Window.java @@ -140,7 +140,7 @@ public class Window extends Container implements Accessible this(); graphicsConfiguration = gc; } - + /** * Initializes a new instance of <code>Window</code> with the specified * parent. The window will initially be invisible. @@ -257,8 +257,6 @@ public class Window extends Container implements Accessible { synchronized (getTreeLock()) { - if (parent != null && ! parent.isDisplayable()) - parent.addNotify(); if (peer == null) addNotify(); @@ -300,6 +298,15 @@ public class Window extends Container implements Accessible if (initialFocusOwner != null) initialFocusOwner.requestFocusInWindow(); + // Post WINDOW_OPENED from here. + if (windowListener != null + || (eventMask & AWTEvent.WINDOW_EVENT_MASK) != 0) + { + WindowEvent ev = new WindowEvent(this, + WindowEvent.WINDOW_OPENED); + Toolkit tk = Toolkit.getDefaultToolkit(); + tk.getSystemEventQueue().postEvent(ev); + } shown = true; } } @@ -355,9 +362,15 @@ public class Window extends Container implements Accessible component[i].removeNotify(); this.removeNotify(); - // Post a WINDOW_CLOSED event. - WindowEvent we = new WindowEvent(this, WindowEvent.WINDOW_CLOSED); - getToolkit().getSystemEventQueue().postEvent(we); + // Post WINDOW_CLOSED from here. + if (windowListener != null + || (eventMask & AWTEvent.WINDOW_EVENT_MASK) != 0) + { + WindowEvent ev = new WindowEvent(this, + WindowEvent.WINDOW_OPENED); + Toolkit tk = Toolkit.getDefaultToolkit(); + tk.getSystemEventQueue().postEvent(ev); + } } } @@ -592,33 +605,12 @@ public class Window extends Container implements Accessible void dispatchEventImpl(AWTEvent e) { - // Make use of event id's in order to avoid multiple instanceof tests. - if (e.id <= WindowEvent.WINDOW_LAST - && e.id >= WindowEvent.WINDOW_FIRST - && (windowListener != null - || windowFocusListener != null - || windowStateListener != null - || (eventMask & AWTEvent.WINDOW_EVENT_MASK) != 0)) - processEvent(e); - else + if (e.getID() == ComponentEvent.COMPONENT_RESIZED) { - if (peer != null && (e.id == ComponentEvent.COMPONENT_RESIZED - || e.id == ComponentEvent.COMPONENT_MOVED)) - { - Rectangle bounds = peer.getBounds(); - x = bounds.x; - y = bounds.y; - height = bounds.height; - width = bounds.width; - - if (e.id == ComponentEvent.COMPONENT_RESIZED) - { - invalidate(); - validate(); - } - } - super.dispatchEventImpl(e); + invalidate(); + validate(); } + super.dispatchEventImpl(e); } /** |