home *** CD-ROM | disk | FTP | other *** search
/ MacHack 1998 / MacHack 1998.toast / Papers / OS Shell in Java / Facade / DesktopComponent.java < prev    next >
Encoding:
Java Source  |  1998-06-18  |  1.4 KB  |  73 lines  |  [TEXT/dosa]

  1. //    DesktopComponent.java : this is a Java source code file for the program Facade.
  2. //    Copyright 1998, Andrew S. Downs
  3. //    andrew.downs@tulane.edu
  4. //
  5. //    This source code is distributed as freeware.
  6. //    Just keep this author information in the file.  Enjoy!
  7.  
  8. import java.awt.*;
  9. import java.io.*;
  10.  
  11. public class DesktopComponent extends Component implements Serializable {
  12.     String label;
  13.     
  14.     DesktopComponent() {
  15.         super();
  16.     }
  17.  
  18.     DesktopComponent( String s ) {
  19.         super();
  20.         this.setLabel( s );
  21.     }
  22.  
  23.     public void setLabel( String s ) {
  24.         this.label = s;
  25.     }
  26.  
  27.     public String getLabel() {
  28.         return this.label;
  29.     }
  30.  
  31.     public void setX( int i ) {
  32.         this.setLocation( i, this.getLocation().y );
  33.     }
  34.  
  35.     public int getX() {
  36.         return this.getLocation().x;
  37.     }
  38.  
  39.     public void setY( int i ) {
  40.         this.setLocation( this.getLocation().x, i );
  41.     }
  42.  
  43.     public int getY() {
  44.         return this.getLocation().y;
  45.     }
  46.  
  47.     public void setWidth( int i ) {
  48.         this.setSize( i, this.getSize().height );
  49.     }
  50.  
  51.     public int getWidth() {
  52.         return this.getSize().width;
  53.     }
  54.  
  55.     public void setHeight( int i ) {
  56.         this.setSize( this.getSize().width, i );
  57.     }
  58.  
  59.     public int getHeight() {
  60.         return this.getSize().height;
  61.     }
  62.  
  63.     private void writeObject( ObjectOutputStream s ) throws IOException {
  64.         s.defaultWriteObject();
  65.     }
  66.  
  67.     private void readObject( ObjectInputStream s ) throws ClassNotFoundException, IOException {
  68.         s.defaultReadObject();
  69.     }
  70. }
  71.  
  72.  
  73.