home *** CD-ROM | disk | FTP | other *** search
/ Computer Shopper 139 / dpcs0999.iso / Web / CFserver / data1.cab / Java / CFJava.cab / CFJavaRuntime.cab / netscape / application / EmptyBorder.class (.txt) < prev    next >
Encoding:
Java Class File  |  1998-10-01  |  1.2 KB  |  53 lines

  1. package netscape.application;
  2.  
  3. import netscape.util.CodingException;
  4. import netscape.util.Decoder;
  5.  
  6. public class EmptyBorder extends Border {
  7.    private static Border emptyBorder;
  8.    private static Class emptyBorderClass;
  9.  
  10.    public static Border emptyBorder() {
  11.       if (emptyBorder == null) {
  12.          emptyBorder = new EmptyBorder();
  13.       }
  14.  
  15.       return emptyBorder;
  16.    }
  17.  
  18.    public int leftMargin() {
  19.       return 0;
  20.    }
  21.  
  22.    public int rightMargin() {
  23.       return 0;
  24.    }
  25.  
  26.    public int topMargin() {
  27.       return 0;
  28.    }
  29.  
  30.    public int bottomMargin() {
  31.       return 0;
  32.    }
  33.  
  34.    public void drawInRect(Graphics var1, int var2, int var3, int var4, int var5) {
  35.    }
  36.  
  37.    private static Class emptyBorderClass() {
  38.       if (emptyBorderClass == null) {
  39.          emptyBorderClass = emptyBorder().getClass();
  40.       }
  41.  
  42.       return emptyBorderClass;
  43.    }
  44.  
  45.    public void decode(Decoder var1) throws CodingException {
  46.       super.decode(var1);
  47.       if (this.getClass() == emptyBorderClass()) {
  48.          var1.replaceObject(emptyBorder());
  49.       }
  50.  
  51.    }
  52. }
  53.