Ignore:
Timestamp:
Apr 27, 2004, 8:39:34 PM (22 years ago)
Author:
bird
Message:

GCC v3.3.3 sources.

Location:
branches/GNU/src/gcc
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/GNU/src/gcc

    • Property svn:ignore
      •  

        old new  
        2626configure.vr
        2727configure.vrs
         28
        2829Makefile
        29 dir.info
        3030lost+found
        3131update.out
  • branches/GNU/src/gcc/libjava/java/awt/Window.java

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.1.1.2
    r1390 r1391  
    1 /* Copyright (C) 1999, 2000, 2002  Free Software Foundation
    2 
    3    Copyright (C) 1999 Free Software Foundation, Inc.
     1/* Window.java --
     2   Copyright (C) 1999, 2000, 2002 Free Software Foundation
    43
    54This file is part of GNU Classpath.
     
    3736exception statement from your version. */
    3837
     38
    3939package java.awt;
     40
    4041import java.awt.event.WindowEvent;
    4142import java.awt.event.WindowListener;
     
    8687   *
    8788   * @param parent The owning <code>Frame</code> of this window.
     89
     90
     91
     92
    8893   */
    8994  public Window(Frame owner)
    9095  {
    91     this((Window) owner);
    92   }
    93 
    94   /** @since 1.2 */
     96    this (owner, owner.getGraphicsConfiguration ());
     97  }
     98
     99  /**
     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   */
    95109  public Window(Window owner)
    96110  {
    97     this();
     111    this (owner, owner.getGraphicsConfiguration ());
     112  }
     113 
     114  /**
     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)
     125  {
     126    this ();
     127
    98128    if (owner == null)
    99       throw new IllegalArgumentException("owner must not be null");
     129      throw new IllegalArgumentException ("owner must not be null");
     130
     131    this.parent = owner;
    100132   
    101     this.parent = owner;
    102 
    103133    // FIXME: add to owner's "owned window" list
    104134    //owner.owned.add(this); // this should be a weak reference
    105   }
    106  
    107   /** @since 1.3 */
    108   public Window(Window owner, GraphicsConfiguration gc)
    109   {
    110     this(owner);
    111 
     135   
    112136    /*  FIXME: Security check
    113137    SecurityManager.checkTopLevelWindow(...)
     138
    114139
    115140    if (gc != null
     
    119144    if (gc == null)
    120145      graphicsConfiguration = GraphicsEnvironment.getLocalGraphicsEnvironment()
    121                              .getDefaultScreenDevice()
    122                              .getDefaultConfiguration();
     146     .getDefaultScreenDevice()
     147     .getDefaultConfiguration();
    123148    else
    124     */   
    125     graphicsConfiguration = gc;
     149      graphicsConfiguration = gc;
    126150  }
    127151
     
    134158  }
    135159
     160
     161
     162
     163
     164
     165
    136166  protected void finalize() throws Throwable
    137167  {
     
    146176  {
    147177    if (peer == null)
    148       peer = getToolkit ().createWindow (this);
    149     super.addNotify ();
     178      peer = getToolkit(this);
     179    super.addNotify();
    150180  }
    151181
     
    158188  public void pack()
    159189  {
    160     if (parent != null
    161         && !parent.isDisplayable())
     190    if (parent != null && !parent.isDisplayable())
    162191      parent.addNotify();
    163192    if (peer == null)
     
    165194
    166195    setSize(getPreferredSize());
    167    
     196
    168197    validate();
    169198  }
     
    172201   * Makes this window visible and brings it to the front.
    173202   */
    174   public void show ()
    175   {
     203  public void show()
     204  {
     205    if (parent != null && !parent.isDisplayable())
     206      parent.addNotify();
    176207    if (peer == null)
    177208      addNotify();
    178209
     210
    179211    super.show();
    180212    toFront();
     
    183215  public void hide()
    184216  {
    185     // FIXME: call hide() on amy "owned" children here.
     217    // FIXME: call hide() on ay "owned" children here.
    186218    super.hide();
     219
     220
     221
     222
     223
     224
     225
    187226  }
    188227
     
    207246   * front of it.
    208247   */
    209   public void toBack ()
     248  public void toBack()
    210249  {
    211250    if (peer != null)
    212251      {
    213252        WindowPeer wp = (WindowPeer) peer;
    214         wp.toBack ();
     253        wp.toBack();
    215254      }
    216255  }
     
    220259   * any other windows.
    221260   */
    222   public void toFront ()
     261  public void toFront()
    223262  {
    224263    if (peer != null)
    225264      {
    226         WindowPeer wp = (WindowPeer) peer;
    227         wp.toFront ();
     265WindowPeer wp = (WindowPeer) peer;
     266();
    228267      }
    229268  }
     
    239278  public Toolkit getToolkit()
    240279  {
    241     return Toolkit.getDefaultToolkit ();   
     280    return Toolkit.getDefaultToolkit();   
    242281  }
    243282
     
    256295      {
    257296        if (warningString != null)
    258           return warningString;
    259         else
    260           {
    261             String warning = System.getProperty("awt.appletWarning");
    262             return warning;
    263           }
     297  return warningString;
     298else
     299  {
     300    String warning = System.getProperty("awt.appletWarning");
     301    return warning;
     302  }
    264303      }
    265304    return null;
     
    271310   * @return The locale this window is configured for.
    272311   */
    273   public Locale getLocale ()
    274   {
    275     return locale == null ? Locale.getDefault () : locale;
     312  public Locale getLocale()
     313  {
     314    return locale == null ? Locale.getDefault() : locale;
    276315  }
    277316
     
    313352   * @param listener The <code>WindowListener</code> to add.
    314353   */
    315   public synchronized void addWindowListener (WindowListener listener)
    316   {
    317     windowListener = AWTEventMulticaster.add (windowListener, listener);
     354  public synchronized void addWindowListener(WindowListener listener)
     355  {
     356    windowListener = AWTEventMulticaster.add(windowListener, listener);
    318357  }
    319358
     
    324363   * @param listener The <code>WindowListener</code> to remove.
    325364   */
    326   public synchronized void removeWindowListener (WindowListener listener)
    327   {
    328     windowListener = AWTEventMulticaster.remove (windowListener, listener);
    329   }
    330 
    331   /** @since 1.3 */
     365  public synchronized void removeWindowListener(WindowListener listener)
     366  {
     367    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()
     376  {
     377    return (WindowListener[])
     378      AWTEventMulticaster.getListeners(windowListener,
     379                                       WindowListener.class);
     380  }
     381
     382  /**
     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   */
    332392  public EventListener[] getListeners(Class listenerType)
    333393  {
    334394    if (listenerType == WindowListener.class)
    335       return getListenersImpl(listenerType, windowListener);
    336     else return super.getListeners(listenerType);
     395      return get);
     396    return super.getListeners(listenerType);
    337397  }
    338398
     
    357417   * @param event The event to process.
    358418   */
    359   protected void processEvent (AWTEvent evt)
     419  protected void processEvent(AWTEvent evt)
    360420  {
    361421    if (evt instanceof WindowEvent)
    362       processWindowEvent ((WindowEvent) evt);
     422      processWindowEvent((WindowEvent) evt);
    363423    else
    364       super.processEvent (evt);
     424      super.processEvent(evt);
    365425  }
    366426
     
    373433   * @param event The event to process.
    374434   */
    375   protected void processWindowEvent (WindowEvent evt)
     435  protected void processWindowEvent(WindowEvent evt)
    376436  {
    377437    if (windowListener != null)
    378438      {
    379         switch (evt.getID ())
     439        switch (evt.getID())
    380440          {
    381441          case WindowEvent.WINDOW_ACTIVATED:
    382             windowListener.windowActivated (evt);
     442            windowListener.windowActivated(evt);
    383443            break;
    384444          case WindowEvent.WINDOW_CLOSED:
    385             windowListener.windowClosed (evt);
     445            windowListener.windowClosed(evt);
    386446            break;
    387447          case WindowEvent.WINDOW_CLOSING:
    388             windowListener.windowClosing (evt);
     448            windowListener.windowClosing(evt);
    389449            break;
    390450          case WindowEvent.WINDOW_DEACTIVATED:
    391             windowListener.windowDeactivated (evt);
     451            windowListener.windowDeactivated(evt);
    392452            break;
    393453          case WindowEvent.WINDOW_DEICONIFIED:
    394             windowListener.windowDeiconified (evt);
     454            windowListener.windowDeiconified(evt);
    395455            break;
    396456          case WindowEvent.WINDOW_ICONIFIED:
    397             windowListener.windowIconified (evt);
     457            windowListener.windowIconified(evt);
    398458            break;
    399459          case WindowEvent.WINDOW_OPENED:
    400             windowListener.windowOpened (evt);
     460            windowListener.windowOpened(evt);
    401461            break;
    402462          }
     
    472532    return null;
    473533  }
    474 
    475534}
Note: See TracChangeset for help on using the changeset viewer.