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

Diff of /classpath/java/awt/Frame.java

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

revision 1.20 by kho, Tue Jan 27 22:30:38 2004 UTC revision 1.21 by mark, Thu Jul 22 19:45:38 2004 UTC
# Line 50  import java.util.Vector; Line 50  import java.util.Vector;
50    */    */
51  public class Frame extends Window implements MenuContainer  public class Frame extends Window implements MenuContainer
52  {  {
   
 /*  
  * Static Variables  
  */  
   
53  /**  /**
54    * Constant for the default cursor.    * Constant for the default cursor.
55    * @deprecated Replaced by <code>Cursor.DEFAULT_CURSOR</code> instead.    * @deprecated Replaced by <code>Cursor.DEFAULT_CURSOR</code> instead.
# Line 148  public static final int NORMAL = 0; Line 143  public static final int NORMAL = 0;
143  // Serialization version constant  // Serialization version constant
144  private static final long serialVersionUID = 2673458971256075116L;  private static final long serialVersionUID = 2673458971256075116L;
145    
 /*************************************************************************/  
   
 /*  
  * Instance Variables  
  */  
   
146  /**  /**
147    * @serial The version of the class data being serialized    * @serial The version of the class data being serialized
148    * // FIXME: what is this value?    * // FIXME: what is this value?
# Line 208  private String title = ""; Line 197  private String title = "";
197     */     */
198    private boolean undecorated = false;    private boolean undecorated = false;
199    
 /*************************************************************************/  
   
200  /*  /*
201   * Constructors     * The number used to generate the name returned by getName.
202   */   */
203      private static transient long next_frame_number = 0;
204    
205  /**  /**
206    * Initializes a new instance of <code>Frame</code> that is not visible    * Initializes a new instance of <code>Frame</code> that is not visible
# Line 224  Frame() Line 212  Frame()
212    this("");    this("");
213  }  }
214    
 /*************************************************************************/  
   
215  /**  /**
216    * Initializes a new instance of <code>Frame</code> that is not visible    * Initializes a new instance of <code>Frame</code> that is not visible
217    * and has the specified title.    * and has the specified title.
# Line 256  Frame(String title, GraphicsConfiguratio Line 242  Frame(String title, GraphicsConfiguratio
242    visible = false;    visible = false;
243  }  }
244    
 /*************************************************************************/  
   
 /*  
  * Instance Methods  
  */  
   
245  /**  /**
246    * Returns this frame's title string.    * Returns this frame's title string.
247    *    *
# Line 273  getTitle() Line 253  getTitle()
253    return(title);    return(title);
254  }  }
255    
 /*************************************************************************/  
   
256  /*  /*
257   * Sets this frame's title to the specified value.   * Sets this frame's title to the specified value.
258   *   *
# Line 288  setTitle(String title) Line 266  setTitle(String title)
266      ((FramePeer) peer).setTitle(title);      ((FramePeer) peer).setTitle(title);
267  }  }
268    
 /*************************************************************************/  
   
269  /**  /**
270    * Returns this frame's icon.    * Returns this frame's icon.
271    *    *
# Line 302  getIconImage() Line 278  getIconImage()
278    return(icon);    return(icon);
279  }  }
280    
 /*************************************************************************/  
   
281  /**  /**
282    * Sets this frame's icon to the specified value.    * Sets this frame's icon to the specified value.
283    *    *
# Line 317  setIconImage(Image icon) Line 291  setIconImage(Image icon)
291      ((FramePeer) peer).setIconImage(icon);      ((FramePeer) peer).setIconImage(icon);
292  }  }
293    
 /*************************************************************************/  
   
294  /**  /**
295    * Returns this frame's menu bar.    * Returns this frame's menu bar.
296    *    *
# Line 331  getMenuBar() Line 303  getMenuBar()
303    return(menuBar);    return(menuBar);
304  }  }
305    
 /*************************************************************************/  
   
306  /**  /**
307    * Sets this frame's menu bar.    * Sets this frame's menu bar.
308    *    *
# Line 352  setMenuBar(MenuBar menuBar) Line 322  setMenuBar(MenuBar menuBar)
322    this.menuBar = menuBar;    this.menuBar = menuBar;
323  }  }
324    
 /*************************************************************************/  
   
325  /**  /**
326    * Tests whether or not this frame is resizable.  This will be    * Tests whether or not this frame is resizable.  This will be
327    * <code>true</code> by default.    * <code>true</code> by default.
# Line 367  isResizable() Line 335  isResizable()
335    return(resizable);    return(resizable);
336  }  }
337    
 /*************************************************************************/  
   
338  /**  /**
339    * Sets the resizability of this frame to the specified value.    * Sets the resizability of this frame to the specified value.
340    *    *
# Line 383  setResizable(boolean resizable) Line 349  setResizable(boolean resizable)
349      ((FramePeer) peer).setResizable(resizable);      ((FramePeer) peer).setResizable(resizable);
350  }  }
351    
 /*************************************************************************/  
   
352  /**  /**
353    * Returns the cursor type of the cursor for this window.  This will    * Returns the cursor type of the cursor for this window.  This will
354    * be one of the constants in this class.    * be one of the constants in this class.
# Line 399  getCursorType() Line 363  getCursorType()
363    return(getCursor().getType());    return(getCursor().getType());
364  }  }
365    
 /*************************************************************************/  
   
366  /**  /**
367    * Sets the cursor for this window to the specified type.  The specified    * Sets the cursor for this window to the specified type.  The specified
368    * type should be one of the constants in this class.    * type should be one of the constants in this class.
# Line 415  setCursor(int type) Line 377  setCursor(int type)
377    setCursor(new Cursor(type));    setCursor(new Cursor(type));
378  }  }
379    
 /*************************************************************************/  
   
380  /**  /**
381    * Removes the specified component from this frame's menu.    * Removes the specified component from this frame's menu.
382    *    *
# Line 428  remove(MenuComponent menu) Line 388  remove(MenuComponent menu)
388    menuBar.remove(menu);    menuBar.remove(menu);
389  }  }
390    
 /*************************************************************************/  
   
391  /**  /**
392    * Notifies this frame that it should create its native peer.    * Notifies this frame that it should create its native peer.
393    */    */
# Line 450  public void removeNotify() Line 408  public void removeNotify()
408    super.removeNotify();    super.removeNotify();
409  }  }
410    
 /*************************************************************************/  
   
