/[classpath]/classpath/java/awt/Window.java
ViewVC logotype

Diff of /classpath/java/awt/Window.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.14 by tromey, Sat Nov 9 23:23:25 2002 UTC revision 1.15 by mkoch, Tue Jan 14 21:30:38 2003 UTC
# Line 86  public class Window extends Container Line 86  public class Window extends Container
86     * parent.  The window will initially be invisible.     * parent.  The window will initially be invisible.
87     *     *
88     * @param parent The owning <code>Frame</code> of this window.     * @param parent The owning <code>Frame</code> of this window.
89       *
90       * @exception IllegalArgumentException If the owner's GraphicsConfiguration
91       * is not from a screen device, or if owner is null; this exception is always
92       * thrown when GraphicsEnvironment.isHeadless returns true.
93     */     */
94    public Window(Frame owner)    public Window(Frame owner)
95    {    {
96      this((Window) owner);      this (owner, owner.getGraphicsConfiguration ());
97    }    }
98    
99    /** @since 1.2 */    /**
100       * Initializes a new instance of <code>Window</code> with the specified
101       * parent.  The window will initially be invisible.  
102       *
103       * @exception IllegalArgumentException If the owner's GraphicsConfiguration
104       * is not from a screen device, or if owner is null; this exception is always
105       * thrown when GraphicsEnvironment.isHeadless returns true.
106       *
107       * @since 1.2
108       */
109    public Window(Window owner)    public Window(Window owner)
110    {    {
111      this();      this (owner, owner.getGraphicsConfiguration ());
     if (owner == null)  
       throw new IllegalArgumentException("owner must not be null");  
       
     this.parent = owner;  
   
     // FIXME: add to owner's "owned window" list  
     //owner.owned.add(this); // this should be a weak reference  
112    }    }
113        
114    /** @since 1.3 */    /**
115       * Initializes a new instance of <code>Window</code> with the specified
116       * parent.  The window will initially be invisible.  
117       *
118       * @exception IllegalArgumentException If owner is null or if gc is not from a
119       * screen device; this exception is always thrown when
120       * GraphicsEnvironment.isHeadless returns true.
121       *
122       * @since 1.3
123       */
124    public Window(Window owner, GraphicsConfiguration gc)    public Window(Window owner, GraphicsConfiguration gc)
125    {    {
126      this(owner);      this ();
127    
128        if (owner == null)
129          throw new IllegalArgumentException ("owner must not be null");
130    
131        this.parent = owner;
132        
133        // FIXME: add to owner's "owned window" list
134        //owner.owned.add(this); // this should be a weak reference
135        
136      /*  FIXME: Security check      /*  FIXME: Security check
137      SecurityManager.checkTopLevelWindow(...)      SecurityManager.checkTopLevelWindow(...)
138        */
139    
140      if (gc != null      if (gc != null
141          && gc.getDevice().getType() != GraphicsDevice.TYPE_RASTER_SCREEN)          && gc.getDevice().getType() != GraphicsDevice.TYPE_RASTER_SCREEN)
# Line 119  public class Window extends Container Line 143  public class Window extends Container
143    
144      if (gc == null)      if (gc == null)
145        graphicsConfiguration = GraphicsEnvironment.getLocalGraphicsEnvironment()        graphicsConfiguration = GraphicsEnvironment.getLocalGraphicsEnvironment()
146                               .getDefaultScreenDevice()          .getDefaultScreenDevice()
147                               .getDefaultConfiguration();          .getDefaultConfiguration();
148      else      else
149      */            graphicsConfiguration = gc;
     graphicsConfiguration = gc;  
150    }    }
151    
152    GraphicsConfiguration getGraphicsConfigurationImpl()    GraphicsConfiguration getGraphicsConfigurationImpl()
# Line 134  public class Window extends Container Line 157  public class Window extends Container
157      return super.getGraphicsConfigurationImpl();      return super.getGraphicsConfigurationImpl();
158    }    }
159    
160      /**
161       * Disposes of the input methods and context, and removes the WeakReference
162       * which formerly pointed to this Window from the parent's owned Window list.
163       *
164       * @exception Throwable The Exception raised by this method.
165       */
166    protected void finalize() throws Throwable    protected void finalize() throws Throwable
167    {    {
168      // FIXME: remove from owner's "owned window" list (Weak References)      // FIXME: remove from owner's "owned window" list (Weak References)
# Line 185  public class Window extends Container Line 214  public class Window extends Container
214    
215    public void hide()    public void hide()
216    {    {
217      // FIXME: call hide() on amy "owned" children here.      // FIXME: call hide() on any "owned" children here.
218      super.hide();      super.hide();
219    }    }
220    
# Line 233  public class Window extends Container Line 262  public class Window extends Container
262    {    {
263      if (peer != null)      if (peer != null)
264        {        {
265          WindowPeer wp = (WindowPeer) peer;          WindowPeer wp = (WindowPeer) peer;
266          wp.toFront();          wp.toFront();
267        }        }
268    }    }
269    
# Line 265  public class Window extends Container Line 294  public class Window extends Container
294      if (!secure)      if (!secure)
295        {        {
296          if (warningString != null)          if (warningString != null)
297            return warningString;            return warningString;
298          else          else
299            {            {
300              String warning = System.getProperty("awt.appletWarning");              String warning = System.getProperty("awt.appletWarning");
301              return warning;              return warning;
302            }            }
303        }        }
304      return null;      return null;
305    }    }
# Line 338  public class Window extends Container Line 367  public class Window extends Container
367      windowListener = AWTEventMulticaster.remove(windowListener, listener);      windowListener = AWTEventMulticaster.remove(windowListener, listener);
368    }    }
369    
370      /**
371       * Returns an array of all the window listeners registered on this window.
372       *
373       * @since 1.4
374       */
375    public synchronized WindowListener[] getWindowListeners()    public synchronized WindowListener[] getWindowListeners()
376    {    {
377      return (WindowListener[])      return (WindowListener[])
# Line 345  public class Window extends Container Line 379  public class Window extends Container
379                                         WindowListener.class);                                         WindowListener.class);
380    }    }
381    
382    /** @since 1.3 */    /**
383       * Returns an array of all the objects currently registered as FooListeners
384       * upon this Window. FooListeners are registered using the addFooListener
385       * method.
386       *
387       * @exception ClassCastException If listenerType doesn't specify a class or
388       * interface that implements java.util.EventListener.
389       *
390       * @since 1.3
391       */
392    public EventListener[] getListeners(Class listenerType)    public EventListener[] getListeners(Class listenerType)
393    {    {
394      if (listenerType == WindowListener.class)      if (listenerType == WindowListener.class)

Legend:
Removed from v.1.14  
changed lines
  Added in v.1.15

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26