411  /**  /**
412    * Returns a debugging string describing this window.    * Returns a debugging string describing this window.
413    *    *
414    * @return A debugging string describing this window.    * @return A debugging string describing this window.
415    */    */
416  protected String    protected String paramString ()
 paramString()  
417  {  {
418    return(getClass().getName());      String title = getTitle ();
419    
420        String resizable = "";
421        if (isResizable ())
422          resizable = ",resizable";
423    
424        String state = "";
425        switch (getState ())
426          {
427          case NORMAL:
428            state = ",normal";
429            break;
430          case ICONIFIED:
431            state = ",iconified";
432            break;
433          case MAXIMIZED_BOTH:
434            state = ",maximized-both";
435            break;
436          case MAXIMIZED_HORIZ:
437            state = ",maximized-horiz";
438            break;
439          case MAXIMIZED_VERT:
440            state = ",maximized-vert";
441            break;
442          }
443    
444        return super.paramString () + ",title=" + title + resizable + state;
445  }  }
446    
447  public static Frame[]  public static Frame[]
# Line 553  getFrames() Line 534  getFrames()
534    
535      this.undecorated = undecorated;      this.undecorated = undecorated;
536    }    }
 } // class Frame  
537    
538      /**
539       * Generate a unique name for this frame.
540       *
541       * @return A unique name for this frame.
542       */
543      String generateName ()
544      {
545        return "frame" + getUniqueLong ();
546      }
547    
548      private static synchronized long getUniqueLong ()
549      {
550        return next_frame_number++;
551      }
552    }

Legend:
Removed from v.1.20  
changed lines
  Added in v.1.21

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